@devvistatech/devvista-kit 0.0.1
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 +13 -0
- package/LICENSE +7 -0
- package/README.md +15 -0
- package/app/about/page.tsx +306 -0
- package/app/adRequest/page.tsx +550 -0
- package/app/analytics/page.tsx +347 -0
- package/app/api/about/route.ts +307 -0
- package/app/api/adRequest/route.ts +568 -0
- package/app/api/analytics/[reportType]/route.ts +338 -0
- package/app/api/bio/route.ts +314 -0
- package/app/api/blog/route.ts +307 -0
- package/app/api/chat/route.ts +15 -0
- package/app/api/contact/route.ts +410 -0
- package/app/api/contacts/route.ts +225 -0
- package/app/api/files/route.ts +430 -0
- package/app/api/gallery-data/route.ts +661 -0
- package/app/api/schedule/route.ts +456 -0
- package/app/api/sync-user/route.ts +114 -0
- package/app/api/trial-request/route.ts +298 -0
- package/app/blog/[id]/page.tsx +281 -0
- package/app/blog/page.tsx +217 -0
- package/app/constants/about.ts +49 -0
- package/app/constants/adRequest.ts +114 -0
- package/app/constants/contact.ts +41 -0
- package/app/constants/faq.ts +46 -0
- package/app/constants/gallery.ts +43 -0
- package/app/constants/page.ts +70 -0
- package/app/constants/schedule.ts +72 -0
- package/app/contact/page.tsx +285 -0
- package/app/faq/page.tsx +192 -0
- package/app/favicon.ico +0 -0
- package/app/gallery/page.tsx +320 -0
- package/app/globals.css +58 -0
- package/app/layout.tsx +62 -0
- package/app/page.tsx +339 -0
- package/app/schedule/page.tsx +661 -0
- package/bin/init.js +187 -0
- package/components/addOns/functional/BioEditor.tsx +430 -0
- package/components/addOns/functional/CalendlyWidget.tsx +101 -0
- package/components/addOns/functional/ClassList.tsx +146 -0
- package/components/addOns/functional/ClassPopup.tsx +399 -0
- package/components/addOns/functional/ContactForm.tsx +285 -0
- package/components/addOns/functional/FileUploader.tsx +293 -0
- package/components/addOns/functional/ImageDescCarousel.tsx +821 -0
- package/components/addOns/functional/NewUserAnalytics.tsx +101 -0
- package/components/addOns/functional/ScheduleCarousel.tsx +172 -0
- package/components/addOns/functional/aboutSections/AboutSection.tsx +571 -0
- package/components/addOns/functional/aboutSections/constants/aboutSection.ts +66 -0
- package/components/addOns/functional/blogSections/BlogDashboard.tsx +185 -0
- package/components/addOns/functional/blogSections/BlogFormPopUp.tsx +555 -0
- package/components/addOns/functional/blogSections/BlogList.tsx +149 -0
- package/components/addOns/functional/blogSections/BlogSidebar.tsx +59 -0
- package/components/addOns/functional/blogSections/constants/blogDashboard.ts +29 -0
- package/components/addOns/functional/blogSections/constants/blogFormPopUp.ts +98 -0
- package/components/addOns/functional/blogSections/constants/blogList.ts +23 -0
- package/components/addOns/functional/blogSections/constants/blogSidebar.ts +16 -0
- package/components/addOns/functional/contactsDashboard/ContactsDashboard.tsx +348 -0
- package/components/addOns/functional/contactsDashboard/constants/contactsDashboard.ts +71 -0
- package/components/addOns/functional/galleries/GalleryComplex.tsx +908 -0
- package/components/addOns/functional/galleries/GallerySimple.tsx +604 -0
- package/components/addOns/functional/galleries/constants/galleryComplex.ts +105 -0
- package/components/addOns/functional/galleries/constants/gallerySimple.ts +75 -0
- package/components/addOns/functional/schedules/ScheduleGridOne.tsx +263 -0
- package/components/addOns/functional/schedules/ScheduleGridTwo.tsx +295 -0
- package/components/addOns/functional/schedules/ScheduleGridTwoBasic.tsx +289 -0
- package/components/addOns/functional/schedules/SchedulerForm.tsx +429 -0
- package/components/addOns/functional/schedules/constants/ScheduleGridTwo.ts +41 -0
- package/components/addOns/functional/schedules/constants/ScheduleGridTwoBasic.ts +41 -0
- package/components/addOns/functional/schedules/constants/SchedulerForm.ts +66 -0
- package/components/addOns/functional/schedules/constants/scheduleGridOne.ts +55 -0
- package/components/addOns/non-functional/AnnouncementBanner.tsx +47 -0
- package/components/addOns/non-functional/FeaturesSection.tsx +63 -0
- package/components/addOns/non-functional/HeroSection.tsx +143 -0
- package/components/addOns/non-functional/IconBubble.tsx +50 -0
- package/components/addOns/non-functional/SampleCarousel.tsx +205 -0
- package/components/addOns/non-functional/Testimonials.tsx +336 -0
- package/components/addOns/non-functional/ThreeSetGallery.tsx +64 -0
- package/components/addOns/non-functional/aboutSections/AboutSection.tsx +63 -0
- package/components/addOns/non-functional/aboutSections/constants/aboutSection.ts +25 -0
- package/components/addOns/non-functional/imageCarousels/ProductSlider.tsx +118 -0
- package/components/addOns/non-functional/imageCarousels/ProgramCarousel.tsx +233 -0
- package/components/addOns/non-functional/imageCarousels/constants/programCarousel.ts +40 -0
- package/components/addOns/non-functional/imageCarousels/constants/programSlider.ts +37 -0
- package/components/addOns/non-functional/spinner.tsx +22 -0
- package/components/footers/footer.tsx +454 -0
- package/components/navBars/navbar.tsx +311 -0
- package/components/other/accordion.tsx +58 -0
- package/components/other/admin-menu.tsx +69 -0
- package/components/other/alert-dialog.tsx +141 -0
- package/components/other/alert.tsx +59 -0
- package/components/other/aspect-ratio.tsx +7 -0
- package/components/other/avatar.tsx +50 -0
- package/components/other/badge.tsx +36 -0
- package/components/other/breadcrumb.tsx +115 -0
- package/components/other/button.tsx +733 -0
- package/components/other/calendar.tsx +66 -0
- package/components/other/card.tsx +86 -0
- package/components/other/carousel.tsx +275 -0
- package/components/other/chart.tsx +363 -0
- package/components/other/checkbox.tsx +30 -0
- package/components/other/collapsible.tsx +11 -0
- package/components/other/command.tsx +155 -0
- package/components/other/context-menu.tsx +200 -0
- package/components/other/dialog.tsx +122 -0
- package/components/other/drawer.tsx +118 -0
- package/components/other/dropdown-menu.tsx +200 -0
- package/components/other/form.tsx +179 -0
- package/components/other/hover-card.tsx +29 -0
- package/components/other/input-otp.tsx +71 -0
- package/components/other/input.tsx +25 -0
- package/components/other/label.tsx +26 -0
- package/components/other/login-popup.tsx +0 -0
- package/components/other/menubar.tsx +236 -0
- package/components/other/mobile-icon.tsx +22 -0
- package/components/other/navigation-menu.tsx +128 -0
- package/components/other/pagination.tsx +117 -0
- package/components/other/popover.tsx +31 -0
- package/components/other/progress.tsx +28 -0
- package/components/other/radio-group.tsx +44 -0
- package/components/other/resizable.tsx +45 -0
- package/components/other/scroll-area.tsx +48 -0
- package/components/other/select.tsx +160 -0
- package/components/other/separator.tsx +31 -0
- package/components/other/sheet.tsx +140 -0
- package/components/other/signup-popup.tsx +0 -0
- package/components/other/skeleton.tsx +15 -0
- package/components/other/slider.tsx +28 -0
- package/components/other/social-icons.tsx +40 -0
- package/components/other/sonner.tsx +31 -0
- package/components/other/switch.tsx +29 -0
- package/components/other/table.tsx +117 -0
- package/components/other/tabs.tsx +55 -0
- package/components/other/textarea.tsx +24 -0
- package/components/other/toast.tsx +123 -0
- package/components/other/toaster.tsx +35 -0
- package/components/other/toggle-group.tsx +61 -0
- package/components/other/toggle.tsx +45 -0
- package/components/other/tooltip.tsx +30 -0
- package/components/theme-provider.tsx +9 -0
- package/components/types.ts +22 -0
- package/dist/.next/types/app/api/about/route.js +52 -0
- package/dist/.next/types/app/api/blog/route.js +52 -0
- package/dist/.next/types/app/api/files/route.js +52 -0
- package/dist/.next/types/app/api/schedule/route.js +52 -0
- package/dist/.next/types/app/api/sync-user/route.js +52 -0
- package/dist/.next/types/app/layout.js +22 -0
- package/dist/.next/types/app/page.js +22 -0
- package/dist/app/about/page.jsx +259 -0
- package/dist/app/adRequest/page.jsx +531 -0
- package/dist/app/analytics/page.jsx +298 -0
- package/dist/app/api/about/route.js +285 -0
- package/dist/app/api/adRequest/route.js +440 -0
- package/dist/app/api/analytics/[reportType]/route.js +346 -0
- package/dist/app/api/bio/route.js +293 -0
- package/dist/app/api/blog/route.js +366 -0
- package/dist/app/api/chat/route.js +58 -0
- package/dist/app/api/contact/route.js +163 -0
- package/dist/app/api/contacts/route.js +234 -0
- package/dist/app/api/files/route.js +444 -0
- package/dist/app/api/gallery-data/route.js +642 -0
- package/dist/app/api/schedule/route.js +461 -0
- package/dist/app/api/sync-user/route.js +174 -0
- package/dist/app/api/trial-request/route.js +165 -0
- package/dist/app/blog/[id]/page.jsx +307 -0
- package/dist/app/blog/page.jsx +210 -0
- package/dist/app/constants/about.js +32 -0
- package/dist/app/constants/adRequest.js +113 -0
- package/dist/app/constants/contact.js +40 -0
- package/dist/app/constants/faq.js +36 -0
- package/dist/app/constants/gallery.js +42 -0
- package/dist/app/constants/page.js +69 -0
- package/dist/app/constants/schedule.js +71 -0
- package/dist/app/contact/page.jsx +119 -0
- package/dist/app/faq/page.jsx +97 -0
- package/dist/app/gallery/page.jsx +280 -0
- package/dist/app/layout.jsx +45 -0
- package/dist/app/page.jsx +324 -0
- package/dist/app/schedule/page.jsx +500 -0
- package/dist/components/addOns/functional/BioEditor.jsx +175 -0
- package/dist/components/addOns/functional/CalendlyWidget.jsx +61 -0
- package/dist/components/addOns/functional/ClassList.jsx +158 -0
- package/dist/components/addOns/functional/ClassPopup.jsx +300 -0
- package/dist/components/addOns/functional/ContactForm.jsx +219 -0
- package/dist/components/addOns/functional/FileUploader.jsx +222 -0
- package/dist/components/addOns/functional/ImageDescCarousel.jsx +464 -0
- package/dist/components/addOns/functional/NewUserAnalytics.jsx +71 -0
- package/dist/components/addOns/functional/ScheduleCarousel.jsx +68 -0
- package/dist/components/addOns/functional/aboutSections/AboutSection.jsx +369 -0
- package/dist/components/addOns/functional/aboutSections/constants/aboutSection.js +65 -0
- package/dist/components/addOns/functional/blogSections/BlogDashboard.jsx +111 -0
- package/dist/components/addOns/functional/blogSections/BlogFormPopUp.jsx +465 -0
- package/dist/components/addOns/functional/blogSections/BlogList.jsx +170 -0
- package/dist/components/addOns/functional/blogSections/BlogSidebar.jsx +35 -0
- package/dist/components/addOns/functional/blogSections/constants/blogDashboard.js +28 -0
- package/dist/components/addOns/functional/blogSections/constants/blogFormPopUp.js +97 -0
- package/dist/components/addOns/functional/blogSections/constants/blogList.js +22 -0
- package/dist/components/addOns/functional/blogSections/constants/blogSidebar.js +15 -0
- package/dist/components/addOns/functional/contactsDashboard/ContactsDashboard.jsx +323 -0
- package/dist/components/addOns/functional/contactsDashboard/constants/contactsDashboard.js +70 -0
- package/dist/components/addOns/functional/galleries/GalleryComplex.jsx +586 -0
- package/dist/components/addOns/functional/galleries/GallerySimple.jsx +385 -0
- package/dist/components/addOns/functional/galleries/constants/galleryComplex.js +104 -0
- package/dist/components/addOns/functional/galleries/constants/gallerySimple.js +74 -0
- package/dist/components/addOns/functional/schedules/ScheduleGridOne.jsx +167 -0
- package/dist/components/addOns/functional/schedules/ScheduleGridTwo.jsx +100 -0
- package/dist/components/addOns/functional/schedules/ScheduleGridTwoBasic.jsx +97 -0
- package/dist/components/addOns/functional/schedules/SchedulerForm.jsx +188 -0
- package/dist/components/addOns/functional/schedules/constants/ScheduleGridTwo.js +40 -0
- package/dist/components/addOns/functional/schedules/constants/ScheduleGridTwoBasic.js +40 -0
- package/dist/components/addOns/functional/schedules/constants/SchedulerForm.js +65 -0
- package/dist/components/addOns/functional/schedules/constants/scheduleGridOne.js +54 -0
- package/dist/components/addOns/non-functional/AnnouncementBanner.jsx +24 -0
- package/dist/components/addOns/non-functional/FeaturesSection.jsx +38 -0
- package/dist/components/addOns/non-functional/HeroSection.jsx +71 -0
- package/dist/components/addOns/non-functional/IconBubble.jsx +36 -0
- package/dist/components/addOns/non-functional/SampleCarousel.jsx +114 -0
- package/dist/components/addOns/non-functional/Testimonials.jsx +177 -0
- package/dist/components/addOns/non-functional/ThreeSetGallery.jsx +40 -0
- package/dist/components/addOns/non-functional/aboutSections/AboutSection.jsx +35 -0
- package/dist/components/addOns/non-functional/aboutSections/constants/aboutSection.js +24 -0
- package/dist/components/addOns/non-functional/imageCarousels/ProductSlider.jsx +80 -0
- package/dist/components/addOns/non-functional/imageCarousels/ProgramCarousel.jsx +155 -0
- package/dist/components/addOns/non-functional/imageCarousels/constants/programCarousel.js +39 -0
- package/dist/components/addOns/non-functional/imageCarousels/constants/programSlider.js +36 -0
- package/dist/components/addOns/non-functional/spinner.jsx +13 -0
- package/dist/components/footers/footer.jsx +219 -0
- package/dist/components/navBars/navbar.jsx +158 -0
- package/dist/components/other/accordion.jsx +40 -0
- package/dist/components/other/admin-menu.jsx +34 -0
- package/dist/components/other/alert-dialog.jsx +64 -0
- package/dist/components/other/alert.jsx +41 -0
- package/dist/components/other/aspect-ratio.jsx +4 -0
- package/dist/components/other/avatar.jsx +31 -0
- package/dist/components/other/badge.jsx +32 -0
- package/dist/components/other/breadcrumb.jsx +57 -0
- package/dist/components/other/button.jsx +321 -0
- package/dist/components/other/calendar.jsx +43 -0
- package/dist/components/other/card.jsx +44 -0
- package/dist/components/other/carousel.jsx +140 -0
- package/dist/components/other/chart.jsx +182 -0
- package/dist/components/other/checkbox.jsx +26 -0
- package/dist/components/other/collapsible.jsx +6 -0
- package/dist/components/other/command.jsx +68 -0
- package/dist/components/other/context-menu.jsx +88 -0
- package/dist/components/other/dialog.jsx +60 -0
- package/dist/components/other/drawer.jsx +60 -0
- package/dist/components/other/dropdown-menu.jsx +90 -0
- package/dist/components/other/form.jsx +89 -0
- package/dist/components/other/hover-card.jsx +23 -0
- package/dist/components/other/input-otp.jsx +46 -0
- package/dist/components/other/input.jsx +19 -0
- package/dist/components/other/label.jsx +23 -0
- package/dist/components/other/login-popup.jsx +1 -0
- package/dist/components/other/menubar.jsx +96 -0
- package/dist/components/other/mobile-icon.jsx +11 -0
- package/dist/components/other/navigation-menu.jsx +62 -0
- package/dist/components/other/pagination.jsx +63 -0
- package/dist/components/other/popover.jsx +25 -0
- package/dist/components/other/progress.jsx +23 -0
- package/dist/components/other/radio-group.jsx +31 -0
- package/dist/components/other/resizable.jsx +29 -0
- package/dist/components/other/scroll-area.jsx +36 -0
- package/dist/components/other/select.jsx +83 -0
- package/dist/components/other/separator.jsx +21 -0
- package/dist/components/other/sheet.jsx +74 -0
- package/dist/components/other/signup-popup.jsx +1 -0
- package/dist/components/other/skeleton.jsx +17 -0
- package/dist/components/other/slider.jsx +26 -0
- package/dist/components/other/social-icons.jsx +15 -0
- package/dist/components/other/sonner.jsx +27 -0
- package/dist/components/other/switch.jsx +23 -0
- package/dist/components/other/table.jsx +56 -0
- package/dist/components/other/tabs.jsx +32 -0
- package/dist/components/other/textarea.jsx +19 -0
- package/dist/components/other/toast.jsx +58 -0
- package/dist/components/other/toaster.jsx +31 -0
- package/dist/components/other/toggle-group.jsx +41 -0
- package/dist/components/other/toggle.jsx +39 -0
- package/dist/components/other/tooltip.jsx +24 -0
- package/dist/components/theme-provider.jsx +18 -0
- package/dist/components/types.js +1 -0
- package/dist/hooks/use-toast.js +135 -0
- package/dist/lib/auth-context.jsx +144 -0
- package/dist/lib/google-analytics.jsx +148 -0
- package/dist/lib/utils.js +9 -0
- package/dist/lib/verify-user.js +142 -0
- package/dist/middleware.js +32 -0
- package/dist/tailwind.config.js +86 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/hooks/use-toast.ts +188 -0
- package/lib/auth-context.tsx +131 -0
- package/lib/google-analytics.tsx +98 -0
- package/lib/utils.ts +6 -0
- package/lib/verify-user.ts +118 -0
- package/middleware.ts +35 -0
- package/next.config.js +10 -0
- package/package.json +116 -0
- package/postcss.config.js +6 -0
- package/public/images/FitStop.png +0 -0
- package/public/images/classes/bodyblast.JPG +0 -0
- package/public/images/classes/cardioxtrain.JPG +0 -0
- package/public/images/classes/combo.JPG +0 -0
- package/public/images/classes/flexiblefriday.JPG +0 -0
- package/public/images/classes/freestyle.jpg +0 -0
- package/public/images/classes/noclasses.jpg +0 -0
- package/public/images/classes/seniorstretch.JPG +0 -0
- package/public/images/classes/stretch.JPG +0 -0
- package/public/images/classes/zoomba.JPG +0 -0
- package/public/images/fitstoproom1.jpg +0 -0
- package/public/images/fitstoproom2.jpg +0 -0
- package/public/images/gallery/021-1024x768.jpg +0 -0
- package/public/images/gallery/023-1024x768.jpg +0 -0
- package/public/images/gallery/027-1024x768.jpg +0 -0
- package/public/images/gallery/029-1024x768.jpg +0 -0
- package/public/images/gallery/030-1024x768.jpg +0 -0
- package/public/images/gallery/042-1024x768.jpg +0 -0
- package/public/images/gallery/049-1024x768.jpg +0 -0
- package/public/images/gallery/073-1024x768.jpg +0 -0
- package/public/images/gallery/108-300x225.jpg +0 -0
- package/public/images/gallery/109-300x225.jpg +0 -0
- package/public/images/gallery/116.jpg +0 -0
- package/public/images/gallery/123-1-1024x768.jpg +0 -0
- package/public/images/gallery/133.jpg +0 -0
- package/public/images/gallery/142-1.jpg +0 -0
- package/public/images/gallery/143.jpg +0 -0
- package/public/images/gallery/145-1-1024x768.jpg +0 -0
- package/public/images/gallery/151-1024x768.jpg +0 -0
- package/public/images/gallery/166-300x225.jpg +0 -0
- package/public/images/gallery/175.jpg +0 -0
- package/public/images/gallery/183-1024x768.jpg +0 -0
- package/public/images/gallery/311.JPG +0 -0
- package/public/images/gallery/413-1.jpg +0 -0
- package/public/images/gallery/Cathys-Fit-Stop-Holiday-Party-0003-1024x683.jpg +0 -0
- package/public/images/gallery/Cathys-Fit-Stop-Holiday-Party-0076-1024x683.jpg +0 -0
- package/public/images/gallery/Cathys-Fit-Stop-Holiday-Party-0171-1024x683.jpg +0 -0
- package/public/images/gallery/DSCN0233-1024x768.jpg +0 -0
- package/public/images/gallery/DSCN0245-1-1024x768.jpg +0 -0
- package/public/images/gallery/Fitstopgirls2.jpg +0 -0
- package/public/images/gallery/GrandOpening2009.JPG +0 -0
- package/public/images/gallery/IMG_1937.JPG +0 -0
- package/public/images/gallery/IMG_1950-20.jpg +0 -0
- package/public/images/gallery/IMG_2112.JPG +0 -0
- package/public/images/gallery/IMG_2229.JPG +0 -0
- package/public/images/gallery/IMG_2272.JPG +0 -0
- package/public/images/gallery/IMG_2336.JPG +0 -0
- package/public/images/gallery/IMG_2367.JPG +0 -0
- package/public/images/gallery/IMG_2520.jpg +0 -0
- package/public/images/gallery/IMG_2564.jpg +0 -0
- package/public/images/gallery/IMG_3678.jpg +0 -0
- package/public/images/gallery/IMG_3744.jpg +0 -0
- package/public/images/gallery/IMG_3745.jpg +0 -0
- package/public/images/gallery/IMG_6383.jpg +0 -0
- package/public/images/gallery/Jillian-8-Months-2338-1024x683.jpg +0 -0
- package/public/images/gallery/Kathys-Fit-Stop-0032-1024x675.jpg +0 -0
- package/public/images/gallery/LaurieinPlank.jpeg +0 -0
- package/public/images/gallery/May2017032.JPG +0 -0
- package/public/images/gallery/clubpic10.jpg +0 -0
- package/public/images/gallery/clubpic15.jpg +0 -0
- package/public/images/gallery/clubpic2.jpg +0 -0
- package/public/images/gallery/clubpic3.jpg +0 -0
- package/public/images/gallery/clubpic4.jpg +0 -0
- package/public/images/gallery/clubpic5.jpg +0 -0
- package/public/images/gallery/clubpic6.jpg +0 -0
- package/public/images/gallery/clubpic7.jpg +0 -0
- package/public/images/gallery/clubpic8.jpg +0 -0
- package/public/images/gallery/clubpic9.jpg +0 -0
- package/public/images/gallery/z014-1024x768.jpg +0 -0
- package/public/images/gallery/z019-1-1024x768.jpg +0 -0
- package/public/images/kathy_faq-300x132.jpg +0 -0
- package/public/images/kathyportrait.jpg +0 -0
- package/public/images/kristiportrait.jpg +0 -0
- package/public/images/maincoverbackground.JPG +0 -0
- package/public/images/videos/FitStopLoopVideo.mp4 +0 -0
- package/public/images/weights.jpg +0 -0
- package/public/pdf/FitStop-Forum-April-2025.pdf +0 -0
- package/tailwind.config.ts +89 -0
- package/tsconfig.json +24 -0
|
@@ -0,0 +1,385 @@
|
|
|
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;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "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
|
+
var videos = GALLERY_SIMPLE.UI.VIDEO_TITLES.map(function (title, index) { return ({
|
|
70
|
+
url: [
|
|
71
|
+
"https://www.youtube.com/embed/Ch5fnKgDZH8",
|
|
72
|
+
"https://www.youtube.com/embed/XW3zDzMZNv8",
|
|
73
|
+
"https://www.youtube.com/embed/odC_X6g1uFs",
|
|
74
|
+
"https://www.youtube.com/embed/DFuBBzMi6ZA",
|
|
75
|
+
"https://www.youtube.com/embed/zZNMJyMmcFQ",
|
|
76
|
+
"https://www.youtube.com/embed/VRpbsZGU4a0",
|
|
77
|
+
"https://www.youtube.com/embed/qE14UbB3-gs",
|
|
78
|
+
"https://www.youtube.com/embed/QoVE5TqMkvU",
|
|
79
|
+
"https://www.youtube.com/embed/7Fzgw0SK-8k",
|
|
80
|
+
"https://www.youtube.com/embed/wN0j6JoliAE",
|
|
81
|
+
"https://www.youtube.com/embed/vzFZzhB8KvA",
|
|
82
|
+
"https://www.youtube.com/embed/4thuylOfM9w",
|
|
83
|
+
"https://www.youtube.com/embed/sm3l_uPtaws",
|
|
84
|
+
"https://www.youtube.com/embed/xnnlanydT5I",
|
|
85
|
+
"https://www.youtube.com/embed/jLLePKwiFpI",
|
|
86
|
+
"https://www.youtube.com/embed/pBlpMq8JbIA",
|
|
87
|
+
][index],
|
|
88
|
+
title: title,
|
|
89
|
+
}); });
|
|
90
|
+
useEffect(function () {
|
|
91
|
+
var handleLogin = function () { return checkSession(); };
|
|
92
|
+
var handleLogout = function () { return checkSession(); };
|
|
93
|
+
window.addEventListener("user-login", handleLogin);
|
|
94
|
+
window.addEventListener("user-logout", handleLogout);
|
|
95
|
+
return function () {
|
|
96
|
+
window.removeEventListener("user-login", handleLogin);
|
|
97
|
+
window.removeEventListener("user-logout", handleLogout);
|
|
98
|
+
};
|
|
99
|
+
}, [checkSession]);
|
|
100
|
+
useEffect(function () {
|
|
101
|
+
var checkMobile = function () { return setIsMobile(window.innerWidth < 768); };
|
|
102
|
+
checkMobile();
|
|
103
|
+
window.addEventListener("resize", checkMobile);
|
|
104
|
+
return function () { return window.removeEventListener("resize", checkMobile); };
|
|
105
|
+
}, []);
|
|
106
|
+
useEffect(function () {
|
|
107
|
+
if (selectedImage || isConfirmDeleteOpen || isUploadModalOpen) {
|
|
108
|
+
document.body.classList.add("overflow-hidden");
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
document.body.classList.remove("overflow-hidden");
|
|
112
|
+
}
|
|
113
|
+
return function () {
|
|
114
|
+
document.body.classList.remove("overflow-hidden");
|
|
115
|
+
};
|
|
116
|
+
}, [selectedImage, isConfirmDeleteOpen, isUploadModalOpen]);
|
|
117
|
+
useEffect(function () {
|
|
118
|
+
var event = new CustomEvent("modalStateChange", {
|
|
119
|
+
detail: { isOpen: !!selectedImage || isConfirmDeleteOpen || isUploadModalOpen },
|
|
120
|
+
});
|
|
121
|
+
window.dispatchEvent(event);
|
|
122
|
+
}, [selectedImage, isConfirmDeleteOpen, isUploadModalOpen]);
|
|
123
|
+
useEffect(function () {
|
|
124
|
+
var handleEsc = function (e) {
|
|
125
|
+
if (e.key === "Escape") {
|
|
126
|
+
if (isConfirmDeleteOpen) {
|
|
127
|
+
handleCancelDelete();
|
|
128
|
+
}
|
|
129
|
+
else if (selectedImage) {
|
|
130
|
+
handleCloseModal();
|
|
131
|
+
}
|
|
132
|
+
else if (isUploadModalOpen) {
|
|
133
|
+
handleCloseUploadModal();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
window.addEventListener("keydown", handleEsc);
|
|
138
|
+
return function () { return window.removeEventListener("keydown", handleEsc); };
|
|
139
|
+
}, [isConfirmDeleteOpen, selectedImage, isUploadModalOpen]);
|
|
140
|
+
var openConfirmDelete = function (documentId) {
|
|
141
|
+
if (!isAdmin) {
|
|
142
|
+
setError(GALLERY_SIMPLE.ERRORS.UNAUTHORIZED_DELETE);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
setDocumentIdToDelete(documentId);
|
|
146
|
+
setIsConfirmDeleteOpen(true);
|
|
147
|
+
};
|
|
148
|
+
var handleConfirmDelete = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
149
|
+
return __generator(this, function (_a) {
|
|
150
|
+
switch (_a.label) {
|
|
151
|
+
case 0:
|
|
152
|
+
if (!isAdmin) {
|
|
153
|
+
setError(GALLERY_SIMPLE.ERRORS.UNAUTHORIZED_DELETE);
|
|
154
|
+
setIsConfirmDeleteOpen(false);
|
|
155
|
+
return [2 /*return*/];
|
|
156
|
+
}
|
|
157
|
+
if (!(documentIdToDelete !== null)) return [3 /*break*/, 4];
|
|
158
|
+
setIsLoading(true);
|
|
159
|
+
_a.label = 1;
|
|
160
|
+
case 1:
|
|
161
|
+
_a.trys.push([1, , 3, 4]);
|
|
162
|
+
return [4 /*yield*/, handleDeleteImage(documentIdToDelete)];
|
|
163
|
+
case 2:
|
|
164
|
+
_a.sent();
|
|
165
|
+
return [3 /*break*/, 4];
|
|
166
|
+
case 3:
|
|
167
|
+
setIsLoading(false);
|
|
168
|
+
setIsConfirmDeleteOpen(false);
|
|
169
|
+
setDocumentIdToDelete(null);
|
|
170
|
+
return [7 /*endfinally*/];
|
|
171
|
+
case 4: return [2 /*return*/];
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}); };
|
|
175
|
+
var handleCancelDelete = function () {
|
|
176
|
+
setIsConfirmDeleteOpen(false);
|
|
177
|
+
setDocumentIdToDelete(null);
|
|
178
|
+
};
|
|
179
|
+
var handleImageClick = function (image) {
|
|
180
|
+
setSelectedImage({ url: image.url });
|
|
181
|
+
};
|
|
182
|
+
var handleCloseModal = function () {
|
|
183
|
+
setSelectedImage(null);
|
|
184
|
+
};
|
|
185
|
+
var handleCloseUploadModal = function () {
|
|
186
|
+
setIsUploadModalOpen(false);
|
|
187
|
+
setSelectedFile(null);
|
|
188
|
+
if (fileInputRef.current) {
|
|
189
|
+
fileInputRef.current.value = "";
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
var handleUploadSubmit = function (e) { return __awaiter(_this, void 0, void 0, function () {
|
|
193
|
+
var err_1;
|
|
194
|
+
return __generator(this, function (_a) {
|
|
195
|
+
switch (_a.label) {
|
|
196
|
+
case 0:
|
|
197
|
+
e.preventDefault();
|
|
198
|
+
if (!isAdmin) {
|
|
199
|
+
console.error("GallerySimple: Unauthorized upload attempt", {
|
|
200
|
+
isSignedIn: isSignedIn,
|
|
201
|
+
businessAdminId: user === null || user === void 0 ? void 0 : user.businessAdminId,
|
|
202
|
+
});
|
|
203
|
+
setError(GALLERY_SIMPLE.ERRORS.UNAUTHORIZED_UPLOAD);
|
|
204
|
+
return [2 /*return*/];
|
|
205
|
+
}
|
|
206
|
+
if (!selectedFile || selectedFile.size === 0) {
|
|
207
|
+
setError(GALLERY_SIMPLE.ERRORS.INVALID_FILE);
|
|
208
|
+
return [2 /*return*/];
|
|
209
|
+
}
|
|
210
|
+
setIsLoading(true);
|
|
211
|
+
_a.label = 1;
|
|
212
|
+
case 1:
|
|
213
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
214
|
+
return [4 /*yield*/, handleImageUpload(e, selectedFile, "", "", "none")];
|
|
215
|
+
case 2:
|
|
216
|
+
_a.sent();
|
|
217
|
+
return [3 /*break*/, 5];
|
|
218
|
+
case 3:
|
|
219
|
+
err_1 = _a.sent();
|
|
220
|
+
console.error("GallerySimple: Upload Error", err_1);
|
|
221
|
+
setError(err_1 instanceof Error ? err_1.message : GALLERY_SIMPLE.ERRORS.UPLOAD_FAILED);
|
|
222
|
+
return [3 /*break*/, 5];
|
|
223
|
+
case 4:
|
|
224
|
+
setIsLoading(false);
|
|
225
|
+
setIsUploadModalOpen(false);
|
|
226
|
+
setSelectedFile(null);
|
|
227
|
+
if (fileInputRef.current) {
|
|
228
|
+
fileInputRef.current.value = "";
|
|
229
|
+
}
|
|
230
|
+
return [7 /*endfinally*/];
|
|
231
|
+
case 5: return [2 /*return*/];
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}); };
|
|
235
|
+
var loadMore = function () {
|
|
236
|
+
setVisiblePhotos(function (prev) { return prev + 12; });
|
|
237
|
+
};
|
|
238
|
+
var sectionVariants = {
|
|
239
|
+
hidden: { opacity: 0 },
|
|
240
|
+
visible: {
|
|
241
|
+
opacity: 1,
|
|
242
|
+
transition: { duration: 0.8, ease: [0.16, 1, 0.3, 1], staggerChildren: 0.1 },
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
var cardVariants = {
|
|
246
|
+
hidden: { opacity: 0, y: 30 },
|
|
247
|
+
visible: {
|
|
248
|
+
opacity: 1,
|
|
249
|
+
y: 0,
|
|
250
|
+
transition: { duration: 0.5 },
|
|
251
|
+
},
|
|
252
|
+
};
|
|
253
|
+
var modalVariants = {
|
|
254
|
+
hidden: { opacity: 0, y: "100vh" },
|
|
255
|
+
visible: { opacity: 1, y: 0, transition: { duration: 0.5, ease: [0.16, 1, 0.3, 1] } },
|
|
256
|
+
exit: { opacity: 0, y: "100vh", transition: { duration: 0.3, ease: "easeIn" } },
|
|
257
|
+
};
|
|
258
|
+
return (<div className="w-full">
|
|
259
|
+
<style jsx>{"\n :root {\n --jubilee: #F47C7C;\n --exuberant-blue: #FF54B4;\n --modern-purple: #D946EF;\n }\n\n .glassmorphism {\n background: rgba(255, 255, 255, 0.08);\n backdrop-filter: blur(10px);\n -webkit-backdrop-filter: blur(10px);\n border: 2px solid transparent;\n border-image: linear-gradient(45deg, var(--exuberant-blue), var(--jubilee), var(--modern-purple)) 1;\n box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);\n }\n\n .modal-glassmorphism {\n background: rgba(255, 255, 255, 0.08);\n backdrop-filter: blur(10px);\n -webkit-backdrop-filter: blur(10px);\n border: 2px solid transparent;\n border-image: linear-gradient(45deg, var(--exuberant-blue), var(--jubilee), var(--modern-purple)) 1;\n box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);\n border-radius: 2rem;\n max-height: 90vh;\n overflow: hidden;\n }\n\n @supports not (backdrop-filter: blur(10px)) {\n .glassmorphism {\n background: rgba(255, 255, 255, 0.2);\n }\n .modal-glassmorphism {\n background: rgba(255, 255, 255, 0.2);\n }\n }\n\n @media (max-width: 768px) {\n .glassmorphism {\n backdrop-filter: none;\n background: rgba(255, 255, 255, 0.2);\n }\n .modal-glassmorphism {\n padding: 1rem;\n max-height: 85vh;\n }\n }\n\n .motion-card {\n will-change: transform, opacity;\n }\n "}</style>
|
|
260
|
+
<motion.div variants={sectionVariants} initial="hidden" whileInView="visible" viewport={{ once: true }} className="p-4 sm:p-8 lg:p-12" ref={containerRef}>
|
|
261
|
+
<Tabs defaultValue="photos" className="w-full">
|
|
262
|
+
<TabsList className="grid w-full md:w-3/4 mx-auto grid-cols-2 mb-12 glassmorphism bg-[#1B2743] rounded-[2rem] p-4 h-24 border-0">
|
|
263
|
+
<TabsTrigger value="photos" className="rounded-[1.5rem] text-xl sm:text-2xl font-bold text-gray-200 data-[state=active]:text-white data-[state=active]:bg-blue-600/90 bg-blue-100/20 backdrop-blur-lg border border-white/10 shadow-md h-full flex items-center justify-center transition-all duration-300 content-text mr-2">
|
|
264
|
+
{GALLERY_SIMPLE.UI.PHOTOS_TAB}
|
|
265
|
+
</TabsTrigger>
|
|
266
|
+
<TabsTrigger value="videos" className="rounded-[1.5rem] text-xl sm:text-2xl font-bold text-gray-200 data-[state=active]:text-white data-[state=active]:bg-blue-600/90 bg-blue-100/20 backdrop-blur-lg border border-white/10 shadow-md h-full flex items-center justify-center transition-all duration-300 content-text ml-2">
|
|
267
|
+
{GALLERY_SIMPLE.UI.VIDEOS_TAB}
|
|
268
|
+
</TabsTrigger>
|
|
269
|
+
</TabsList>
|
|
270
|
+
|
|
271
|
+
<TabsContent value="photos">
|
|
272
|
+
<div className="space-y-6">
|
|
273
|
+
{error && (<p className="text-red-400 text-base sm:text-lg md:text-xl text-center">{error}</p>)}
|
|
274
|
+
{isAdmin && (<div className="flex justify-center pb-12">
|
|
275
|
+
<ActionButton onClick={function () { return setIsUploadModalOpen(true); }} className="flex items-center gap-2" disabled={isLoading}>
|
|
276
|
+
<Upload className="h-4 w-4 sm:h-5 sm:w-5"/>
|
|
277
|
+
{GALLERY_SIMPLE.BUTTONS.UPLOAD_IMAGE_BUTTON}
|
|
278
|
+
</ActionButton>
|
|
279
|
+
</div>)}
|
|
280
|
+
{uploadedImages.length > 0 ? (<>
|
|
281
|
+
<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 }}>
|
|
282
|
+
{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 motion-card">
|
|
283
|
+
<Card className="overflow-hidden glassmorphism rounded-[1.5rem] shadow-4xl p-2 sm:p-4 relative">
|
|
284
|
+
<div className="relative w-full aspect-[3/2]">
|
|
285
|
+
<Image src={image.url} alt={GALLERY_SIMPLE.UI.DEFAULT_IMAGE_ALT} fill className="object-cover object-center rounded-[1rem] transition-all duration-300" priority={index === 0} loading={index === 0 ? "eager" : "lazy"} quality={85}/>
|
|
286
|
+
</div>
|
|
287
|
+
{isAdmin && (<TrashIconButton onClick={function (e) {
|
|
288
|
+
e.stopPropagation();
|
|
289
|
+
openConfirmDelete(image.documentId);
|
|
290
|
+
}} aria-label={GALLERY_SIMPLE.UI.DELETE_BUTTON_ARIA.replace("${image.title || image.documentId}", image.title || image.documentId)}/>)}
|
|
291
|
+
</Card>
|
|
292
|
+
</motion.div>); })}
|
|
293
|
+
</motion.div>
|
|
294
|
+
{visiblePhotos < uploadedImages.length && (<div className="mt-8 text-center">
|
|
295
|
+
<ActionButton onClick={loadMore} className="flex items-center gap-2">
|
|
296
|
+
{GALLERY_SIMPLE.BUTTONS.LOAD_MORE_BUTTON}
|
|
297
|
+
</ActionButton>
|
|
298
|
+
</div>)}
|
|
299
|
+
</>) : (<p className="text-center text-gray-700 font-bold text-base sm:text-lg md:text-xl">
|
|
300
|
+
{GALLERY_SIMPLE.UI.NO_IMAGES_MESSAGE}
|
|
301
|
+
</p>)}
|
|
302
|
+
<div className="mt-4 text-center">
|
|
303
|
+
{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>)}
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
</TabsContent>
|
|
307
|
+
|
|
308
|
+
<TabsContent value="videos">
|
|
309
|
+
<motion.div className="grid md:grid-cols-2 lg:grid-cols-3 gap-2 sm:gap-4" style={{ y: isMobile ? 0 : parallaxY }}>
|
|
310
|
+
{videos.map(function (video, index) { return (<motion.div key={index} variants={cardVariants} initial="hidden" whileInView="visible" viewport={{ once: true, amount: 0.2 }} className="motion-card">
|
|
311
|
+
<Card className="overflow-hidden glassmorphism rounded-[1.5rem] shadow-4xl p-4">
|
|
312
|
+
<div className="relative w-full aspect-[16/9]">
|
|
313
|
+
<iframe width="100%" height="100%" src={video.url} title={video.title} allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen className="border-0 rounded-[1rem]" loading="lazy"/>
|
|
314
|
+
</div>
|
|
315
|
+
<p className="text-gray-700 text-xl sm:text-2xl font-bold mt-4 text-center drop-shadow-md content-text">
|
|
316
|
+
{video.title}
|
|
317
|
+
</p>
|
|
318
|
+
</Card>
|
|
319
|
+
</motion.div>); })}
|
|
320
|
+
</motion.div>
|
|
321
|
+
</TabsContent>
|
|
322
|
+
</Tabs>
|
|
323
|
+
</motion.div>
|
|
324
|
+
|
|
325
|
+
{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-4 isolate" onClick={handleCloseModal} role="dialog" aria-modal="true" aria-labelledby="modal-image">
|
|
326
|
+
<div className="relative max-w-5xl w-full mx-4 p-6 bg-gray-800/50 border border-gray-700/50 rounded-lg shadow-lg max-h-[90vh] overflow-y-auto" onClick={function (e) { return e.stopPropagation(); }}>
|
|
327
|
+
<CloseButton variant="close-form" onClick={handleCloseModal}>
|
|
328
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8"/>
|
|
329
|
+
</CloseButton>
|
|
330
|
+
<div className="relative w-full h-[80vh]">
|
|
331
|
+
<Image src={selectedImage.url} alt={GALLERY_SIMPLE.UI.DEFAULT_IMAGE_ALT} fill className="object-contain rounded-lg" quality={85}/>
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
</motion.div>)}
|
|
335
|
+
|
|
336
|
+
{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">
|
|
337
|
+
<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" onClick={function (e) { return e.stopPropagation(); }}>
|
|
338
|
+
<CloseButton onClick={handleCancelDelete}>
|
|
339
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8"/>
|
|
340
|
+
</CloseButton>
|
|
341
|
+
<h3 id="modal-title" className="text-xl font-bold text-white mb-4">
|
|
342
|
+
{GALLERY_SIMPLE.UI.DELETE_MODAL_HEADING}
|
|
343
|
+
</h3>
|
|
344
|
+
<p className="text-gray-300 text-sm mb-4">
|
|
345
|
+
{GALLERY_SIMPLE.UI.DELETE_CONFIRMATION_MESSAGE}
|
|
346
|
+
</p>
|
|
347
|
+
<div className="flex space-x-3">
|
|
348
|
+
<DeleteButton onClick={handleConfirmDelete} disabled={isLoading}>
|
|
349
|
+
{isLoading ? GALLERY_SIMPLE.BUTTONS.DELETING_BUTTON : GALLERY_SIMPLE.BUTTONS.DELETE_BUTTON}
|
|
350
|
+
</DeleteButton>
|
|
351
|
+
<CancelButton onClick={handleCancelDelete}/>
|
|
352
|
+
</div>
|
|
353
|
+
</div>
|
|
354
|
+
</motion.div>)}
|
|
355
|
+
|
|
356
|
+
{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">
|
|
357
|
+
<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" onClick={function (e) { return e.stopPropagation(); }}>
|
|
358
|
+
<CloseButton onClick={handleCloseUploadModal}>
|
|
359
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8"/>
|
|
360
|
+
</CloseButton>
|
|
361
|
+
<h3 id="upload-modal-title" className="text-xl font-bold text-white mb-4">
|
|
362
|
+
{GALLERY_SIMPLE.UI.UPLOAD_MODAL_HEADING}
|
|
363
|
+
</h3>
|
|
364
|
+
<form onSubmit={handleUploadSubmit} className="flex flex-col space-y-4">
|
|
365
|
+
<input type="file" accept="image/jpeg,image/png,image/gif" onChange={function (e) {
|
|
366
|
+
var _a;
|
|
367
|
+
setSelectedFile(((_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0]) || null);
|
|
368
|
+
}} disabled={isLoading} className="hidden" id="image-upload"/>
|
|
369
|
+
<label htmlFor="image-upload" className="cursor-pointer">
|
|
370
|
+
<div className="flex items-center justify-between bg-gray-700 text-white px-4 py-2 rounded-lg">
|
|
371
|
+
<span>{selectedFile ? selectedFile.name : GALLERY_SIMPLE.UI.CHOOSE_IMAGE_TEXT}</span>
|
|
372
|
+
<Upload className="h-4 w-4"/>
|
|
373
|
+
</div>
|
|
374
|
+
</label>
|
|
375
|
+
<div className="flex space-x-3">
|
|
376
|
+
<SubmitButton type="submit" disabled={isLoading || !selectedFile}>
|
|
377
|
+
{isLoading ? GALLERY_SIMPLE.BUTTONS.UPLOADING_BUTTON : GALLERY_SIMPLE.BUTTONS.UPLOAD_BUTTON}
|
|
378
|
+
</SubmitButton>
|
|
379
|
+
<CancelButton onClick={handleCloseUploadModal}/>
|
|
380
|
+
</div>
|
|
381
|
+
</form>
|
|
382
|
+
</div>
|
|
383
|
+
</motion.div>)}
|
|
384
|
+
</div>);
|
|
385
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
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 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
|
+
// Video titles for video cards
|
|
49
|
+
VIDEO_TITLES: [
|
|
50
|
+
"Race for the Cure 2019",
|
|
51
|
+
"Race for the Cure 2017",
|
|
52
|
+
"Race for the Cure 2016",
|
|
53
|
+
"Race for the Cure 2015",
|
|
54
|
+
"Race for the Cure 2014",
|
|
55
|
+
"Race for the Cure 2013",
|
|
56
|
+
"Absolutely Abs, Part 1",
|
|
57
|
+
"Absolutely Abs, Part 2",
|
|
58
|
+
"Absolutely Abs, Part 3",
|
|
59
|
+
"Absolutely Abs, Part 4",
|
|
60
|
+
"Absolutely Abs, Part 5",
|
|
61
|
+
"Fitstop Introduction",
|
|
62
|
+
"Fitstop 2: Choosing a personal trainer",
|
|
63
|
+
"Fitstop 3: Help at the office for Trapezius Injuries",
|
|
64
|
+
"Race for the Cure warmup",
|
|
65
|
+
"Camp Caiello",
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
// Button Text for GalleryComplex
|
|
69
|
+
BUTTONS: {
|
|
70
|
+
// ActionButton text for opening upload modal
|
|
71
|
+
UPLOAD_IMAGE_BUTTON: "Upload Image",
|
|
72
|
+
// ActionButton text for loading more images
|
|
73
|
+
LOAD_MORE_BUTTON: "Load More",
|
|
74
|
+
// DeleteButton text when loading
|
|
75
|
+
DELETING_BUTTON: "Deleting...",
|
|
76
|
+
// DeleteButton text
|
|
77
|
+
DELETE_BUTTON: "Delete",
|
|
78
|
+
// SubmitButton text when loading in upload form
|
|
79
|
+
UPLOADING_BUTTON: "Uploading...",
|
|
80
|
+
// SubmitButton text in upload form
|
|
81
|
+
UPLOAD_BUTTON: "Upload",
|
|
82
|
+
// SubmitButton text when loading in edit form
|
|
83
|
+
SAVING_BUTTON: "Saving...",
|
|
84
|
+
// SubmitButton text in edit form
|
|
85
|
+
SAVE_BUTTON: "Save",
|
|
86
|
+
},
|
|
87
|
+
// Error Messages for GalleryComplex
|
|
88
|
+
ERRORS: {
|
|
89
|
+
// Error when non-admin tries to delete
|
|
90
|
+
UNAUTHORIZED_DELETE: "Unauthorized: Only admins can delete images",
|
|
91
|
+
// Error when non-admin tries to edit
|
|
92
|
+
UNAUTHORIZED_EDIT: "Unauthorized: Only admins can edit images",
|
|
93
|
+
// Error when token is missing or invalid
|
|
94
|
+
AUTHENTICATION_ERROR: "Authentication error. Please log in again.",
|
|
95
|
+
// Error when edit fails with status code
|
|
96
|
+
EDIT_FAILED_STATUS: "Failed to update image: ${response.status}",
|
|
97
|
+
// Generic error when edit fails
|
|
98
|
+
EDIT_FAILED: "Failed to update image",
|
|
99
|
+
// Error when non-admin tries to upload
|
|
100
|
+
UNAUTHORIZED_UPLOAD: "Unauthorized: Only admins can upload images",
|
|
101
|
+
// Error when upload fails
|
|
102
|
+
UPLOAD_FAILED: "Failed to upload image",
|
|
103
|
+
},
|
|
104
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
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 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
|
+
// Video titles for video cards
|
|
29
|
+
VIDEO_TITLES: [
|
|
30
|
+
"Race for the Cure 2019",
|
|
31
|
+
"Race for the Cure 2017",
|
|
32
|
+
"Race for the Cure 2016",
|
|
33
|
+
"Race for the Cure 2015",
|
|
34
|
+
"Race for the Cure 2014",
|
|
35
|
+
"Race for the Cure 2013",
|
|
36
|
+
"Absolutely Abs, Part 1",
|
|
37
|
+
"Absolutely Abs, Part 2",
|
|
38
|
+
"Absolutely Abs, Part 3",
|
|
39
|
+
"Absolutely Abs, Part 4",
|
|
40
|
+
"Absolutely Abs, Part 5",
|
|
41
|
+
"Fitstop Introduction",
|
|
42
|
+
"Fitstop 2: Choosing a personal trainer",
|
|
43
|
+
"Fitstop 3: Help at the office for Trapezius Injuries",
|
|
44
|
+
"Race for the Cure warmup",
|
|
45
|
+
"Camp Caiello",
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
// Button Text for GallerySimple
|
|
49
|
+
BUTTONS: {
|
|
50
|
+
// ActionButton text for opening upload modal
|
|
51
|
+
UPLOAD_IMAGE_BUTTON: "Upload Image",
|
|
52
|
+
// ActionButton text for loading more images
|
|
53
|
+
LOAD_MORE_BUTTON: "Load More",
|
|
54
|
+
// DeleteButton text when loading
|
|
55
|
+
DELETING_BUTTON: "Deleting...",
|
|
56
|
+
// DeleteButton text
|
|
57
|
+
DELETE_BUTTON: "Delete",
|
|
58
|
+
// SubmitButton text when loading
|
|
59
|
+
UPLOADING_BUTTON: "Uploading...",
|
|
60
|
+
// SubmitButton text
|
|
61
|
+
UPLOAD_BUTTON: "Upload",
|
|
62
|
+
},
|
|
63
|
+
// Error Messages for GallerySimple
|
|
64
|
+
ERRORS: {
|
|
65
|
+
// Error when non-admin tries to delete
|
|
66
|
+
UNAUTHORIZED_DELETE: "Unauthorized: Only admins can delete images",
|
|
67
|
+
// Error when no file is selected
|
|
68
|
+
INVALID_FILE: "Please select a valid image file",
|
|
69
|
+
// Error when non-admin tries to upload
|
|
70
|
+
UNAUTHORIZED_UPLOAD: "Unauthorized: Only admins can upload images",
|
|
71
|
+
// Error when upload fails
|
|
72
|
+
UPLOAD_FAILED: "Failed to upload image",
|
|
73
|
+
},
|
|
74
|
+
};
|