@devvistatech/devvista-kit 0.0.10 → 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/CHANGELOG.md +12 -12
- package/LICENSE +6 -6
- package/README.md +55 -15
- package/app/ClientLayout.tsx +66 -0
- package/app/about/page.tsx +61 -298
- package/app/adRequest/page.tsx +625 -549
- package/app/admin-profile/page.tsx +123 -0
- package/app/analytics/page.tsx +382 -346
- package/app/api/about/route.ts +290 -306
- package/app/api/adRequest/route.ts +547 -567
- package/app/api/analytics/[reportType]/route.ts +274 -337
- package/app/api/bio/route.ts +297 -313
- package/app/api/blog/route.ts +288 -306
- package/app/api/chat/route.ts +14 -14
- package/app/api/contact/route.ts +409 -409
- package/app/api/contacts/route.ts +179 -224
- package/app/api/files/route.ts +415 -429
- package/app/api/gallery-data/route.ts +727 -735
- package/app/api/schedule/route.ts +439 -455
- package/app/api/signup/route.ts +129 -0
- package/app/api/sync-user/route.ts +306 -132
- package/app/api/trial-request/route.ts +297 -297
- package/app/api/verify-admin/route.ts +46 -0
- package/app/blog/[id]/page.tsx +307 -288
- package/app/blog/page.tsx +249 -216
- package/app/contact/page.tsx +284 -284
- package/app/faq/page.tsx +191 -191
- package/app/favicon.ico +0 -0
- package/app/gallery/page.tsx +336 -315
- package/app/globals.css +58 -58
- package/app/layout.tsx +59 -110
- package/app/not-found.tsx +20 -20
- package/app/page.tsx +47 -338
- 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 +698 -660
- package/bin/init.js +207 -219
- package/components/addOns/functional/CalendlyWidget.tsx +107 -107
- package/components/addOns/functional/ClassList.tsx +149 -145
- package/components/addOns/functional/ClassPopup.tsx +398 -398
- package/components/addOns/functional/ContactForm.tsx +284 -284
- package/components/addOns/functional/NewUserAnalytics.tsx +100 -100
- package/components/addOns/functional/ProductList.tsx +1027 -0
- package/components/addOns/functional/aboutSections/AboutSection.tsx +581 -544
- package/components/addOns/functional/aboutSections/constants/aboutSection.ts +70 -65
- 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 +184 -184
- package/components/addOns/functional/blogSections/BlogFormPopUp.tsx +555 -554
- package/components/addOns/functional/blogSections/BlogList.tsx +148 -148
- package/components/addOns/functional/blogSections/BlogSidebar.tsx +58 -58
- package/components/addOns/functional/blogSections/constants/blogDashboard.ts +28 -28
- package/components/addOns/functional/blogSections/constants/blogFormPopUp.ts +97 -97
- package/components/addOns/functional/blogSections/constants/blogList.ts +22 -22
- package/components/addOns/functional/blogSections/constants/blogSidebar.ts +15 -15
- package/components/addOns/functional/{ImageDescCarousel.tsx → carousels/ImageDescCarousel.tsx} +839 -730
- package/components/addOns/functional/carousels/ProductDescCarousel.tsx +1129 -0
- package/components/addOns/functional/{ScheduleCarousel.tsx → carousels/ScheduleCarousel.tsx} +231 -171
- 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 +366 -366
- package/components/addOns/functional/contactsDashboard/constants/contactsDashboard.ts +70 -70
- 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 +1037 -836
- package/components/addOns/functional/galleries/GallerySimple.tsx +537 -509
- package/components/addOns/functional/galleries/ThreeSetGallery.tsx +260 -0
- package/components/addOns/functional/galleries/constants/galleryComplex.ts +106 -106
- package/components/addOns/functional/galleries/constants/gallerySimple.ts +76 -76
- package/components/addOns/functional/schedules/ScheduleGridOne.tsx +276 -262
- package/components/addOns/functional/schedules/ScheduleGridTwo.tsx +299 -294
- package/components/addOns/functional/schedules/ScheduleGridTwoBasic.tsx +293 -288
- package/components/addOns/functional/schedules/SchedulerForm.tsx +428 -428
- package/components/addOns/functional/schedules/constants/ScheduleGridTwo.ts +40 -40
- package/components/addOns/functional/schedules/constants/ScheduleGridTwoBasic.ts +40 -40
- package/components/addOns/functional/schedules/constants/SchedulerForm.ts +65 -65
- package/components/addOns/functional/schedules/constants/scheduleGridOne.ts +54 -54
- package/components/addOns/non-functional/AnnouncementBanner.tsx +46 -46
- package/components/addOns/non-functional/IconBubble.tsx +49 -49
- package/components/addOns/non-functional/SampleCarousel.tsx +204 -204
- package/components/addOns/non-functional/Testimonials.tsx +334 -334
- package/components/addOns/non-functional/ThreeSetGallery.tsx +63 -63
- package/components/addOns/non-functional/aboutSections/AboutSection.tsx +62 -62
- package/components/addOns/non-functional/aboutSections/constants/aboutSection.ts +24 -24
- 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} +144 -142
- 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 +117 -117
- package/components/addOns/non-functional/imageCarousels/ProgramCarousel.tsx +232 -232
- package/components/addOns/non-functional/imageCarousels/constants/programCarousel.ts +39 -39
- package/components/addOns/non-functional/imageCarousels/constants/programSlider.ts +36 -36
- package/components/addOns/non-functional/spinner.tsx +21 -21
- package/components/footers/footer.tsx +416 -453
- package/components/navBars/navbar.tsx +310 -310
- package/components/other/accordion.tsx +58 -58
- package/components/other/admin-menu.tsx +68 -68
- package/components/other/alert-dialog.tsx +141 -141
- package/components/other/alert.tsx +59 -59
- package/components/other/aspect-ratio.tsx +7 -7
- package/components/other/avatar.tsx +50 -50
- package/components/other/badge.tsx +36 -36
- package/components/other/breadcrumb.tsx +115 -115
- package/components/other/button.tsx +738 -738
- package/components/other/calendar.tsx +66 -66
- package/components/other/card.tsx +86 -86
- package/components/other/carousel.tsx +274 -274
- package/components/other/chart.tsx +363 -363
- package/components/other/checkbox.tsx +30 -30
- package/components/other/collapsible.tsx +11 -11
- package/components/other/command.tsx +155 -155
- package/components/other/context-menu.tsx +200 -200
- package/components/other/dialog.tsx +122 -122
- package/components/other/drawer.tsx +118 -118
- package/components/other/dropdown-menu.tsx +200 -200
- package/components/other/form.tsx +179 -179
- package/components/other/hover-card.tsx +29 -29
- package/components/other/input-otp.tsx +71 -71
- package/components/other/input.tsx +25 -25
- package/components/other/label.tsx +26 -26
- package/components/other/menubar.tsx +236 -236
- package/components/other/mobile-icon.tsx +21 -21
- package/components/other/navigation-menu.tsx +128 -128
- package/components/other/pagination.tsx +117 -117
- package/components/other/popover.tsx +31 -31
- package/components/other/progress.tsx +28 -28
- package/components/other/radio-group.tsx +44 -44
- package/components/other/resizable.tsx +45 -45
- package/components/other/scroll-area.tsx +48 -48
- package/components/other/select.tsx +160 -160
- package/components/other/separator.tsx +31 -31
- package/components/other/sheet.tsx +140 -140
- package/components/other/skeleton.tsx +15 -15
- package/components/other/slider.tsx +28 -28
- package/components/other/social-icons.tsx +39 -39
- package/components/other/sonner.tsx +31 -31
- package/components/other/switch.tsx +29 -29
- package/components/other/table.tsx +117 -117
- package/components/other/tabs.tsx +55 -55
- package/components/other/textarea.tsx +24 -24
- package/components/other/toast.tsx +122 -122
- package/components/other/toaster.tsx +35 -35
- package/components/other/toggle-group.tsx +61 -61
- package/components/other/toggle.tsx +45 -45
- package/components/other/tooltip.tsx +30 -30
- package/components/theme-provider.tsx +8 -8
- package/hooks/use-toast.ts +188 -188
- package/lib/auth/auth-context.tsx +225 -0
- package/lib/auth/auth-utils.tsx +30 -0
- package/lib/constants/about.ts +34 -34
- package/lib/constants/adRequest.ts +256 -113
- package/lib/constants/admin-profile.ts +12 -0
- package/lib/constants/contact.ts +40 -40
- package/lib/constants/faq.ts +34 -34
- package/lib/constants/gallery.ts +42 -42
- package/lib/constants/page.ts +69 -69
- package/lib/constants/schedule.ts +71 -71
- package/lib/google/google-analytics-tracking.tsx +44 -0
- package/lib/{google-analytics.tsx → google/google-analytics.tsx} +97 -97
- package/lib/types.ts +235 -0
- package/lib/utils/compressImage.tsx +32 -0
- package/middleware.ts +46 -42
- package/netlify.toml +5 -5
- package/next.config.js +10 -10
- package/package.json +117 -116
- package/public/images/test.png +0 -0
- package/tailwind.config.ts +89 -89
- package/tsconfig.json +23 -23
- 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/dist/.next/types/app/api/about/route.js +0 -52
- package/dist/.next/types/app/api/blog/route.js +0 -52
- package/dist/.next/types/app/api/files/route.js +0 -52
- package/dist/.next/types/app/api/schedule/route.js +0 -52
- package/dist/.next/types/app/api/sync-user/route.js +0 -52
- package/dist/.next/types/app/layout.js +0 -22
- package/dist/.next/types/app/page.js +0 -22
- package/dist/app/about/page.jsx +0 -258
- package/dist/app/adRequest/page.jsx +0 -531
- package/dist/app/analytics/page.jsx +0 -298
- package/dist/app/api/about/route.js +0 -285
- package/dist/app/api/adRequest/route.js +0 -440
- package/dist/app/api/analytics/[reportType]/route.js +0 -357
- package/dist/app/api/bio/route.js +0 -293
- package/dist/app/api/blog/route.js +0 -366
- package/dist/app/api/chat/route.js +0 -58
- package/dist/app/api/contact/route.js +0 -163
- package/dist/app/api/contacts/route.js +0 -234
- package/dist/app/api/files/route.js +0 -444
- package/dist/app/api/gallery-data/route.js +0 -719
- package/dist/app/api/schedule/route.js +0 -461
- package/dist/app/api/sync-user/route.js +0 -186
- package/dist/app/api/trial-request/route.js +0 -165
- package/dist/app/blog/[id]/page.jsx +0 -312
- package/dist/app/blog/page.jsx +0 -210
- package/dist/app/constants/about.js +0 -32
- package/dist/app/constants/adRequest.js +0 -113
- package/dist/app/constants/contact.js +0 -40
- package/dist/app/constants/faq.js +0 -36
- package/dist/app/constants/gallery.js +0 -42
- package/dist/app/constants/page.js +0 -69
- package/dist/app/constants/schedule.js +0 -71
- package/dist/app/contact/page.jsx +0 -119
- package/dist/app/faq/page.jsx +0 -97
- package/dist/app/gallery/page.jsx +0 -281
- package/dist/app/layout.jsx +0 -45
- package/dist/app/not-found.jsx +0 -14
- package/dist/app/page.jsx +0 -324
- package/dist/app/schedule/page.jsx +0 -500
- package/dist/components/addOns/functional/BioEditor.jsx +0 -187
- package/dist/components/addOns/functional/CalendlyWidget.jsx +0 -61
- package/dist/components/addOns/functional/ClassList.jsx +0 -158
- package/dist/components/addOns/functional/ClassPopup.jsx +0 -300
- package/dist/components/addOns/functional/ContactForm.jsx +0 -219
- package/dist/components/addOns/functional/FileUploader.jsx +0 -222
- package/dist/components/addOns/functional/ImageDescCarousel.jsx +0 -491
- package/dist/components/addOns/functional/NewUserAnalytics.jsx +0 -71
- package/dist/components/addOns/functional/ScheduleCarousel.jsx +0 -68
- package/dist/components/addOns/functional/aboutSections/AboutSection.jsx +0 -372
- package/dist/components/addOns/functional/aboutSections/constants/aboutSection.js +0 -65
- package/dist/components/addOns/functional/blogSections/BlogDashboard.jsx +0 -111
- package/dist/components/addOns/functional/blogSections/BlogFormPopUp.jsx +0 -465
- package/dist/components/addOns/functional/blogSections/BlogList.jsx +0 -170
- package/dist/components/addOns/functional/blogSections/BlogSidebar.jsx +0 -35
- package/dist/components/addOns/functional/blogSections/constants/blogDashboard.js +0 -28
- package/dist/components/addOns/functional/blogSections/constants/blogFormPopUp.js +0 -97
- package/dist/components/addOns/functional/blogSections/constants/blogList.js +0 -22
- package/dist/components/addOns/functional/blogSections/constants/blogSidebar.js +0 -15
- package/dist/components/addOns/functional/contactsDashboard/ContactsDashboard.jsx +0 -355
- package/dist/components/addOns/functional/contactsDashboard/constants/contactsDashboard.js +0 -70
- package/dist/components/addOns/functional/galleries/GalleryComplex.jsx +0 -605
- package/dist/components/addOns/functional/galleries/GallerySimple.jsx +0 -363
- package/dist/components/addOns/functional/galleries/constants/galleryComplex.js +0 -106
- package/dist/components/addOns/functional/galleries/constants/gallerySimple.js +0 -76
- package/dist/components/addOns/functional/schedules/ScheduleGridOne.jsx +0 -167
- package/dist/components/addOns/functional/schedules/ScheduleGridTwo.jsx +0 -100
- package/dist/components/addOns/functional/schedules/ScheduleGridTwoBasic.jsx +0 -97
- package/dist/components/addOns/functional/schedules/SchedulerForm.jsx +0 -188
- package/dist/components/addOns/functional/schedules/constants/ScheduleGridTwo.js +0 -40
- package/dist/components/addOns/functional/schedules/constants/ScheduleGridTwoBasic.js +0 -40
- package/dist/components/addOns/functional/schedules/constants/SchedulerForm.js +0 -65
- package/dist/components/addOns/functional/schedules/constants/scheduleGridOne.js +0 -54
- package/dist/components/addOns/non-functional/AnnouncementBanner.jsx +0 -24
- package/dist/components/addOns/non-functional/FeaturesSection.jsx +0 -38
- package/dist/components/addOns/non-functional/HeroSection.jsx +0 -71
- package/dist/components/addOns/non-functional/Heros/HeroSection.jsx +0 -71
- package/dist/components/addOns/non-functional/IconBubble.jsx +0 -36
- package/dist/components/addOns/non-functional/SampleCarousel.jsx +0 -114
- package/dist/components/addOns/non-functional/Testimonials.jsx +0 -177
- package/dist/components/addOns/non-functional/ThreeSetGallery.jsx +0 -40
- package/dist/components/addOns/non-functional/aboutSections/AboutSection.jsx +0 -35
- package/dist/components/addOns/non-functional/aboutSections/constants/aboutSection.js +0 -24
- package/dist/components/addOns/non-functional/imageCarousels/ProductSlider.jsx +0 -80
- package/dist/components/addOns/non-functional/imageCarousels/ProgramCarousel.jsx +0 -155
- package/dist/components/addOns/non-functional/imageCarousels/constants/programCarousel.js +0 -39
- package/dist/components/addOns/non-functional/imageCarousels/constants/programSlider.js +0 -36
- package/dist/components/addOns/non-functional/spinner.jsx +0 -13
- package/dist/components/footers/footer.jsx +0 -217
- package/dist/components/navBars/navbar.jsx +0 -159
- package/dist/components/other/accordion.jsx +0 -40
- package/dist/components/other/admin-menu.jsx +0 -34
- package/dist/components/other/alert-dialog.jsx +0 -64
- package/dist/components/other/alert.jsx +0 -41
- package/dist/components/other/aspect-ratio.jsx +0 -4
- package/dist/components/other/avatar.jsx +0 -31
- package/dist/components/other/badge.jsx +0 -32
- package/dist/components/other/breadcrumb.jsx +0 -57
- package/dist/components/other/button.jsx +0 -322
- package/dist/components/other/calendar.jsx +0 -43
- package/dist/components/other/card.jsx +0 -44
- package/dist/components/other/carousel.jsx +0 -140
- package/dist/components/other/chart.jsx +0 -182
- package/dist/components/other/checkbox.jsx +0 -26
- package/dist/components/other/collapsible.jsx +0 -6
- package/dist/components/other/command.jsx +0 -68
- package/dist/components/other/context-menu.jsx +0 -88
- package/dist/components/other/dialog.jsx +0 -60
- package/dist/components/other/drawer.jsx +0 -60
- package/dist/components/other/dropdown-menu.jsx +0 -90
- package/dist/components/other/form.jsx +0 -89
- package/dist/components/other/hover-card.jsx +0 -23
- package/dist/components/other/input-otp.jsx +0 -46
- package/dist/components/other/input.jsx +0 -19
- package/dist/components/other/label.jsx +0 -23
- package/dist/components/other/login-popup.jsx +0 -1
- package/dist/components/other/menubar.jsx +0 -96
- package/dist/components/other/mobile-icon.jsx +0 -11
- package/dist/components/other/navigation-menu.jsx +0 -62
- package/dist/components/other/pagination.jsx +0 -63
- package/dist/components/other/popover.jsx +0 -25
- package/dist/components/other/progress.jsx +0 -23
- package/dist/components/other/radio-group.jsx +0 -31
- package/dist/components/other/resizable.jsx +0 -29
- package/dist/components/other/scroll-area.jsx +0 -36
- package/dist/components/other/select.jsx +0 -83
- package/dist/components/other/separator.jsx +0 -21
- package/dist/components/other/sheet.jsx +0 -74
- package/dist/components/other/signup-popup.jsx +0 -1
- package/dist/components/other/skeleton.jsx +0 -17
- package/dist/components/other/slider.jsx +0 -26
- package/dist/components/other/social-icons.jsx +0 -15
- package/dist/components/other/sonner.jsx +0 -27
- package/dist/components/other/switch.jsx +0 -23
- package/dist/components/other/table.jsx +0 -56
- package/dist/components/other/tabs.jsx +0 -32
- package/dist/components/other/textarea.jsx +0 -19
- package/dist/components/other/toast.jsx +0 -58
- package/dist/components/other/toaster.jsx +0 -31
- package/dist/components/other/toggle-group.jsx +0 -41
- package/dist/components/other/toggle.jsx +0 -39
- package/dist/components/other/tooltip.jsx +0 -24
- package/dist/components/theme-provider.jsx +0 -18
- package/dist/components/types.js +0 -1
- package/dist/hooks/use-toast.js +0 -135
- package/dist/lib/auth-context.jsx +0 -144
- package/dist/lib/constants/about.js +0 -32
- package/dist/lib/constants/adRequest.js +0 -113
- package/dist/lib/constants/contact.js +0 -40
- package/dist/lib/constants/faq.js +0 -36
- package/dist/lib/constants/gallery.js +0 -42
- package/dist/lib/constants/page.js +0 -69
- package/dist/lib/constants/schedule.js +0 -71
- package/dist/lib/google-analytics.jsx +0 -148
- package/dist/lib/utils.js +0 -9
- package/dist/lib/verify-user.js +0 -142
- package/dist/middleware.js +0 -37
- package/dist/tailwind.config.js +0 -86
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/lib/auth-context.tsx +0 -131
- package/lib/verify-user.ts +0 -118
|
@@ -1,363 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
import { useState, useRef, useEffect } from "react";
|
|
39
|
-
import { Card } from "@/components/other/card";
|
|
40
|
-
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/other/tabs";
|
|
41
|
-
import { motion, useScroll, useTransform } from "framer-motion";
|
|
42
|
-
import Image from "next/image";
|
|
43
|
-
import { ActionButton, TrashIconButton, CloseButton, SubmitButton, CancelButton, DeleteButton } from "@/components/other/button";
|
|
44
|
-
import { Upload, X } from "lucide-react";
|
|
45
|
-
import { useUser } from "@clerk/nextjs";
|
|
46
|
-
import { useStrapiAuth } from "@/lib/auth-context";
|
|
47
|
-
import { GALLERY_SIMPLE } from "./constants/gallerySimple";
|
|
48
|
-
export function GallerySection(_a) {
|
|
49
|
-
var _this = this;
|
|
50
|
-
var user = _a.user, authLoading = _a.authLoading, uploadedImages = _a.uploadedImages, setUploadedImages = _a.setUploadedImages, error = _a.error, setError = _a.setError, isLoading = _a.isLoading, setIsLoading = _a.setIsLoading, setUser = _a.setUser, handleImageUpload = _a.handleImageUpload, handleDeleteImage = _a.handleDeleteImage;
|
|
51
|
-
var isSignedIn = useUser().isSignedIn;
|
|
52
|
-
var checkSession = useStrapiAuth().checkSession;
|
|
53
|
-
var isAdmin = isSignedIn && !!(user === null || user === void 0 ? void 0 : user.businessAdminId);
|
|
54
|
-
var _b = useState("photos"), activeTab = _b[0], setActiveTab = _b[1];
|
|
55
|
-
var _c = useState(null), selectedImage = _c[0], setSelectedImage = _c[1];
|
|
56
|
-
var _d = useState(false), isMobile = _d[0], setIsMobile = _d[1];
|
|
57
|
-
var _e = useState(12), visiblePhotos = _e[0], setVisiblePhotos = _e[1];
|
|
58
|
-
var _f = useState(false), isConfirmDeleteOpen = _f[0], setIsConfirmDeleteOpen = _f[1];
|
|
59
|
-
var _g = useState(false), isUploadModalOpen = _g[0], setIsUploadModalOpen = _g[1];
|
|
60
|
-
var _h = useState(null), documentIdToDelete = _h[0], setDocumentIdToDelete = _h[1];
|
|
61
|
-
var _j = useState(null), selectedFile = _j[0], setSelectedFile = _j[1];
|
|
62
|
-
var fileInputRef = useRef(null);
|
|
63
|
-
var containerRef = useRef(null);
|
|
64
|
-
var scrollYProgress = useScroll({
|
|
65
|
-
target: containerRef,
|
|
66
|
-
offset: ["start end", "end start"],
|
|
67
|
-
}).scrollYProgress;
|
|
68
|
-
var parallaxY = useTransform(scrollYProgress, [0, 1], [0, -50]);
|
|
69
|
-
useEffect(function () {
|
|
70
|
-
var handleLogin = function () { return checkSession(); };
|
|
71
|
-
var handleLogout = function () { return checkSession(); };
|
|
72
|
-
window.addEventListener("user-login", handleLogin);
|
|
73
|
-
window.addEventListener("user-logout", handleLogout);
|
|
74
|
-
return function () {
|
|
75
|
-
window.removeEventListener("user-login", handleLogin);
|
|
76
|
-
window.removeEventListener("user-logout", handleLogout);
|
|
77
|
-
};
|
|
78
|
-
}, [checkSession]);
|
|
79
|
-
useEffect(function () {
|
|
80
|
-
var checkMobile = function () { return setIsMobile(window.innerWidth < 768); };
|
|
81
|
-
checkMobile();
|
|
82
|
-
window.addEventListener("resize", checkMobile);
|
|
83
|
-
return function () { return window.removeEventListener("resize", checkMobile); };
|
|
84
|
-
}, []);
|
|
85
|
-
useEffect(function () {
|
|
86
|
-
if (selectedImage || isConfirmDeleteOpen || isUploadModalOpen) {
|
|
87
|
-
document.body.classList.add("overflow-hidden");
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
document.body.classList.remove("overflow-hidden");
|
|
91
|
-
}
|
|
92
|
-
return function () {
|
|
93
|
-
document.body.classList.remove("overflow-hidden");
|
|
94
|
-
};
|
|
95
|
-
}, [selectedImage, isConfirmDeleteOpen, isUploadModalOpen]);
|
|
96
|
-
useEffect(function () {
|
|
97
|
-
var event = new CustomEvent("modalStateChange", {
|
|
98
|
-
detail: { isOpen: !!selectedImage || isConfirmDeleteOpen || isUploadModalOpen },
|
|
99
|
-
});
|
|
100
|
-
window.dispatchEvent(event);
|
|
101
|
-
}, [selectedImage, isConfirmDeleteOpen, isUploadModalOpen]);
|
|
102
|
-
useEffect(function () {
|
|
103
|
-
var handleEsc = function (e) {
|
|
104
|
-
if (e.key === "Escape") {
|
|
105
|
-
if (isConfirmDeleteOpen) {
|
|
106
|
-
handleCancelDelete();
|
|
107
|
-
}
|
|
108
|
-
else if (selectedImage) {
|
|
109
|
-
handleCloseModal();
|
|
110
|
-
}
|
|
111
|
-
else if (isUploadModalOpen) {
|
|
112
|
-
handleCloseUploadModal();
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
window.addEventListener("keydown", handleEsc);
|
|
117
|
-
return function () { return window.removeEventListener("keydown", handleEsc); };
|
|
118
|
-
}, [isConfirmDeleteOpen, selectedImage, isUploadModalOpen]);
|
|
119
|
-
var openConfirmDelete = function (documentId) {
|
|
120
|
-
if (!isAdmin) {
|
|
121
|
-
setError(GALLERY_SIMPLE.ERRORS.UNAUTHORIZED_DELETE);
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
setDocumentIdToDelete(documentId);
|
|
125
|
-
setIsConfirmDeleteOpen(true);
|
|
126
|
-
};
|
|
127
|
-
var handleConfirmDelete = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
128
|
-
return __generator(this, function (_a) {
|
|
129
|
-
switch (_a.label) {
|
|
130
|
-
case 0:
|
|
131
|
-
if (!isAdmin) {
|
|
132
|
-
setError(GALLERY_SIMPLE.ERRORS.UNAUTHORIZED_DELETE);
|
|
133
|
-
setIsConfirmDeleteOpen(false);
|
|
134
|
-
return [2 /*return*/];
|
|
135
|
-
}
|
|
136
|
-
if (!(documentIdToDelete !== null)) return [3 /*break*/, 4];
|
|
137
|
-
setIsLoading(true);
|
|
138
|
-
_a.label = 1;
|
|
139
|
-
case 1:
|
|
140
|
-
_a.trys.push([1, , 3, 4]);
|
|
141
|
-
return [4 /*yield*/, handleDeleteImage(documentIdToDelete)];
|
|
142
|
-
case 2:
|
|
143
|
-
_a.sent();
|
|
144
|
-
return [3 /*break*/, 4];
|
|
145
|
-
case 3:
|
|
146
|
-
setIsLoading(false);
|
|
147
|
-
setIsConfirmDeleteOpen(false);
|
|
148
|
-
setDocumentIdToDelete(null);
|
|
149
|
-
return [7 /*endfinally*/];
|
|
150
|
-
case 4: return [2 /*return*/];
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}); };
|
|
154
|
-
var handleCancelDelete = function () {
|
|
155
|
-
setIsConfirmDeleteOpen(false);
|
|
156
|
-
setDocumentIdToDelete(null);
|
|
157
|
-
};
|
|
158
|
-
var handleImageClick = function (image) {
|
|
159
|
-
setSelectedImage({ url: image.url });
|
|
160
|
-
};
|
|
161
|
-
var handleCloseModal = function () {
|
|
162
|
-
setSelectedImage(null);
|
|
163
|
-
};
|
|
164
|
-
var handleCloseUploadModal = function () {
|
|
165
|
-
setIsUploadModalOpen(false);
|
|
166
|
-
setSelectedFile(null);
|
|
167
|
-
if (fileInputRef.current) {
|
|
168
|
-
fileInputRef.current.value = "";
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
var handleUploadSubmit = function (e) { return __awaiter(_this, void 0, void 0, function () {
|
|
172
|
-
var err_1;
|
|
173
|
-
return __generator(this, function (_a) {
|
|
174
|
-
switch (_a.label) {
|
|
175
|
-
case 0:
|
|
176
|
-
e.preventDefault();
|
|
177
|
-
if (!isAdmin) {
|
|
178
|
-
console.error("GallerySimple: Unauthorized upload attempt", {
|
|
179
|
-
isSignedIn: isSignedIn,
|
|
180
|
-
businessAdminId: user === null || user === void 0 ? void 0 : user.businessAdminId,
|
|
181
|
-
});
|
|
182
|
-
setError(GALLERY_SIMPLE.ERRORS.UNAUTHORIZED_UPLOAD);
|
|
183
|
-
return [2 /*return*/];
|
|
184
|
-
}
|
|
185
|
-
if (!selectedFile || selectedFile.size === 0) {
|
|
186
|
-
setError(GALLERY_SIMPLE.ERRORS.INVALID_FILE);
|
|
187
|
-
return [2 /*return*/];
|
|
188
|
-
}
|
|
189
|
-
setIsLoading(true);
|
|
190
|
-
_a.label = 1;
|
|
191
|
-
case 1:
|
|
192
|
-
_a.trys.push([1, 3, 4, 5]);
|
|
193
|
-
return [4 /*yield*/, handleImageUpload(e, selectedFile, "", "", "none")];
|
|
194
|
-
case 2:
|
|
195
|
-
_a.sent();
|
|
196
|
-
return [3 /*break*/, 5];
|
|
197
|
-
case 3:
|
|
198
|
-
err_1 = _a.sent();
|
|
199
|
-
console.error("GallerySimple: Upload Error", err_1);
|
|
200
|
-
setError(err_1 instanceof Error ? err_1.message : GALLERY_SIMPLE.ERRORS.UPLOAD_FAILED);
|
|
201
|
-
return [3 /*break*/, 5];
|
|
202
|
-
case 4:
|
|
203
|
-
setIsLoading(false);
|
|
204
|
-
setIsUploadModalOpen(false);
|
|
205
|
-
setSelectedFile(null);
|
|
206
|
-
if (fileInputRef.current) {
|
|
207
|
-
fileInputRef.current.value = "";
|
|
208
|
-
}
|
|
209
|
-
return [7 /*endfinally*/];
|
|
210
|
-
case 5: return [2 /*return*/];
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
}); };
|
|
214
|
-
var loadMore = function () {
|
|
215
|
-
setVisiblePhotos(function (prev) { return prev + 12; });
|
|
216
|
-
};
|
|
217
|
-
var sectionVariants = {
|
|
218
|
-
hidden: { opacity: 0 },
|
|
219
|
-
visible: {
|
|
220
|
-
opacity: 1,
|
|
221
|
-
transition: { duration: 0.8, ease: [0.16, 1, 0.3, 1], staggerChildren: 0.1 },
|
|
222
|
-
},
|
|
223
|
-
};
|
|
224
|
-
var cardVariants = {
|
|
225
|
-
hidden: { opacity: 0, y: 30 },
|
|
226
|
-
visible: {
|
|
227
|
-
opacity: 1,
|
|
228
|
-
y: 0,
|
|
229
|
-
transition: { duration: 0.5 },
|
|
230
|
-
},
|
|
231
|
-
};
|
|
232
|
-
var modalVariants = {
|
|
233
|
-
hidden: { opacity: 0, y: "100vh" },
|
|
234
|
-
visible: { opacity: 1, y: 0, transition: { duration: 0.5, ease: [0.16, 1, 0.3, 1] } },
|
|
235
|
-
exit: { opacity: 0, y: "100vh", transition: { duration: 0.3, ease: "easeIn" } },
|
|
236
|
-
};
|
|
237
|
-
return (<div className="w-full font-inter">
|
|
238
|
-
<motion.div variants={sectionVariants} initial="hidden" whileInView="visible" viewport={{ once: true }} className="p-4 sm:p-8 lg:p-12" ref={containerRef}>
|
|
239
|
-
<Tabs defaultValue="photos" className="w-full" onValueChange={function (value) { return setActiveTab(value); }}>
|
|
240
|
-
<TabsList className="grid w-full md:w-3/4 mx-auto grid-cols-2 mb-12 bg-white/10 backdrop-blur-lg border-2 border-transparent shadow-xl rounded-3xl p-4 h-24 supports-[not(backdrop-filter:blur(10px))]:bg-white/20">
|
|
241
|
-
<TabsTrigger value="photos" className="rounded-2xl text-xl sm:text-2xl font-bold text-gray-700 data-[state=active]:text-white data-[state=active]:bg-blue-600 h-full flex items-center justify-center transition-all duration-300">
|
|
242
|
-
{GALLERY_SIMPLE.UI.PHOTOS_TAB}
|
|
243
|
-
</TabsTrigger>
|
|
244
|
-
<TabsTrigger value="videos" className="rounded-2xl text-xl sm:text-2xl font-bold text-gray-700 data-[state=active]:text-white data-[state=active]:bg-blue-600 h-full flex items-center justify-center transition-all duration-300">
|
|
245
|
-
{GALLERY_SIMPLE.UI.VIDEOS_TAB}
|
|
246
|
-
</TabsTrigger>
|
|
247
|
-
</TabsList>
|
|
248
|
-
|
|
249
|
-
<TabsContent value="photos">
|
|
250
|
-
<div className="space-y-6">
|
|
251
|
-
{error && (<p className="text-red-400 text-base sm:text-lg md:text-xl text-center">{error}</p>)}
|
|
252
|
-
{isAdmin && (<div className="flex justify-center pb-12">
|
|
253
|
-
<ActionButton onClick={function () { return setIsUploadModalOpen(true); }} className="flex items-center gap-2" disabled={isLoading}>
|
|
254
|
-
<Upload className="h-4 w-4 sm:h-5 sm:w-5"/>
|
|
255
|
-
{GALLERY_SIMPLE.BUTTONS.UPLOAD_IMAGE_BUTTON}
|
|
256
|
-
</ActionButton>
|
|
257
|
-
</div>)}
|
|
258
|
-
{uploadedImages.length > 0 ? (<>
|
|
259
|
-
<motion.div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-2 sm:gap-8" style={{ y: isMobile ? 0 : parallaxY }}>
|
|
260
|
-
{uploadedImages.slice(0, visiblePhotos).map(function (image, index) { return (<motion.div key={image.documentId} variants={cardVariants} initial="hidden" whileInView="visible" viewport={{ once: true, amount: 0.2 }} onClick={function () { return handleImageClick(image); }} className="cursor-pointer will-change-transform will-change-opacity">
|
|
261
|
-
<Card className="overflow-hidden bg-white/10 backdrop-blur-lg border-2 border-transparent shadow-xl rounded-3xl p-2 sm:p-4 supports-[not(backdrop-filter:blur(10px))]:bg-white/20">
|
|
262
|
-
<div className="relative w-full aspect-[3/2]">
|
|
263
|
-
<Image src={image.url} alt={GALLERY_SIMPLE.UI.DEFAULT_IMAGE_ALT} fill className="object-cover object-center rounded-2xl transition-all duration-300" priority={index === 0} loading={index === 0 ? "eager" : "lazy"} quality={85}/>
|
|
264
|
-
</div>
|
|
265
|
-
{isAdmin && (<div className="absolute top-2 right-2">
|
|
266
|
-
<TrashIconButton onClick={function (e) {
|
|
267
|
-
e.stopPropagation();
|
|
268
|
-
openConfirmDelete(image.documentId);
|
|
269
|
-
}} aria-label={GALLERY_SIMPLE.UI.DELETE_BUTTON_ARIA.replace("${image.title || image.documentId}", image.title || image.documentId)}/>
|
|
270
|
-
</div>)}
|
|
271
|
-
</Card>
|
|
272
|
-
</motion.div>); })}
|
|
273
|
-
</motion.div>
|
|
274
|
-
{visiblePhotos < uploadedImages.length && (<div className="mt-8 text-center">
|
|
275
|
-
<ActionButton onClick={loadMore} className="flex items-center gap-2">
|
|
276
|
-
{GALLERY_SIMPLE.BUTTONS.LOAD_MORE_BUTTON}
|
|
277
|
-
</ActionButton>
|
|
278
|
-
</div>)}
|
|
279
|
-
</>) : (<p className="text-center text-gray-700 font-bold text-base sm:text-lg md:text-xl">
|
|
280
|
-
{GALLERY_SIMPLE.UI.NO_IMAGES_MESSAGE}
|
|
281
|
-
</p>)}
|
|
282
|
-
<div className="mt-4 text-center">
|
|
283
|
-
{authLoading || isLoading ? (<p className="text-gray-400 text-sm font-medium">{GALLERY_SIMPLE.UI.LOADING_MESSAGE}</p>) : isAdmin ? (<p className="text-gray-400 text-sm font-medium">{GALLERY_SIMPLE.UI.ADMIN_LOGGED_IN_MESSAGE}</p>) : user ? (<p className="text-gray-400 text-sm font-medium"></p>) : (<p className="text-gray-400 text-sm font-medium"></p>)}
|
|
284
|
-
</div>
|
|
285
|
-
</div>
|
|
286
|
-
</TabsContent>
|
|
287
|
-
|
|
288
|
-
<TabsContent value="videos">
|
|
289
|
-
<div className="space-y-6">
|
|
290
|
-
<p className="text-center text-gray-700 font-bold text-base sm:text-lg md:text-xl">
|
|
291
|
-
{GALLERY_SIMPLE.UI.NO_VIDEOS_MESSAGE || "No videos are available"}
|
|
292
|
-
</p>
|
|
293
|
-
</div>
|
|
294
|
-
</TabsContent>
|
|
295
|
-
</Tabs>
|
|
296
|
-
</motion.div>
|
|
297
|
-
|
|
298
|
-
{selectedImage && (<motion.div variants={modalVariants} initial="hidden" animate="visible" exit="exit" className="fixed inset-0 bg-black/90 flex items-center justify-center z-[10000] p-2 sm:p-4 isolate" onClick={handleCloseModal} role="dialog" aria-modal="true" aria-labelledby="modal-image">
|
|
299
|
-
<div className="relative max-w-5xl w-full mx-2 sm:mx-4 max-h-[90vh] bg-gray-800/50 border border-gray-700/50 rounded-2xl shadow-lg overflow-hidden max-[768px]:p-4 max-[768px]:max-h-[85vh]" onClick={function (e) { return e.stopPropagation(); }}>
|
|
300
|
-
<CloseButton variant="close-form" onClick={handleCloseModal}>
|
|
301
|
-
<X className="h-6 w-6 sm:h-8 sm:w-8"/>
|
|
302
|
-
</CloseButton>
|
|
303
|
-
<div className="relative w-full h-[70vh] sm:h-[80vh]">
|
|
304
|
-
<Image src={selectedImage.url} alt={GALLERY_SIMPLE.UI.DEFAULT_IMAGE_ALT} fill className="object-contain rounded-2xl" quality={85}/>
|
|
305
|
-
</div>
|
|
306
|
-
</div>
|
|
307
|
-
</motion.div>)}
|
|
308
|
-
|
|
309
|
-
{isConfirmDeleteOpen && isAdmin && (<motion.div variants={modalVariants} initial="hidden" animate="visible" exit="exit" className="fixed inset-0 bg-black/90 flex items-center justify-center z-[10000] p-4 isolate" onClick={handleCancelDelete} role="dialog" aria-modal="true" aria-labelledby="modal-title">
|
|
310
|
-
<div className="relative max-w-md w-full mx-4 p-6 bg-gray-800/50 border border-gray-700/50 rounded-lg shadow-lg max-[768px]:p-4 max-[768px]:max-h-[85vh]" onClick={function (e) { return e.stopPropagation(); }}>
|
|
311
|
-
<CloseButton onClick={handleCancelDelete}>
|
|
312
|
-
<X className="h-6 w-6 sm:h-8 sm:w-8"/>
|
|
313
|
-
</CloseButton>
|
|
314
|
-
<h3 id="modal-title" className="text-xl font-bold text-white mb-4">
|
|
315
|
-
{GALLERY_SIMPLE.UI.DELETE_MODAL_HEADING}
|
|
316
|
-
</h3>
|
|
317
|
-
<p className="text-gray-300 text-sm mb-4">
|
|
318
|
-
{GALLERY_SIMPLE.UI.DELETE_CONFIRMATION_MESSAGE}
|
|
319
|
-
</p>
|
|
320
|
-
<div className="flex space-x-3">
|
|
321
|
-
<DeleteButton onClick={handleConfirmDelete} disabled={isLoading}>
|
|
322
|
-
{isLoading ? GALLERY_SIMPLE.BUTTONS.DELETING_BUTTON : GALLERY_SIMPLE.BUTTONS.DELETE_BUTTON}
|
|
323
|
-
</DeleteButton>
|
|
324
|
-
<CancelButton onClick={handleCancelDelete}/>
|
|
325
|
-
</div>
|
|
326
|
-
</div>
|
|
327
|
-
</motion.div>)}
|
|
328
|
-
|
|
329
|
-
{isUploadModalOpen && isAdmin && (<motion.div variants={modalVariants} initial="hidden" animate="visible" exit="exit" className="fixed inset-0 bg-black/90 flex items-center justify-center z-[10000] p-4 isolate" onClick={handleCloseUploadModal} role="dialog" aria-modal="true" aria-labelledby="upload-modal-title">
|
|
330
|
-
<div className="relative max-w-md w-full mx-4 p-6 bg-gray-800/50 border border-gray-700/50 rounded-lg shadow-lg max-[768px]:p-4 max-[768px]:max-h-[85vh]" onClick={function (e) { return e.stopPropagation(); }}>
|
|
331
|
-
<CloseButton onClick={handleCloseUploadModal}>
|
|
332
|
-
<X className="h-6 w-6 sm:h-8 sm:w-8"/>
|
|
333
|
-
</CloseButton>
|
|
334
|
-
<h3 id="upload-modal-title" className="text-xl font-bold text-white mb-4">
|
|
335
|
-
{GALLERY_SIMPLE.UI.UPLOAD_MODAL_HEADING}
|
|
336
|
-
</h3>
|
|
337
|
-
<form onSubmit={handleUploadSubmit} className="flex flex-col space-y-4">
|
|
338
|
-
<div>
|
|
339
|
-
<label htmlFor="image-upload" className="block text-sm font-medium text-gray-300 mb-1">
|
|
340
|
-
Choose Image
|
|
341
|
-
</label>
|
|
342
|
-
<input type="file" accept="image/jpeg,image/png,image/gif" onChange={function (e) {
|
|
343
|
-
var _a;
|
|
344
|
-
setSelectedFile(((_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0]) || null);
|
|
345
|
-
}} disabled={isLoading} className="hidden" id="image-upload" ref={fileInputRef}/>
|
|
346
|
-
<label htmlFor="image-upload" className="cursor-pointer">
|
|
347
|
-
<div className="flex items-center justify-between bg-gray-700 text-white px-4 py-2 rounded-lg">
|
|
348
|
-
<span>{selectedFile ? selectedFile.name : GALLERY_SIMPLE.UI.CHOOSE_IMAGE_TEXT}</span>
|
|
349
|
-
<Upload className="h-4 w-4"/>
|
|
350
|
-
</div>
|
|
351
|
-
</label>
|
|
352
|
-
</div>
|
|
353
|
-
<div className="flex space-x-3">
|
|
354
|
-
<SubmitButton type="submit" disabled={isLoading || !selectedFile}>
|
|
355
|
-
{isLoading ? GALLERY_SIMPLE.BUTTONS.UPLOADING_BUTTON : GALLERY_SIMPLE.BUTTONS.UPLOAD_BUTTON}
|
|
356
|
-
</SubmitButton>
|
|
357
|
-
<CancelButton onClick={handleCloseUploadModal}/>
|
|
358
|
-
</div>
|
|
359
|
-
</form>
|
|
360
|
-
</div>
|
|
361
|
-
</motion.div>)}
|
|
362
|
-
</div>);
|
|
363
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
// components/addOns/functional/galleries/constants/galleryComplex.ts
|
|
2
|
-
// Constants for hardcoded text in GalleryComplex.tsx, organized by purpose
|
|
3
|
-
export var GALLERY_COMPLEX = {
|
|
4
|
-
// UI Text for GalleryComplex
|
|
5
|
-
UI: {
|
|
6
|
-
// TabsTrigger value for photos tab (capitalized in UI)
|
|
7
|
-
PHOTOS_TAB: "Photos",
|
|
8
|
-
// TabsTrigger value for videos tab (capitalized in UI)
|
|
9
|
-
VIDEOS_TAB: "Videos",
|
|
10
|
-
// Sub-tab value for all images (capitalized in UI)
|
|
11
|
-
ALL_SUB_TAB: "All",
|
|
12
|
-
// Sub-tab value for indoor images (capitalized in UI)
|
|
13
|
-
INDOOR_SUB_TAB: "Indoor",
|
|
14
|
-
// Sub-tab value for outdoor images (capitalized in UI)
|
|
15
|
-
OUTDOOR_SUB_TAB: "Outdoor",
|
|
16
|
-
// Sub-tab value for commercial images (capitalized in UI)
|
|
17
|
-
COMMERCIAL_SUB_TAB: "Commercial",
|
|
18
|
-
// Text when no images exist
|
|
19
|
-
NO_IMAGES_MESSAGE: "No images available.",
|
|
20
|
-
// Text when loading
|
|
21
|
-
LOADING_MESSAGE: "Loading...",
|
|
22
|
-
// Text when admin is logged in
|
|
23
|
-
ADMIN_LOGGED_IN_MESSAGE: "You are logged in as an admin.",
|
|
24
|
-
// Default alt text for images
|
|
25
|
-
DEFAULT_IMAGE_ALT: "Gallery image",
|
|
26
|
-
// Delete confirmation modal heading
|
|
27
|
-
DELETE_MODAL_HEADING: "Confirm Deletion",
|
|
28
|
-
// Delete confirmation message
|
|
29
|
-
DELETE_CONFIRMATION_MESSAGE: "Are you sure you want to delete this image? This action cannot be undone.",
|
|
30
|
-
// Upload modal heading
|
|
31
|
-
UPLOAD_MODAL_HEADING: "Upload New Image",
|
|
32
|
-
// Default text for file input label
|
|
33
|
-
CHOOSE_IMAGE_TEXT: "Choose an image",
|
|
34
|
-
// Placeholder for title input in edit/upload forms
|
|
35
|
-
TITLE_PLACEHOLDER: "Image title (optional)",
|
|
36
|
-
// Placeholder for description textarea in edit/upload forms
|
|
37
|
-
DESCRIPTION_PLACEHOLDER: "Image description (optional)",
|
|
38
|
-
// Category option for none
|
|
39
|
-
CATEGORY_NONE: "None",
|
|
40
|
-
// Category option for indoor
|
|
41
|
-
CATEGORY_INDOOR: "Indoor",
|
|
42
|
-
// Category option for outdoor
|
|
43
|
-
CATEGORY_OUTDOOR: "Outdoor",
|
|
44
|
-
// Category option for commercial
|
|
45
|
-
CATEGORY_COMMERCIAL: "Commercial",
|
|
46
|
-
// Edit modal heading
|
|
47
|
-
EDIT_MODAL_HEADING: "Edit Image",
|
|
48
|
-
// No videos available message
|
|
49
|
-
NO_VIDEOS_MESSAGE: "No videos are available",
|
|
50
|
-
// Video titles for video cards
|
|
51
|
-
VIDEO_TITLES: [
|
|
52
|
-
"Race for the Cure 2019",
|
|
53
|
-
"Race for the Cure 2017",
|
|
54
|
-
"Race for the Cure 2016",
|
|
55
|
-
"Race for the Cure 2015",
|
|
56
|
-
"Race for the Cure 2014",
|
|
57
|
-
"Race for the Cure 2013",
|
|
58
|
-
"Absolutely Abs, Part 1",
|
|
59
|
-
"Absolutely Abs, Part 2",
|
|
60
|
-
"Absolutely Abs, Part 3",
|
|
61
|
-
"Absolutely Abs, Part 4",
|
|
62
|
-
"Absolutely Abs, Part 5",
|
|
63
|
-
"Fitstop Introduction",
|
|
64
|
-
"Fitstop 2: Choosing a personal trainer",
|
|
65
|
-
"Fitstop 3: Help at the office for Trapezius Injuries",
|
|
66
|
-
"Race for the Cure warmup",
|
|
67
|
-
"Camp Caiello",
|
|
68
|
-
],
|
|
69
|
-
},
|
|
70
|
-
// Button Text for GalleryComplex
|
|
71
|
-
BUTTONS: {
|
|
72
|
-
// ActionButton text for opening upload modal
|
|
73
|
-
UPLOAD_IMAGE_BUTTON: "Upload New Image",
|
|
74
|
-
// ActionButton text for loading more images
|
|
75
|
-
LOAD_MORE_BUTTON: "Load More",
|
|
76
|
-
// DeleteButton text when loading
|
|
77
|
-
DELETING_BUTTON: "Deleting...",
|
|
78
|
-
// DeleteButton text
|
|
79
|
-
DELETE_BUTTON: "Delete",
|
|
80
|
-
// SubmitButton text when loading in upload form
|
|
81
|
-
UPLOADING_BUTTON: "Uploading...",
|
|
82
|
-
// SubmitButton text in upload form
|
|
83
|
-
UPLOAD_BUTTON: "Upload",
|
|
84
|
-
// SubmitButton text when loading in edit form
|
|
85
|
-
SAVING_BUTTON: "Saving...",
|
|
86
|
-
// SubmitButton text in edit form
|
|
87
|
-
SAVE_BUTTON: "Save",
|
|
88
|
-
},
|
|
89
|
-
// Error Messages for GalleryComplex
|
|
90
|
-
ERRORS: {
|
|
91
|
-
// Error when non-admin tries to delete
|
|
92
|
-
UNAUTHORIZED_DELETE: "Unauthorized: Only admins can delete images",
|
|
93
|
-
// Error when non-admin tries to edit
|
|
94
|
-
UNAUTHORIZED_EDIT: "Unauthorized: Only admins can edit images",
|
|
95
|
-
// Error when token is missing or invalid
|
|
96
|
-
AUTHENTICATION_ERROR: "Authentication error. Please log in again.",
|
|
97
|
-
// Error when edit fails with status code
|
|
98
|
-
EDIT_FAILED_STATUS: "Failed to update image: ${response.status}",
|
|
99
|
-
// Generic error when edit fails
|
|
100
|
-
EDIT_FAILED: "Failed to update image",
|
|
101
|
-
// Error when non-admin tries to upload
|
|
102
|
-
UNAUTHORIZED_UPLOAD: "Unauthorized: Only admins can Upload New Images",
|
|
103
|
-
// Error when upload fails
|
|
104
|
-
UPLOAD_FAILED: "Failed to Upload New Image",
|
|
105
|
-
},
|
|
106
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// components/addOns/functional/galleries/constants/gallerySimple.ts
|
|
2
|
-
// Constants for hardcoded text in GallerySimple.tsx, organized by purpose
|
|
3
|
-
export var GALLERY_SIMPLE = {
|
|
4
|
-
// UI Text for GallerySimple
|
|
5
|
-
UI: {
|
|
6
|
-
// TabsTrigger text for photos tab
|
|
7
|
-
PHOTOS_TAB: "Photos",
|
|
8
|
-
// TabsTrigger text for videos tab
|
|
9
|
-
VIDEOS_TAB: "Videos",
|
|
10
|
-
// Text when no images exist
|
|
11
|
-
NO_IMAGES_MESSAGE: "No images available.",
|
|
12
|
-
// Text when loading
|
|
13
|
-
LOADING_MESSAGE: "Loading...",
|
|
14
|
-
// Text when admin is logged in
|
|
15
|
-
ADMIN_LOGGED_IN_MESSAGE: "You are logged in as an admin.",
|
|
16
|
-
// Default alt text for images
|
|
17
|
-
DEFAULT_IMAGE_ALT: "Gallery image",
|
|
18
|
-
// Delete confirmation modal heading
|
|
19
|
-
DELETE_MODAL_HEADING: "Confirm Deletion",
|
|
20
|
-
// Delete confirmation message
|
|
21
|
-
DELETE_CONFIRMATION_MESSAGE: "Are you sure you want to delete this image? This action cannot be undone.",
|
|
22
|
-
// Upload modal heading
|
|
23
|
-
UPLOAD_MODAL_HEADING: "Upload New Image",
|
|
24
|
-
// Default text for file input label
|
|
25
|
-
CHOOSE_IMAGE_TEXT: "Choose an image",
|
|
26
|
-
// TrashIconButton aria-label template
|
|
27
|
-
DELETE_BUTTON_ARIA: "Delete image ${image.title || image.documentId}",
|
|
28
|
-
// No videos available message
|
|
29
|
-
NO_VIDEOS_MESSAGE: "No videos are available",
|
|
30
|
-
// Video titles for video cards
|
|
31
|
-
VIDEO_TITLES: [
|
|
32
|
-
"Race for the Cure 2019",
|
|
33
|
-
"Race for the Cure 2017",
|
|
34
|
-
"Race for the Cure 2016",
|
|
35
|
-
"Race for the Cure 2015",
|
|
36
|
-
"Race for the Cure 2014",
|
|
37
|
-
"Race for the Cure 2013",
|
|
38
|
-
"Absolutely Abs, Part 1",
|
|
39
|
-
"Absolutely Abs, Part 2",
|
|
40
|
-
"Absolutely Abs, Part 3",
|
|
41
|
-
"Absolutely Abs, Part 4",
|
|
42
|
-
"Absolutely Abs, Part 5",
|
|
43
|
-
"Fitstop Introduction",
|
|
44
|
-
"Fitstop 2: Choosing a personal trainer",
|
|
45
|
-
"Fitstop 3: Help at the office for Trapezius Injuries",
|
|
46
|
-
"Race for the Cure warmup",
|
|
47
|
-
"Camp Caiello",
|
|
48
|
-
],
|
|
49
|
-
},
|
|
50
|
-
// Button Text for GallerySimple
|
|
51
|
-
BUTTONS: {
|
|
52
|
-
// ActionButton text for opening upload modal
|
|
53
|
-
UPLOAD_IMAGE_BUTTON: "Upload New Image",
|
|
54
|
-
// ActionButton text for loading more images
|
|
55
|
-
LOAD_MORE_BUTTON: "Load More",
|
|
56
|
-
// DeleteButton text when loading
|
|
57
|
-
DELETING_BUTTON: "Deleting...",
|
|
58
|
-
// DeleteButton text
|
|
59
|
-
DELETE_BUTTON: "Delete",
|
|
60
|
-
// SubmitButton text when loading
|
|
61
|
-
UPLOADING_BUTTON: "Uploading...",
|
|
62
|
-
// SubmitButton text
|
|
63
|
-
UPLOAD_BUTTON: "Upload",
|
|
64
|
-
},
|
|
65
|
-
// Error Messages for GallerySimple
|
|
66
|
-
ERRORS: {
|
|
67
|
-
// Error when non-admin tries to delete
|
|
68
|
-
UNAUTHORIZED_DELETE: "Unauthorized: Only admins can delete images",
|
|
69
|
-
// Error when no file is selected
|
|
70
|
-
INVALID_FILE: "Please select a valid image file",
|
|
71
|
-
// Error when non-admin tries to upload
|
|
72
|
-
UNAUTHORIZED_UPLOAD: "Unauthorized: Only admins can Upload New Images",
|
|
73
|
-
// Error when upload fails
|
|
74
|
-
UPLOAD_FAILED: "Failed to Upload New Image",
|
|
75
|
-
},
|
|
76
|
-
};
|