@devvistatech/devvista-kit 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/app/ClientLayout.tsx +66 -0
- package/app/about/page.tsx +11 -248
- package/app/adRequest/page.tsx +101 -25
- package/app/admin-profile/page.tsx +123 -0
- package/app/analytics/page.tsx +41 -5
- package/app/api/about/route.ts +2 -18
- package/app/api/adRequest/route.ts +7 -27
- package/app/api/analytics/[reportType]/route.ts +1 -64
- package/app/api/bio/route.ts +1 -17
- package/app/api/blog/route.ts +1 -19
- package/app/api/contacts/route.ts +1 -46
- package/app/api/files/route.ts +1 -15
- package/app/api/gallery-data/route.ts +53 -61
- package/app/api/schedule/route.ts +5 -21
- package/app/api/signup/route.ts +129 -0
- package/app/api/sync-user/route.ts +268 -94
- package/app/api/verify-admin/route.ts +46 -0
- package/app/blog/[id]/page.tsx +71 -52
- package/app/blog/page.tsx +43 -10
- package/app/favicon.ico +0 -0
- package/app/gallery/page.tsx +27 -6
- package/app/layout.tsx +31 -82
- package/app/page.tsx +20 -311
- package/app/products/constants/product.ts +27 -0
- package/app/products/page.tsx +296 -0
- package/app/products/productOne/page.tsx +266 -0
- package/app/products/productTwo/page.tsx +272 -0
- package/app/schedule/page.tsx +78 -40
- package/bin/init.js +0 -12
- package/components/addOns/functional/ClassList.tsx +21 -17
- package/components/addOns/functional/ProductList.tsx +1027 -0
- package/components/addOns/functional/aboutSections/AboutSection.tsx +107 -70
- package/components/addOns/functional/aboutSections/constants/aboutSection.ts +9 -4
- package/components/addOns/functional/banner/Banner.tsx +150 -0
- package/components/addOns/functional/banner/BannerDashboard.tsx +283 -0
- package/components/addOns/functional/bioSections/BioEditor.tsx +471 -0
- package/components/addOns/functional/bioSections/constants/bioEditor.ts +36 -0
- package/components/addOns/functional/blogSections/BlogDashboard.tsx +1 -1
- package/components/addOns/functional/blogSections/BlogFormPopUp.tsx +2 -1
- package/components/addOns/functional/{ImageDescCarousel.tsx → carousels/ImageDescCarousel.tsx} +166 -57
- package/components/addOns/functional/carousels/ProductDescCarousel.tsx +1129 -0
- package/components/addOns/functional/{ScheduleCarousel.tsx → carousels/ScheduleCarousel.tsx} +110 -50
- package/components/addOns/functional/carousels/constants.ts/productDescCarousel.ts +197 -0
- package/components/addOns/functional/carousels/constants.ts/scheduleCarousel.ts +20 -0
- package/components/addOns/functional/contactsDashboard/ContactsDashboard.tsx +1 -1
- package/components/addOns/functional/fileUploaders/FileUploader.tsx +437 -0
- package/components/addOns/functional/fileUploaders/constants/fileUploader.ts +45 -0
- package/components/addOns/functional/galleries/GalleryComplex.tsx +468 -267
- package/components/addOns/functional/galleries/GallerySimple.tsx +78 -50
- package/components/addOns/functional/galleries/ThreeSetGallery.tsx +260 -0
- package/components/addOns/functional/schedules/ScheduleGridOne.tsx +22 -8
- package/components/addOns/functional/schedules/ScheduleGridTwo.tsx +12 -7
- package/components/addOns/functional/schedules/ScheduleGridTwoBasic.tsx +12 -7
- package/components/addOns/non-functional/SampleCarousel.tsx +3 -3
- package/components/addOns/non-functional/ThreeSetGallery.tsx +3 -3
- package/components/addOns/non-functional/featureSections/FeaturesSection.tsx +74 -0
- package/components/addOns/non-functional/featureSections/constants/featuresSection.ts +30 -0
- package/components/addOns/non-functional/{Heros/HeroSection.tsx → heros/HomeHero.tsx} +17 -15
- package/components/addOns/non-functional/heros/ProductHero.tsx +111 -0
- package/components/addOns/non-functional/heros/constants/hero.ts +62 -0
- package/components/addOns/non-functional/imageCarousels/ProductSlider.tsx +6 -6
- package/components/addOns/non-functional/imageCarousels/ProgramCarousel.tsx +10 -10
- package/components/footers/footer.tsx +161 -198
- package/components/other/admin-menu.tsx +1 -1
- package/lib/auth/auth-context.tsx +225 -0
- package/lib/auth/auth-utils.tsx +30 -0
- package/lib/constants/adRequest.ts +199 -56
- package/lib/constants/admin-profile.ts +12 -0
- package/lib/constants/page.ts +15 -15
- package/lib/google/google-analytics-tracking.tsx +44 -0
- package/lib/types.ts +235 -0
- package/lib/utils/compressImage.tsx +32 -0
- package/middleware.ts +9 -5
- package/next.config.js +1 -1
- package/package.json +3 -2
- package/public/images/test.png +0 -0
- package/components/addOns/functional/BioEditor.tsx +0 -447
- package/components/addOns/functional/FileUploader.tsx +0 -295
- package/components/addOns/non-functional/FeaturesSection.tsx +0 -63
- package/components/types.ts +0 -50
- package/lib/auth-context.tsx +0 -131
- package/lib/verify-user.ts +0 -118
- /package/lib/{google-analytics.tsx → google/google-analytics.tsx} +0 -0
package/components/addOns/functional/{ScheduleCarousel.tsx → carousels/ScheduleCarousel.tsx}
RENAMED
|
@@ -1,33 +1,82 @@
|
|
|
1
|
+
// src/components/addOns/functional/carousels/ScheduleCarousel.tsx
|
|
1
2
|
"use client";
|
|
2
3
|
|
|
3
|
-
import { useState, useEffect } from "react";
|
|
4
|
+
import { useState, useEffect, useRef } from "react";
|
|
5
|
+
import { motion } from "framer-motion";
|
|
4
6
|
import { Card } from "@/components/other/card";
|
|
7
|
+
import Spinner from "@/components/addOns/non-functional/spinner";
|
|
8
|
+
import { SCHEDULE_CAROUSEL } from "@/components/addOns/functional/carousels/constants.ts/scheduleCarousel";
|
|
5
9
|
|
|
6
10
|
interface ScheduleClass {
|
|
7
11
|
name: string;
|
|
8
12
|
startTime: string;
|
|
9
13
|
endTime: string;
|
|
14
|
+
id?: string;
|
|
10
15
|
}
|
|
11
16
|
|
|
12
17
|
interface WeeklySchedule {
|
|
13
18
|
[key: string]: ScheduleClass[];
|
|
14
19
|
}
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
weeklySchedule
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function ScheduleCarousel({
|
|
23
|
-
weeklySchedule,
|
|
24
|
-
backgroundImages,
|
|
25
|
-
error,
|
|
26
|
-
}: ScheduleCarouselProps) {
|
|
21
|
+
export function ScheduleCarousel() {
|
|
22
|
+
const [weeklySchedule, setWeeklySchedule] = useState<WeeklySchedule>({
|
|
23
|
+
Monday: [], Tuesday: [], Wednesday: [], Thursday: [], Friday: [], Saturday: [], Sunday: [],
|
|
24
|
+
});
|
|
27
25
|
const [currentDayIndex, setCurrentDayIndex] = useState(0);
|
|
26
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
27
|
+
const [error, setError] = useState<string | null>(null);
|
|
28
|
+
const hasFetched = useRef(false);
|
|
29
|
+
|
|
30
|
+
const numberToDayKey: { [key: number]: string } = {
|
|
31
|
+
1: "Monday", 2: "Tuesday", 3: "Wednesday", 4: "Thursday", 5: "Friday", 6: "Saturday", 7: "Sunday",
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// Fetch schedule data
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (hasFetched.current) return;
|
|
37
|
+
hasFetched.current = true;
|
|
38
|
+
|
|
39
|
+
const fetchSchedule = async () => {
|
|
40
|
+
setIsLoading(true);
|
|
41
|
+
try {
|
|
42
|
+
const response = await fetch(`/api/schedule?t=${Date.now()}`, {
|
|
43
|
+
headers: { "Content-Type": "application/json" },
|
|
44
|
+
cache: "no-store",
|
|
45
|
+
});
|
|
46
|
+
if (response.ok) {
|
|
47
|
+
const result = await response.json();
|
|
48
|
+
const updatedSchedule: WeeklySchedule = {
|
|
49
|
+
Monday: [], Tuesday: [], Wednesday: [], Thursday: [], Friday: [], Saturday: [], Sunday: [],
|
|
50
|
+
};
|
|
51
|
+
(result.data || []).forEach((event: any) => {
|
|
52
|
+
event.daysOfWeek.forEach((dayNum: number) => {
|
|
53
|
+
const dayKey = numberToDayKey[dayNum];
|
|
54
|
+
if (dayKey && updatedSchedule[dayKey]) {
|
|
55
|
+
updatedSchedule[dayKey].push({
|
|
56
|
+
name: event.title || "Untitled",
|
|
57
|
+
startTime: event.startTime || "00:00",
|
|
58
|
+
endTime: event.endTime || "00:00",
|
|
59
|
+
id: event.id,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
setWeeklySchedule(updatedSchedule);
|
|
65
|
+
} else {
|
|
66
|
+
throw new Error(SCHEDULE_CAROUSEL.ERRORS.FETCH_SCHEDULE_FAILED);
|
|
67
|
+
}
|
|
68
|
+
} catch (err) {
|
|
69
|
+
setError(err instanceof Error ? err.message : SCHEDULE_CAROUSEL.ERRORS.FETCH_ERROR);
|
|
70
|
+
} finally {
|
|
71
|
+
setIsLoading(false);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
fetchSchedule();
|
|
75
|
+
}, []);
|
|
28
76
|
|
|
77
|
+
// Preload background images and set up carousel interval
|
|
29
78
|
useEffect(() => {
|
|
30
|
-
|
|
79
|
+
SCHEDULE_CAROUSEL.UI.BACKGROUND_IMAGES.forEach((image) => {
|
|
31
80
|
const img = new Image();
|
|
32
81
|
img.src = image;
|
|
33
82
|
});
|
|
@@ -37,41 +86,52 @@ export function ScheduleCarousel({
|
|
|
37
86
|
setCurrentDayIndex((prev) => (prev === days.length - 1 ? 0 : prev + 1));
|
|
38
87
|
}, 5000);
|
|
39
88
|
return () => clearInterval(interval);
|
|
40
|
-
}, [weeklySchedule
|
|
89
|
+
}, [weeklySchedule]);
|
|
90
|
+
|
|
91
|
+
const sectionVariants = {
|
|
92
|
+
hidden: { opacity: 0, y: 20 },
|
|
93
|
+
visible: { opacity: 1, y: 0, transition: { duration: 0.5, ease: "easeOut" } },
|
|
94
|
+
};
|
|
41
95
|
|
|
42
96
|
return (
|
|
43
97
|
<div className="w-full bg-black z-0">
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
98
|
+
<style jsx>{`
|
|
99
|
+
:root {
|
|
100
|
+
--jubilee: #F47C7C;
|
|
101
|
+
--exuberant-blue: #FF69B4;
|
|
102
|
+
}
|
|
103
|
+
.schedule-background {
|
|
104
|
+
position: absolute;
|
|
105
|
+
top: 0;
|
|
106
|
+
left: 0;
|
|
107
|
+
width: 100%;
|
|
108
|
+
height: 100%;
|
|
109
|
+
background-size: cover;
|
|
110
|
+
background-position: center;
|
|
111
|
+
transition: opacity 0.5s ease-in-out;
|
|
112
|
+
opacity: 0;
|
|
113
|
+
}
|
|
114
|
+
.schedule-background.active {
|
|
115
|
+
opacity: 1;
|
|
116
|
+
}
|
|
117
|
+
.schedule-overlay {
|
|
118
|
+
position: absolute;
|
|
119
|
+
top: 0;
|
|
120
|
+
left: 0;
|
|
121
|
+
width: 100%;
|
|
122
|
+
height: 100%;
|
|
123
|
+
background: rgba(0, 0, 0, 0.3);
|
|
124
|
+
z-index: 1;
|
|
125
|
+
}
|
|
126
|
+
`}</style>
|
|
127
|
+
<motion.section
|
|
128
|
+
variants={sectionVariants}
|
|
129
|
+
initial="hidden"
|
|
130
|
+
animate="visible"
|
|
131
|
+
className="w-full py-16 sm:py-24 px-4 sm:px-8 relative"
|
|
132
|
+
>
|
|
73
133
|
<div className="absolute inset-0 z-0 w-full h-full">
|
|
74
|
-
{
|
|
134
|
+
{SCHEDULE_CAROUSEL.UI.BACKGROUND_IMAGES.map((image, index) => (
|
|
75
135
|
<div
|
|
76
136
|
key={index}
|
|
77
137
|
className={`schedule-background ${index === currentDayIndex ? "active" : ""}`}
|
|
@@ -80,9 +140,10 @@ export function ScheduleCarousel({
|
|
|
80
140
|
))}
|
|
81
141
|
<div className="schedule-overlay" />
|
|
82
142
|
</div>
|
|
83
|
-
|
|
84
143
|
<div className="relative z-10 h-[600px] sm:h-[800px] overflow-hidden">
|
|
85
|
-
{
|
|
144
|
+
{isLoading ? (
|
|
145
|
+
<Spinner />
|
|
146
|
+
) : error ? (
|
|
86
147
|
<div
|
|
87
148
|
className="text-center !text-white text-4xl sm:text-5xl font-semibold h-full flex items-center justify-center max-w-full"
|
|
88
149
|
style={{ textShadow: "2px 2px 4px rgba(0, 0, 0, 0.5)" }}
|
|
@@ -111,12 +172,11 @@ export function ScheduleCarousel({
|
|
|
111
172
|
>
|
|
112
173
|
{day}
|
|
113
174
|
</h3>
|
|
114
|
-
|
|
115
175
|
<ul className="space-y-6 font-semibold text-center mt-8 max-w-full">
|
|
116
176
|
{classes.length > 0 ? (
|
|
117
177
|
classes.map((cls) => (
|
|
118
178
|
<li
|
|
119
|
-
key={`${cls.startTime}-${cls.endTime}`}
|
|
179
|
+
key={`${cls.id || `${cls.startTime}-${cls.endTime}`}`}
|
|
120
180
|
className="text-2xl sm:text-3xl md:text-4xl text-white break-words"
|
|
121
181
|
style={{
|
|
122
182
|
textShadow: `
|
|
@@ -157,7 +217,7 @@ export function ScheduleCarousel({
|
|
|
157
217
|
fontSize: "clamp(1.5rem, 6vw, 2.5rem)",
|
|
158
218
|
}}
|
|
159
219
|
>
|
|
160
|
-
|
|
220
|
+
{SCHEDULE_CAROUSEL.UI.NO_CLASSES_TEXT}
|
|
161
221
|
</li>
|
|
162
222
|
)}
|
|
163
223
|
</ul>
|
|
@@ -166,7 +226,7 @@ export function ScheduleCarousel({
|
|
|
166
226
|
})()
|
|
167
227
|
)}
|
|
168
228
|
</div>
|
|
169
|
-
</section>
|
|
229
|
+
</motion.section>
|
|
170
230
|
</div>
|
|
171
231
|
);
|
|
172
232
|
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
// constants.ts
|
|
2
|
+
export const ABOUT_PAGE = {
|
|
3
|
+
UI: {
|
|
4
|
+
MAIN_HEADING: "About Milton Supply",
|
|
5
|
+
SUCCESS_STORY_HEADING: "Lorem Ipsum",
|
|
6
|
+
SUCCESS_STORY_TEXT: `
|
|
7
|
+
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
|
|
8
|
+
`,
|
|
9
|
+
ADMIN_LOGGED_IN_MESSAGE: "You are logged in as an admin",
|
|
10
|
+
MODAL_HEADING: "Edit Bio Section",
|
|
11
|
+
TITLE_LABEL: "Bio Title",
|
|
12
|
+
TITLE_PLACEHOLDER: "Enter the bio title",
|
|
13
|
+
IMAGE_LABEL: "Update Image (optional)",
|
|
14
|
+
SELECTED_IMAGE_TEXT: "Selected: ${formImage.name}",
|
|
15
|
+
DESCRIPTION_LABEL: "Update Description",
|
|
16
|
+
DESCRIPTION_PLACEHOLDER: "Enter the bio description",
|
|
17
|
+
NO_IMAGE_AVAILABLE: "No image available",
|
|
18
|
+
NO_DESCRIPTION_AVAILABLE: "No bio description available",
|
|
19
|
+
},
|
|
20
|
+
BUTTONS: {
|
|
21
|
+
UPDATE_BUTTON: "Update",
|
|
22
|
+
SAVING_BUTTON: "Saving...",
|
|
23
|
+
CANCEL_BUTTON: "Cancel",
|
|
24
|
+
READ_MORE_BUTTON: "Read More",
|
|
25
|
+
READ_LESS_BUTTON: "Read Less",
|
|
26
|
+
},
|
|
27
|
+
ERRORS: {
|
|
28
|
+
FETCH_BIO_FAILED: "Failed to fetch bio data: ${response.status}",
|
|
29
|
+
BIO_NOT_FOUND: "Bio data not found",
|
|
30
|
+
FETCH_BIO_ERROR: "An error occurred while fetching bio data",
|
|
31
|
+
UNAUTHORIZED_UPDATE: "Unauthorized: Only admin can update bio data",
|
|
32
|
+
INVALID_IMAGE_TYPE: "Only JPEG, PNG, or GIF images are allowed",
|
|
33
|
+
NO_AUTH_TOKEN: "No authentication token available",
|
|
34
|
+
UPDATE_BIO_FAILED: "Failed to update bio data: ${response.status}",
|
|
35
|
+
UPDATE_BIO_ERROR: "Failed to update bio data",
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const ABOUT_SECTION = {
|
|
40
|
+
UI: {
|
|
41
|
+
FALLBACK_TITLE: "About Us",
|
|
42
|
+
FALLBACK_DESCRIPTION: "Welcome to Milton Supply Co. Learn more about our story and mission.",
|
|
43
|
+
NO_IMAGE_AVAILABLE: "No image available",
|
|
44
|
+
NO_DESCRIPTION_AVAILABLE: "No description available",
|
|
45
|
+
ADMIN_LOGGED_IN_MESSAGE: "You are logged in as an admin",
|
|
46
|
+
MODAL_HEADING: "Edit About Section",
|
|
47
|
+
TITLE_LABEL: "About Title",
|
|
48
|
+
TITLE_PLACEHOLDER: "Enter the about title",
|
|
49
|
+
IMAGE_LABEL: "Update Image (optional)",
|
|
50
|
+
SELECTED_IMAGE_TEXT: "Selected: ${formImage.name}",
|
|
51
|
+
DESCRIPTION_LABEL: "Update Description",
|
|
52
|
+
DESCRIPTION_PLACEHOLDER: "Enter the about description",
|
|
53
|
+
},
|
|
54
|
+
BUTTONS: {
|
|
55
|
+
UPDATE_BUTTON: "Update",
|
|
56
|
+
SAVING_BUTTON: "Saving...",
|
|
57
|
+
CANCEL_BUTTON: "Cancel",
|
|
58
|
+
READ_MORE_BUTTON: "Read More",
|
|
59
|
+
READ_LESS_BUTTON: "Read Less",
|
|
60
|
+
},
|
|
61
|
+
ERRORS: {
|
|
62
|
+
FETCH_FAILED: "Failed to fetch about data: ${response.status}",
|
|
63
|
+
FETCH_ERROR: "An error occurred while fetching about data",
|
|
64
|
+
UNAUTHORIZED_UPDATE: "Unauthorized: Only admin can update about data",
|
|
65
|
+
INVALID_IMAGE_TYPE: "Only JPEG, PNG, or GIF images are allowed",
|
|
66
|
+
NO_AUTH_TOKEN: "No authentication token available",
|
|
67
|
+
UPDATE_FAILED: "Failed to update about data: ${response.status}",
|
|
68
|
+
UPDATE_ERROR: "Failed to update about data",
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const GALLERY_PAGE = {
|
|
73
|
+
UI: {
|
|
74
|
+
MAIN_HEADING: "Project Gallery",
|
|
75
|
+
LOADING_MESSAGE: "Loading...",
|
|
76
|
+
ADMIN_LOGGED_IN_MESSAGE: "You are logged in as an admin.",
|
|
77
|
+
NO_IMAGES_MESSAGE: "No images available at this time.",
|
|
78
|
+
},
|
|
79
|
+
ERRORS: {
|
|
80
|
+
NO_AUTH_TOKEN: "No authentication token available",
|
|
81
|
+
FETCH_IMAGES_FAILED: "Failed to load images: ${errorText}",
|
|
82
|
+
PAGINATION_WARNING: "Warning: Only the first 100 images are displayed. Contact support to view all images.",
|
|
83
|
+
FETCH_ERROR: "An error occurred while fetching data",
|
|
84
|
+
NO_FILE_SELECTED: "No file selected",
|
|
85
|
+
INVALID_FILE_TYPE: "Only JPEG, PNG, or GIF images are allowed",
|
|
86
|
+
UNAUTHORIZED_UPLOAD: "Unauthorized: Only admins can upload images",
|
|
87
|
+
AUTHENTICATION_ERROR: "Authentication error. Please log in again.",
|
|
88
|
+
UPLOAD_IMAGE_FAILED: "Failed to upload image: ${response.status}",
|
|
89
|
+
UPLOAD_IMAGE_ERROR: "Failed to upload image",
|
|
90
|
+
UNAUTHORIZED_DELETE: "Unauthorized: Only admins can delete images",
|
|
91
|
+
DELETE_IMAGE_FAILED: "Failed to delete image: ${response.status}",
|
|
92
|
+
DELETE_IMAGE_ERROR: "Failed to delete image",
|
|
93
|
+
ADMIN_CHECK_FAILED: "Failed to verify admin status after multiple attempts",
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const GALLERY_COMPLEX = {
|
|
98
|
+
UI: {
|
|
99
|
+
PHOTOS_TAB: "Photos",
|
|
100
|
+
VIDEOS_TAB: "Videos",
|
|
101
|
+
ALL_SUB_TAB: "All",
|
|
102
|
+
CATEGORY_NONE: "None",
|
|
103
|
+
CATEGORY_INDOOR: "Indoor",
|
|
104
|
+
CATEGORY_OUTDOOR: "Outdoor",
|
|
105
|
+
CATEGORY_COMMERCIAL: "Commercial",
|
|
106
|
+
CATEGORY_LANDSCAPE_BOULDERS: "Landscape Boulders",
|
|
107
|
+
CATEGORY_STONE_VENEER: "Stone Veneer",
|
|
108
|
+
CATEGORY_STONE_CUTTING_TREADS: "Stone Cutting Treads",
|
|
109
|
+
CATEGORY_MASONRY_TOOLS: "Masonry Tools",
|
|
110
|
+
CATEGORY_PATIO_STONE: "Patio Stone",
|
|
111
|
+
CATEGORY_PAVERS_SLABS: "Pavers & Slabs",
|
|
112
|
+
CATEGORY_BAGGED_CEMENT: "Bagged Cement Products",
|
|
113
|
+
CATEGORY_SEALERS_ADDITIVES: "Sealers & Additives",
|
|
114
|
+
CATEGORY_LANDSCAPING_ACCESSORIES: "Landscaping Accessories",
|
|
115
|
+
CATEGORY_GRAVEL_SAND: "Gravel & Sand",
|
|
116
|
+
NO_IMAGES_MESSAGE: "No images available for this category.",
|
|
117
|
+
LOADING_MESSAGE: "Loading gallery data...",
|
|
118
|
+
ADMIN_LOGGED_IN_MESSAGE: "You are logged in as an admin",
|
|
119
|
+
DEFAULT_IMAGE_ALT: "Gallery Image",
|
|
120
|
+
UPLOAD_MODAL_HEADING: "Upload New Image",
|
|
121
|
+
EDIT_MODAL_HEADING: "Edit Image",
|
|
122
|
+
DELETE_MODAL_HEADING: "Confirm Delete",
|
|
123
|
+
DELETE_CONFIRMATION_MESSAGE: "Are you sure you want to delete this image? This action cannot be undone.",
|
|
124
|
+
CHOOSE_IMAGE_TEXT: "Choose an image",
|
|
125
|
+
TITLE_PLACEHOLDER: "Enter image title",
|
|
126
|
+
DESCRIPTION_PLACEHOLDER: "Enter image description",
|
|
127
|
+
},
|
|
128
|
+
BUTTONS: {
|
|
129
|
+
UPLOAD_IMAGE_BUTTON: "Upload Image",
|
|
130
|
+
LOAD_MORE_BUTTON: "Load More",
|
|
131
|
+
UPLOAD_BUTTON: "Upload",
|
|
132
|
+
UPLOADING_BUTTON: "Uploading...",
|
|
133
|
+
SAVE_BUTTON: "Save",
|
|
134
|
+
SAVING_BUTTON: "Saving...",
|
|
135
|
+
DELETE_BUTTON: "Delete",
|
|
136
|
+
DELETING_BUTTON: "Deleting...",
|
|
137
|
+
CANCEL_BUTTON: "Cancel",
|
|
138
|
+
},
|
|
139
|
+
ERRORS: {
|
|
140
|
+
UNAUTHORIZED_EDIT: "Unauthorized: Only admins can edit images",
|
|
141
|
+
UNAUTHORIZED_UPLOAD: "Unauthorized: Only admins can upload images",
|
|
142
|
+
UNAUTHORIZED_DELETE: "Unauthorized: Only admins can delete images",
|
|
143
|
+
AUTHENTICATION_ERROR: "Authentication failed. Please log in again.",
|
|
144
|
+
EDIT_FAILED: "Failed to edit image",
|
|
145
|
+
EDIT_FAILED_STATUS: "Failed to edit image: ${response.status}",
|
|
146
|
+
UPLOAD_FAILED: "Failed to upload image",
|
|
147
|
+
DELETE_FAILED: "Failed to delete image",
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export const PRODUCT_DESC = {
|
|
152
|
+
UI: {
|
|
153
|
+
FALLBACK_TITLE: "Product Gallery",
|
|
154
|
+
NO_IMAGES_MESSAGE: "No images available",
|
|
155
|
+
NO_DESCRIPTION_MESSAGE: "No description available.",
|
|
156
|
+
NON_ADMIN_MESSAGE: "You are logged in but do not have admin privileges.",
|
|
157
|
+
DEFAULT_IMAGE_ALT: "Product Image",
|
|
158
|
+
UPLOAD_MODAL_HEADING: "Upload New Product Image",
|
|
159
|
+
EDIT_MODAL_HEADING: "Edit Product Image",
|
|
160
|
+
DELETE_MODAL_HEADING: "Confirm Deletion",
|
|
161
|
+
DELETE_CONFIRMATION_MESSAGE: "Are you sure you want to delete this product image?",
|
|
162
|
+
CHOOSE_IMAGE_LABEL: "Choose Image",
|
|
163
|
+
SELECTED_IMAGE_TEXT: "Selected: ${formImage.name}",
|
|
164
|
+
TITLE_LABEL: "Image Title",
|
|
165
|
+
TITLE_PLACEHOLDER: "Enter image title",
|
|
166
|
+
DESCRIPTION_LABEL: "Image Description",
|
|
167
|
+
DESCRIPTION_PLACEHOLDER: "Enter image description",
|
|
168
|
+
CATEGORY_LABEL: "Category",
|
|
169
|
+
CATEGORY_NONE: "None",
|
|
170
|
+
SUBCATEGORY_LABEL: "Subcategory",
|
|
171
|
+
SUBCATEGORY_PLACEHOLDER: "Enter subcategory (e.g., play-sand)",
|
|
172
|
+
REPLACE_IMAGE_LABEL: "Replace Image (optional)",
|
|
173
|
+
},
|
|
174
|
+
BUTTONS: {
|
|
175
|
+
UPLOAD_IMAGE_BUTTON: "Upload New Product Image",
|
|
176
|
+
UPLOAD_BUTTON: "Upload",
|
|
177
|
+
UPLOADING_BUTTON: "Uploading...",
|
|
178
|
+
SAVE_BUTTON: "Save",
|
|
179
|
+
SAVING_BUTTON: "Saving...",
|
|
180
|
+
DELETE_BUTTON: "Delete",
|
|
181
|
+
DELETING_BUTTON: "Deleting...",
|
|
182
|
+
CANCEL_BUTTON: "Cancel",
|
|
183
|
+
},
|
|
184
|
+
ERRORS: {
|
|
185
|
+
NO_AUTH_TOKEN: "Unauthorized: No token provided",
|
|
186
|
+
AUTHENTICATION_ERROR: "Unauthorized: Session expired. Please log in again.",
|
|
187
|
+
UNAUTHORIZED_EDIT: "Unauthorized: Only admins can edit images",
|
|
188
|
+
UNAUTHORIZED_DELETE: "Unauthorized: Only admins can delete images",
|
|
189
|
+
EDIT_FAILED: "Failed to update image",
|
|
190
|
+
EDIT_FAILED_STATUS: "Failed to update image (Status: ${response.status})",
|
|
191
|
+
UPLOAD_FAILED: "Failed to upload image",
|
|
192
|
+
SUBCATEGORY_EMPTY: "Subcategory cannot be empty",
|
|
193
|
+
SUBCATEGORY_TOO_LONG: "Subcategory name is too long (max 50 characters)",
|
|
194
|
+
SUBCATEGORY_INVALID: "Subcategory can only contain letters, numbers, spaces, or hyphens",
|
|
195
|
+
ADMIN_CHECK_FAILED: "Failed to verify admin status after multiple attempts",
|
|
196
|
+
},
|
|
197
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// src/components/addOns/functional/carousels/constants.ts/scheduleCarousel.ts
|
|
2
|
+
export const SCHEDULE_CAROUSEL = {
|
|
3
|
+
UI: {
|
|
4
|
+
NO_CLASSES_TEXT: "No classes scheduled for this day",
|
|
5
|
+
CAROUSEL_TITLE: "Weekly Schedule",
|
|
6
|
+
BACKGROUND_IMAGES: [
|
|
7
|
+
"/images/test.png",
|
|
8
|
+
"/images/test.png",
|
|
9
|
+
"/images/test.png",
|
|
10
|
+
"/images/test.png",
|
|
11
|
+
"/images/test.png",
|
|
12
|
+
"/images/test.png",
|
|
13
|
+
"/images/test.png",
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
ERRORS: {
|
|
17
|
+
FETCH_SCHEDULE_FAILED: "Failed to fetch schedule data",
|
|
18
|
+
FETCH_ERROR: "An error occurred while fetching the schedule",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -5,7 +5,7 @@ import { Card } from "@/components/other/card";
|
|
|
5
5
|
import Spinner from "@/components/addOns/non-functional/spinner";
|
|
6
6
|
import { motion } from "framer-motion";
|
|
7
7
|
import { useAuth as useClerkAuth, useSession } from "@clerk/nextjs";
|
|
8
|
-
import { useStrapiAuth } from "@/lib/auth-context";
|
|
8
|
+
import { useStrapiAuth } from "@/lib/auth/auth-context";
|
|
9
9
|
import { Bar } from "react-chartjs-2";
|
|
10
10
|
import {
|
|
11
11
|
Chart as ChartJS,
|