@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,586 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
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;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
import { useState, useRef, useEffect } from "react";
|
|
50
|
+
import { Card } from "@/components/other/card";
|
|
51
|
+
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/other/tabs";
|
|
52
|
+
import { motion, useScroll, useTransform } from "framer-motion";
|
|
53
|
+
import Image from "next/image";
|
|
54
|
+
import { ActionButton, EditIconButton, TrashIconButton, CloseButton, SubmitButton, CancelButton, FilterButton, DeleteButton } from "@/components/other/button";
|
|
55
|
+
import { Upload, X } from "lucide-react";
|
|
56
|
+
import { useUser, useAuth } from "@clerk/nextjs";
|
|
57
|
+
import { useStrapiAuth } from "@/lib/auth-context";
|
|
58
|
+
import { GALLERY_COMPLEX } from "./constants/galleryComplex";
|
|
59
|
+
import { ImageDescCarousel } from "../ImageDescCarousel";
|
|
60
|
+
export function GallerySection(_a) {
|
|
61
|
+
var _this = this;
|
|
62
|
+
var _b, _c, _d, _e, _f;
|
|
63
|
+
var user = _a.user, setUser = _a.setUser, authLoading = _a.authLoading, uploadedImages = _a.uploadedImages, setUploadedImages = _a.setUploadedImages, error = _a.error, setError = _a.setError, isLoading = _a.isLoading, setIsLoading = _a.setIsLoading, handleImageUpload = _a.handleImageUpload, handleDeleteImage = _a.handleDeleteImage;
|
|
64
|
+
var isSignedIn = useUser().isSignedIn;
|
|
65
|
+
var getToken = useAuth().getToken;
|
|
66
|
+
var checkSession = useStrapiAuth().checkSession;
|
|
67
|
+
var isAdmin = isSignedIn && !!(user === null || user === void 0 ? void 0 : user.businessAdminId) || false;
|
|
68
|
+
var _g = useState("photos"), activeTab = _g[0], setActiveTab = _g[1];
|
|
69
|
+
var _h = useState("all"), activeSubTab = _h[0], setActiveSubTab = _h[1];
|
|
70
|
+
var _j = useState(null), selectedImage = _j[0], setSelectedImage = _j[1];
|
|
71
|
+
var _k = useState(false), isMobile = _k[0], setIsMobile = _k[1];
|
|
72
|
+
var _l = useState(12), visiblePhotos = _l[0], setVisiblePhotos = _l[1];
|
|
73
|
+
var _m = useState(false), isConfirmDeleteOpen = _m[0], setIsConfirmDeleteOpen = _m[1];
|
|
74
|
+
var _o = useState(null), documentIdToDelete = _o[0], setDocumentIdToDelete = _o[1];
|
|
75
|
+
var _p = useState(false), isEditModalOpen = _p[0], setIsEditModalOpen = _p[1];
|
|
76
|
+
var _q = useState(false), isUploadModalOpen = _q[0], setIsUploadModalOpen = _q[1];
|
|
77
|
+
var _r = useState({ id: 0, documentId: "", title: "", description: "", category: "none" }), editForm = _r[0], setEditForm = _r[1];
|
|
78
|
+
var _s = useState({ file: null, title: "", description: "", category: "none" }), uploadForm = _s[0], setUploadForm = _s[1];
|
|
79
|
+
var containerRef = useRef(null);
|
|
80
|
+
var scrollYProgress = useScroll({
|
|
81
|
+
target: containerRef,
|
|
82
|
+
offset: ["start end", "end start"],
|
|
83
|
+
}).scrollYProgress;
|
|
84
|
+
var parallaxY = useTransform(scrollYProgress, [0, 1], [0, -50]);
|
|
85
|
+
var videos = GALLERY_COMPLEX.UI.VIDEO_TITLES.map(function (title, index) { return ({
|
|
86
|
+
url: [
|
|
87
|
+
"https://www.youtube.com/embed/Ch5fnKgDZH8",
|
|
88
|
+
"https://www.youtube.com/embed/XW3zDzMZNv8",
|
|
89
|
+
"https://www.youtube.com/embed/odC_X6g1uFs",
|
|
90
|
+
"https://www.youtube.com/embed/DFuBBzMi6ZA",
|
|
91
|
+
"https://www.youtube.com/embed/zZNMJyMmcFQ",
|
|
92
|
+
"https://www.youtube.com/embed/VRpbsZGU4a0",
|
|
93
|
+
"https://www.youtube.com/embed/qE14UbB3-gs",
|
|
94
|
+
"https://www.youtube.com/embed/QoVE5TqMkvU",
|
|
95
|
+
"https://www.youtube.com/embed/7Fzgw0SK-8k",
|
|
96
|
+
"https://www.youtube.com/embed/wN0j6JoliAE",
|
|
97
|
+
"https://www.youtube.com/embed/vzFZzhB8KvA",
|
|
98
|
+
"https://www.youtube.com/embed/4thuylOfM9w",
|
|
99
|
+
"https://www.youtube.com/embed/sm3l_uPtaws",
|
|
100
|
+
"https://www.youtube.com/embed/xnnlanydT5I",
|
|
101
|
+
"https://www.youtube.com/embed/jLLePKwiFpI",
|
|
102
|
+
"https://www.youtube.com/embed/pBlpMq8JbIA",
|
|
103
|
+
][index],
|
|
104
|
+
title: title,
|
|
105
|
+
}); });
|
|
106
|
+
var filteredImages = activeTab === "photos"
|
|
107
|
+
? activeSubTab === "all"
|
|
108
|
+
? uploadedImages
|
|
109
|
+
: uploadedImages.filter(function (img) { return (img.category || "none") === activeSubTab; })
|
|
110
|
+
: uploadedImages.filter(function (img) { return (img.category || "none") === activeTab; });
|
|
111
|
+
useEffect(function () {
|
|
112
|
+
var handleLogin = function () { return checkSession(); };
|
|
113
|
+
var handleLogout = function () { return checkSession(); };
|
|
114
|
+
window.addEventListener("user-login", handleLogin);
|
|
115
|
+
window.addEventListener("user-logout", handleLogout);
|
|
116
|
+
return function () {
|
|
117
|
+
window.removeEventListener("user-login", handleLogin);
|
|
118
|
+
window.removeEventListener("user-logout", handleLogout);
|
|
119
|
+
};
|
|
120
|
+
}, [checkSession]);
|
|
121
|
+
useEffect(function () {
|
|
122
|
+
var checkMobile = function () { return setIsMobile(window.innerWidth < 768); };
|
|
123
|
+
checkMobile();
|
|
124
|
+
window.addEventListener("resize", checkMobile);
|
|
125
|
+
return function () { return window.removeEventListener("resize", checkMobile); };
|
|
126
|
+
}, []);
|
|
127
|
+
useEffect(function () {
|
|
128
|
+
if (selectedImage || isConfirmDeleteOpen || isEditModalOpen || isUploadModalOpen) {
|
|
129
|
+
document.body.classList.add("overflow-hidden");
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
document.body.classList.remove("overflow-hidden");
|
|
133
|
+
}
|
|
134
|
+
return function () {
|
|
135
|
+
document.body.classList.remove("overflow-hidden");
|
|
136
|
+
};
|
|
137
|
+
}, [selectedImage, isConfirmDeleteOpen, isEditModalOpen, isUploadModalOpen]);
|
|
138
|
+
useEffect(function () {
|
|
139
|
+
var event = new CustomEvent("modalStateChange", {
|
|
140
|
+
detail: { isOpen: !!selectedImage || isConfirmDeleteOpen || isEditModalOpen || isUploadModalOpen },
|
|
141
|
+
});
|
|
142
|
+
window.dispatchEvent(event);
|
|
143
|
+
}, [selectedImage, isConfirmDeleteOpen, isEditModalOpen, isUploadModalOpen]);
|
|
144
|
+
useEffect(function () {
|
|
145
|
+
var handleEsc = function (e) {
|
|
146
|
+
if (e.key === "Escape") {
|
|
147
|
+
if (isConfirmDeleteOpen) {
|
|
148
|
+
handleCancelDelete();
|
|
149
|
+
}
|
|
150
|
+
else if (selectedImage) {
|
|
151
|
+
handleCloseModal();
|
|
152
|
+
}
|
|
153
|
+
else if (isEditModalOpen) {
|
|
154
|
+
handleCloseEditModal();
|
|
155
|
+
}
|
|
156
|
+
else if (isUploadModalOpen) {
|
|
157
|
+
handleCloseUploadModal();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
window.addEventListener("keydown", handleEsc);
|
|
162
|
+
return function () { return window.removeEventListener("keydown", handleEsc); };
|
|
163
|
+
}, [isConfirmDeleteOpen, selectedImage, isEditModalOpen, isUploadModalOpen]);
|
|
164
|
+
var openConfirmDelete = function (documentId) {
|
|
165
|
+
if (!isAdmin) {
|
|
166
|
+
setError(GALLERY_COMPLEX.ERRORS.UNAUTHORIZED_DELETE);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
setDocumentIdToDelete(documentId);
|
|
170
|
+
setIsConfirmDeleteOpen(true);
|
|
171
|
+
};
|
|
172
|
+
var handleConfirmDelete = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
173
|
+
return __generator(this, function (_a) {
|
|
174
|
+
switch (_a.label) {
|
|
175
|
+
case 0:
|
|
176
|
+
if (!isAdmin) {
|
|
177
|
+
setError(GALLERY_COMPLEX.ERRORS.UNAUTHORIZED_DELETE);
|
|
178
|
+
setIsConfirmDeleteOpen(false);
|
|
179
|
+
return [2 /*return*/];
|
|
180
|
+
}
|
|
181
|
+
if (!(documentIdToDelete !== null)) return [3 /*break*/, 4];
|
|
182
|
+
setIsLoading(true);
|
|
183
|
+
_a.label = 1;
|
|
184
|
+
case 1:
|
|
185
|
+
_a.trys.push([1, , 3, 4]);
|
|
186
|
+
return [4 /*yield*/, handleDeleteImage(documentIdToDelete)];
|
|
187
|
+
case 2:
|
|
188
|
+
_a.sent();
|
|
189
|
+
return [3 /*break*/, 4];
|
|
190
|
+
case 3:
|
|
191
|
+
setIsLoading(false);
|
|
192
|
+
setIsConfirmDeleteOpen(false);
|
|
193
|
+
setDocumentIdToDelete(null);
|
|
194
|
+
return [7 /*endfinally*/];
|
|
195
|
+
case 4: return [2 /*return*/];
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}); };
|
|
199
|
+
var handleCancelDelete = function () {
|
|
200
|
+
setIsConfirmDeleteOpen(false);
|
|
201
|
+
setDocumentIdToDelete(null);
|
|
202
|
+
};
|
|
203
|
+
var handleImageClick = function (image) {
|
|
204
|
+
setSelectedImage(image);
|
|
205
|
+
};
|
|
206
|
+
var handleCloseModal = function () {
|
|
207
|
+
setSelectedImage(null);
|
|
208
|
+
};
|
|
209
|
+
var openEditModal = function (image) {
|
|
210
|
+
var _a;
|
|
211
|
+
if (!isAdmin) {
|
|
212
|
+
setError(GALLERY_COMPLEX.ERRORS.UNAUTHORIZED_EDIT);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
setEditForm({
|
|
216
|
+
id: image.id,
|
|
217
|
+
documentId: image.documentId,
|
|
218
|
+
title: ((_a = image.title) === null || _a === void 0 ? void 0 : _a.trim()) && !image.title.match(/Image \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/) ? image.title : "",
|
|
219
|
+
description: image.description || "",
|
|
220
|
+
category: image.category || "none",
|
|
221
|
+
});
|
|
222
|
+
setIsEditModalOpen(true);
|
|
223
|
+
};
|
|
224
|
+
var handleCloseEditModal = function () {
|
|
225
|
+
setIsEditModalOpen(false);
|
|
226
|
+
setEditForm({ id: 0, documentId: "", title: "", description: "", category: "none" });
|
|
227
|
+
};
|
|
228
|
+
var handleCloseUploadModal = function () {
|
|
229
|
+
setIsUploadModalOpen(false);
|
|
230
|
+
setUploadForm({ file: null, title: "", description: "", category: "none" });
|
|
231
|
+
};
|
|
232
|
+
var handleEditImage = function (e) { return __awaiter(_this, void 0, void 0, function () {
|
|
233
|
+
var token, payload, response, errorData, data, err_1;
|
|
234
|
+
return __generator(this, function (_a) {
|
|
235
|
+
switch (_a.label) {
|
|
236
|
+
case 0:
|
|
237
|
+
e.preventDefault();
|
|
238
|
+
if (!isAdmin) {
|
|
239
|
+
console.error("GallerySection: Unauthorized edit attempt", {
|
|
240
|
+
isSignedIn: isSignedIn,
|
|
241
|
+
businessAdminId: user === null || user === void 0 ? void 0 : user.businessAdminId,
|
|
242
|
+
});
|
|
243
|
+
setError(GALLERY_COMPLEX.ERRORS.UNAUTHORIZED_EDIT);
|
|
244
|
+
return [2 /*return*/];
|
|
245
|
+
}
|
|
246
|
+
_a.label = 1;
|
|
247
|
+
case 1:
|
|
248
|
+
_a.trys.push([1, 7, 8, 9]);
|
|
249
|
+
setIsLoading(true);
|
|
250
|
+
return [4 /*yield*/, getToken()];
|
|
251
|
+
case 2:
|
|
252
|
+
token = _a.sent();
|
|
253
|
+
if (!token) {
|
|
254
|
+
console.error("GallerySection: No authentication token available");
|
|
255
|
+
setError(GALLERY_COMPLEX.ERRORS.AUTHENTICATION_ERROR);
|
|
256
|
+
setUser(null);
|
|
257
|
+
return [2 /*return*/];
|
|
258
|
+
}
|
|
259
|
+
payload = {
|
|
260
|
+
documentId: editForm.documentId,
|
|
261
|
+
title: editForm.title || "Image ".concat(new Date().toISOString()),
|
|
262
|
+
description: editForm.description || "",
|
|
263
|
+
category: editForm.category || "none",
|
|
264
|
+
};
|
|
265
|
+
return [4 /*yield*/, fetch("/api/gallery-data", {
|
|
266
|
+
method: "PUT",
|
|
267
|
+
headers: {
|
|
268
|
+
"Content-Type": "application/json",
|
|
269
|
+
Authorization: "Bearer ".concat(token),
|
|
270
|
+
},
|
|
271
|
+
body: JSON.stringify(payload),
|
|
272
|
+
})];
|
|
273
|
+
case 3:
|
|
274
|
+
response = _a.sent();
|
|
275
|
+
if (!!response.ok) return [3 /*break*/, 5];
|
|
276
|
+
return [4 /*yield*/, response.json()];
|
|
277
|
+
case 4:
|
|
278
|
+
errorData = _a.sent();
|
|
279
|
+
console.error("GallerySection: Edit failed", { status: response.status, errorData: errorData });
|
|
280
|
+
if (response.status === 401) {
|
|
281
|
+
setError(GALLERY_COMPLEX.ERRORS.AUTHENTICATION_ERROR);
|
|
282
|
+
setUser(null);
|
|
283
|
+
return [2 /*return*/];
|
|
284
|
+
}
|
|
285
|
+
throw new Error(errorData.error || GALLERY_COMPLEX.ERRORS.EDIT_FAILED_STATUS.replace("${response.status}", response.status.toString()));
|
|
286
|
+
case 5: return [4 /*yield*/, response.json()];
|
|
287
|
+
case 6:
|
|
288
|
+
data = (_a.sent()).data;
|
|
289
|
+
setUploadedImages(data || []);
|
|
290
|
+
setError(null);
|
|
291
|
+
setIsEditModalOpen(false);
|
|
292
|
+
setEditForm({ id: 0, documentId: "", title: "", description: "", category: "none" });
|
|
293
|
+
return [3 /*break*/, 9];
|
|
294
|
+
case 7:
|
|
295
|
+
err_1 = _a.sent();
|
|
296
|
+
console.error("GallerySection: Edit Error", err_1);
|
|
297
|
+
setError(err_1 instanceof Error ? err_1.message : GALLERY_COMPLEX.ERRORS.EDIT_FAILED);
|
|
298
|
+
return [3 /*break*/, 9];
|
|
299
|
+
case 8:
|
|
300
|
+
setIsLoading(false);
|
|
301
|
+
return [7 /*endfinally*/];
|
|
302
|
+
case 9: return [2 /*return*/];
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
}); };
|
|
306
|
+
var handleUploadSubmit = function (e) { return __awaiter(_this, void 0, void 0, function () {
|
|
307
|
+
var err_2;
|
|
308
|
+
return __generator(this, function (_a) {
|
|
309
|
+
switch (_a.label) {
|
|
310
|
+
case 0:
|
|
311
|
+
e.preventDefault();
|
|
312
|
+
if (!isAdmin) {
|
|
313
|
+
console.error("GallerySection: Unauthorized upload attempt", {
|
|
314
|
+
isSignedIn: isSignedIn,
|
|
315
|
+
businessAdminId: user === null || user === void 0 ? void 0 : user.businessAdminId,
|
|
316
|
+
});
|
|
317
|
+
setError(GALLERY_COMPLEX.ERRORS.UNAUTHORIZED_UPLOAD);
|
|
318
|
+
return [2 /*return*/];
|
|
319
|
+
}
|
|
320
|
+
setIsLoading(true);
|
|
321
|
+
_a.label = 1;
|
|
322
|
+
case 1:
|
|
323
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
324
|
+
return [4 /*yield*/, handleImageUpload(e, uploadForm.file, uploadForm.title, uploadForm.description, uploadForm.category || "none")];
|
|
325
|
+
case 2:
|
|
326
|
+
_a.sent();
|
|
327
|
+
setUploadForm({ file: null, title: "", description: "", category: "none" });
|
|
328
|
+
setIsUploadModalOpen(false);
|
|
329
|
+
return [3 /*break*/, 5];
|
|
330
|
+
case 3:
|
|
331
|
+
err_2 = _a.sent();
|
|
332
|
+
console.error("GallerySection: Upload Error", err_2);
|
|
333
|
+
setError(err_2 instanceof Error ? err_2.message : GALLERY_COMPLEX.ERRORS.UPLOAD_FAILED);
|
|
334
|
+
return [3 /*break*/, 5];
|
|
335
|
+
case 4:
|
|
336
|
+
setIsLoading(false);
|
|
337
|
+
return [7 /*endfinally*/];
|
|
338
|
+
case 5: return [2 /*return*/];
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
}); };
|
|
342
|
+
var loadMore = function () {
|
|
343
|
+
setVisiblePhotos(function (prev) { return prev + 12; });
|
|
344
|
+
};
|
|
345
|
+
var sectionVariants = {
|
|
346
|
+
hidden: { opacity: 0 },
|
|
347
|
+
visible: {
|
|
348
|
+
opacity: 1,
|
|
349
|
+
transition: { duration: 0.8, ease: [0.16, 1, 0.3, 1], staggerChildren: 0.1 },
|
|
350
|
+
},
|
|
351
|
+
};
|
|
352
|
+
var cardVariants = {
|
|
353
|
+
hidden: { opacity: 0, y: 30 },
|
|
354
|
+
visible: {
|
|
355
|
+
opacity: 1,
|
|
356
|
+
y: 0,
|
|
357
|
+
transition: { duration: 0.5 },
|
|
358
|
+
},
|
|
359
|
+
};
|
|
360
|
+
var modalVariants = {
|
|
361
|
+
hidden: { opacity: 0, y: "100vh" },
|
|
362
|
+
visible: { opacity: 1, y: 0, transition: { duration: 0.5, ease: [0.16, 1, 0.3, 1] } },
|
|
363
|
+
exit: { opacity: 0, y: "100vh", transition: { duration: 0.3, ease: "easeIn" } },
|
|
364
|
+
};
|
|
365
|
+
return (<div className="w-full">
|
|
366
|
+
<style jsx>{"\n :root {\n --jubilee: #F47C7C;\n --exuberant-blue: #FF69B4;\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>
|
|
367
|
+
<motion.div variants={sectionVariants} initial="hidden" whileInView="visible" viewport={{ once: true }} className="p-4 sm:p-8 lg:p-12" ref={containerRef}>
|
|
368
|
+
<Tabs defaultValue="photos" className="w-full" onValueChange={function (value) { return setActiveTab(value); }}>
|
|
369
|
+
<TabsList className="grid w-full md:w-3/4 mx-auto grid-cols-2 mb-12 glassmorphism bg-black/10 rounded-[2rem] p-4 h-24 border-0">
|
|
370
|
+
{["photos", "videos"].map(function (tab) { return (<TabsTrigger key={tab} value={tab} className="rounded-[1.5rem] 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 content-text">
|
|
371
|
+
{tab === "photos" ? GALLERY_COMPLEX.UI.PHOTOS_TAB : GALLERY_COMPLEX.UI.VIDEOS_TAB}
|
|
372
|
+
</TabsTrigger>); })}
|
|
373
|
+
</TabsList>
|
|
374
|
+
{/* Replace the existing photos tab content with ImageDescCarousel */}
|
|
375
|
+
<ImageDescCarousel user={user} uploadedImages={filteredImages} setUploadedImages={setUploadedImages} error={error} setError={setError} isLoading={isLoading} setIsLoading={setIsLoading} handleImageUpload={handleImageUpload} handleDeleteImage={handleDeleteImage}/>
|
|
376
|
+
<TabsContent value="photos">
|
|
377
|
+
<Tabs defaultValue="all" onValueChange={function (value) { return setActiveSubTab(value); }}>
|
|
378
|
+
{isMobile ? (<div className="flex justify-center mb-6 max-w-2xl mx-auto">
|
|
379
|
+
<select value={activeSubTab} onChange={function (e) { return setActiveSubTab(e.target.value); }} className="px-4 py-2 text-base font-medium text-gray-600 bg-white rounded-md border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 w-full max-w-xs">
|
|
380
|
+
{["all", "indoor", "outdoor", "commercial"].map(function (subTab) { return (<option key={subTab} value={subTab}>
|
|
381
|
+
{subTab === "all" ? GALLERY_COMPLEX.UI.ALL_SUB_TAB :
|
|
382
|
+
subTab === "indoor" ? GALLERY_COMPLEX.UI.INDOOR_SUB_TAB :
|
|
383
|
+
subTab === "outdoor" ? GALLERY_COMPLEX.UI.OUTDOOR_SUB_TAB :
|
|
384
|
+
GALLERY_COMPLEX.UI.COMMERCIAL_SUB_TAB}
|
|
385
|
+
</option>); })}
|
|
386
|
+
</select>
|
|
387
|
+
</div>) : (<div className="flex justify-center gap-4 mb-12 max-w-2xl mx-auto">
|
|
388
|
+
{["all", "indoor", "outdoor", "commercial"].map(function (subTab) { return (<FilterButton key={subTab} isActive={activeSubTab === subTab} useBlueActive={true} onClick={function () { return setActiveSubTab(subTab); }}>
|
|
389
|
+
{subTab === "all" ? GALLERY_COMPLEX.UI.ALL_SUB_TAB :
|
|
390
|
+
subTab === "indoor" ? GALLERY_COMPLEX.UI.INDOOR_SUB_TAB :
|
|
391
|
+
subTab === "outdoor" ? GALLERY_COMPLEX.UI.OUTDOOR_SUB_TAB :
|
|
392
|
+
GALLERY_COMPLEX.UI.COMMERCIAL_SUB_TAB}
|
|
393
|
+
</FilterButton>); })}
|
|
394
|
+
</div>)}
|
|
395
|
+
|
|
396
|
+
{["all", "indoor", "outdoor", "commercial"].map(function (subTab) { return (<TabsContent key={subTab} value={subTab}>
|
|
397
|
+
<div className="space-y-6">
|
|
398
|
+
{error && (<p className="text-red-400 text-base sm:text-lg md:text-xl text-center">{error}</p>)}
|
|
399
|
+
{isAdmin && (<div className="flex justify-center pb-12">
|
|
400
|
+
<ActionButton onClick={function () { return setIsUploadModalOpen(true); }} className="flex items-center gap-2" disabled={isLoading}>
|
|
401
|
+
<Upload className="h-4 w-4 sm:h-5 sm:w-5"/>
|
|
402
|
+
{GALLERY_COMPLEX.BUTTONS.UPLOAD_IMAGE_BUTTON}
|
|
403
|
+
</ActionButton>
|
|
404
|
+
</div>)}
|
|
405
|
+
{filteredImages.length > 0 ? (<>
|
|
406
|
+
<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 }}>
|
|
407
|
+
{filteredImages.slice(0, visiblePhotos).map(function (image, index) {
|
|
408
|
+
var _a, _b, _c, _d, _e;
|
|
409
|
+
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">
|
|
410
|
+
<Card className="overflow-hidden glassmorphism rounded-[1.5rem] shadow-4xl p-2 sm:p-4 relative">
|
|
411
|
+
<div className="relative w-full aspect-[3/2]">
|
|
412
|
+
<Image src={image.url} alt={((_a = image.title) === null || _a === void 0 ? void 0 : _a.trim()) &&
|
|
413
|
+
!image.title.match(/Image \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/)
|
|
414
|
+
? image.title
|
|
415
|
+
: GALLERY_COMPLEX.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}/>
|
|
416
|
+
</div>
|
|
417
|
+
{isAdmin && (<div className="absolute top-2 right-2 flex space-x-2">
|
|
418
|
+
<EditIconButton onClick={function (e) {
|
|
419
|
+
e.stopPropagation();
|
|
420
|
+
openEditModal(image);
|
|
421
|
+
}}/>
|
|
422
|
+
<TrashIconButton onClick={function (e) {
|
|
423
|
+
e.stopPropagation();
|
|
424
|
+
openConfirmDelete(image.documentId);
|
|
425
|
+
}}/>
|
|
426
|
+
</div>)}
|
|
427
|
+
{(((_b = image.title) === null || _b === void 0 ? void 0 : _b.trim()) &&
|
|
428
|
+
!image.title.match(/Image \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/) ||
|
|
429
|
+
((_c = image.description) === null || _c === void 0 ? void 0 : _c.trim())) && (<div className="p-4">
|
|
430
|
+
{((_d = image.title) === null || _d === void 0 ? void 0 : _d.trim()) &&
|
|
431
|
+
!image.title.match(/Image \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/) && (<h3 className="text-lg font-semibold text-gray-700">{image.title}</h3>)}
|
|
432
|
+
{((_e = image.description) === null || _e === void 0 ? void 0 : _e.trim()) && (<p className="text-sm text-gray-600 line-clamp-2">{image.description}</p>)}
|
|
433
|
+
</div>)}
|
|
434
|
+
</Card>
|
|
435
|
+
</motion.div>);
|
|
436
|
+
})}
|
|
437
|
+
</motion.div>
|
|
438
|
+
{visiblePhotos < filteredImages.length && (<div className="mt-8 text-center">
|
|
439
|
+
<ActionButton onClick={loadMore} className="flex items-center gap-2">
|
|
440
|
+
{GALLERY_COMPLEX.BUTTONS.LOAD_MORE_BUTTON}
|
|
441
|
+
</ActionButton>
|
|
442
|
+
</div>)}
|
|
443
|
+
</>) : (<p className="text-center text-gray-700 font-bold text-base sm:text-lg md:text-xl">
|
|
444
|
+
{GALLERY_COMPLEX.UI.NO_IMAGES_MESSAGE}
|
|
445
|
+
</p>)}
|
|
446
|
+
</div>
|
|
447
|
+
</TabsContent>); })}
|
|
448
|
+
</Tabs>
|
|
449
|
+
</TabsContent>
|
|
450
|
+
|
|
451
|
+
<TabsContent value="videos">
|
|
452
|
+
<motion.div className="grid md:grid-cols-2 lg:grid-cols-3 gap-2 sm:gap-4" style={{ y: isMobile ? 0 : parallaxY }}>
|
|
453
|
+
{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">
|
|
454
|
+
<Card className="overflow-hidden glassmorphism rounded-[1.5rem] shadow-4xl p-4">
|
|
455
|
+
<div className="relative w-full aspect-[16/9]">
|
|
456
|
+
<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"/>
|
|
457
|
+
</div>
|
|
458
|
+
<p className="text-gray-700 text-xl sm:text-2xl font-bold mt-4 text-center drop-shadow-md content-text">
|
|
459
|
+
{video.title}
|
|
460
|
+
</p>
|
|
461
|
+
</Card>
|
|
462
|
+
</motion.div>); })}
|
|
463
|
+
</motion.div>
|
|
464
|
+
</TabsContent>
|
|
465
|
+
</Tabs>
|
|
466
|
+
<div className="mt-4 text-center">
|
|
467
|
+
{authLoading || isLoading ? (<p className="text-gray-400 text-sm font-medium">{GALLERY_COMPLEX.UI.LOADING_MESSAGE}</p>) : isAdmin ? (<p className="text-gray-400 text-sm font-medium">{GALLERY_COMPLEX.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>)}
|
|
468
|
+
</div>
|
|
469
|
+
</motion.div>
|
|
470
|
+
{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">
|
|
471
|
+
<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" onClick={function (e) { return e.stopPropagation(); }}>
|
|
472
|
+
<CloseButton variant="close-form" onClick={handleCloseModal}>
|
|
473
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8"/>
|
|
474
|
+
</CloseButton>
|
|
475
|
+
<div className="relative w-full h-[70vh] sm:h-[80vh]">
|
|
476
|
+
<Image src={selectedImage.url} alt={((_b = selectedImage.title) === null || _b === void 0 ? void 0 : _b.trim()) &&
|
|
477
|
+
!selectedImage.title.match(/Image \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/)
|
|
478
|
+
? selectedImage.title
|
|
479
|
+
: GALLERY_COMPLEX.UI.DEFAULT_IMAGE_ALT} fill className="object-contain rounded-2xl" quality={85}/>
|
|
480
|
+
{(((_c = selectedImage.title) === null || _c === void 0 ? void 0 : _c.trim()) &&
|
|
481
|
+
!selectedImage.title.match(/Image \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/) ||
|
|
482
|
+
((_d = selectedImage.description) === null || _d === void 0 ? void 0 : _d.trim())) && (<div className="absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-3 sm:p-4">
|
|
483
|
+
{((_e = selectedImage.title) === null || _e === void 0 ? void 0 : _e.trim()) &&
|
|
484
|
+
!selectedImage.title.match(/Image \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/) && (<h3 className="text-lg sm:text-xl md:text-2xl font-bold text-white drop-shadow-lg">
|
|
485
|
+
{selectedImage.title}
|
|
486
|
+
</h3>)}
|
|
487
|
+
{((_f = selectedImage.description) === null || _f === void 0 ? void 0 : _f.trim()) && (<p className="text-xs sm:text-sm md:text-base text-gray-200 drop-shadow-md line-clamp-2">
|
|
488
|
+
{selectedImage.description}
|
|
489
|
+
</p>)}
|
|
490
|
+
</div>)}
|
|
491
|
+
</div>
|
|
492
|
+
</div>
|
|
493
|
+
</motion.div>)}
|
|
494
|
+
|
|
495
|
+
{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">
|
|
496
|
+
<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(); }}>
|
|
497
|
+
<CloseButton onClick={handleCancelDelete}>
|
|
498
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8"/>
|
|
499
|
+
</CloseButton>
|
|
500
|
+
<h3 id="modal-title" className="text-xl font-bold text-white mb-4">
|
|
501
|
+
{GALLERY_COMPLEX.UI.DELETE_MODAL_HEADING}
|
|
502
|
+
</h3>
|
|
503
|
+
<p className="text-gray-300 text-sm mb-4">
|
|
504
|
+
{GALLERY_COMPLEX.UI.DELETE_CONFIRMATION_MESSAGE}
|
|
505
|
+
</p>
|
|
506
|
+
<div className="flex space-x-3">
|
|
507
|
+
<DeleteButton onClick={handleConfirmDelete} disabled={isLoading}>
|
|
508
|
+
{isLoading ? GALLERY_COMPLEX.BUTTONS.DELETING_BUTTON : GALLERY_COMPLEX.BUTTONS.DELETE_BUTTON}
|
|
509
|
+
</DeleteButton>
|
|
510
|
+
<CancelButton onClick={handleCancelDelete}/>
|
|
511
|
+
</div>
|
|
512
|
+
</div>
|
|
513
|
+
</motion.div>)}
|
|
514
|
+
|
|
515
|
+
{isEditModalOpen && 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={handleCloseEditModal} role="dialog" aria-modal="true" aria-labelledby="edit-modal-title">
|
|
516
|
+
<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(); }}>
|
|
517
|
+
<CloseButton onClick={handleCloseEditModal}>
|
|
518
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8"/>
|
|
519
|
+
</CloseButton>
|
|
520
|
+
<h3 id="edit-modal-title" className="text-xl font-bold text-white mb-4">
|
|
521
|
+
{GALLERY_COMPLEX.UI.EDIT_MODAL_HEADING}
|
|
522
|
+
</h3>
|
|
523
|
+
<form onSubmit={handleEditImage} className="flex flex-col space-y-4">
|
|
524
|
+
<input value={editForm.title} onChange={function (e) { return setEditForm(__assign(__assign({}, editForm), { title: e.target.value })); }} placeholder={GALLERY_COMPLEX.UI.TITLE_PLACEHOLDER} className="p-2 bg-gray-700 text-white rounded-lg" disabled={isLoading}/>
|
|
525
|
+
<textarea value={editForm.description} onChange={function (e) { return setEditForm(__assign(__assign({}, editForm), { description: e.target.value })); }} placeholder={GALLERY_COMPLEX.UI.DESCRIPTION_PLACEHOLDER} className="p-2 bg-gray-700 text-white rounded-lg h-24" disabled={isLoading}/>
|
|
526
|
+
<select value={editForm.category || "none"} onChange={function (e) {
|
|
527
|
+
return setEditForm(__assign(__assign({}, editForm), { category: e.target.value }));
|
|
528
|
+
}} className="p-2 bg-gray-700 text-white rounded-lg" disabled={isLoading}>
|
|
529
|
+
<option value="none">{GALLERY_COMPLEX.UI.CATEGORY_NONE}</option>
|
|
530
|
+
<option value="indoor">{GALLERY_COMPLEX.UI.CATEGORY_INDOOR}</option>
|
|
531
|
+
<option value="outdoor">{GALLERY_COMPLEX.UI.CATEGORY_OUTDOOR}</option>
|
|
532
|
+
<option value="commercial">{GALLERY_COMPLEX.UI.CATEGORY_COMMERCIAL}</option>
|
|
533
|
+
</select>
|
|
534
|
+
<div className="flex space-x-3">
|
|
535
|
+
<SubmitButton type="submit" disabled={isLoading}>
|
|
536
|
+
{isLoading ? GALLERY_COMPLEX.BUTTONS.SAVING_BUTTON : GALLERY_COMPLEX.BUTTONS.SAVE_BUTTON}
|
|
537
|
+
</SubmitButton>
|
|
538
|
+
<CancelButton onClick={handleCloseEditModal}/>
|
|
539
|
+
</div>
|
|
540
|
+
</form>
|
|
541
|
+
</div>
|
|
542
|
+
</motion.div>)}
|
|
543
|
+
|
|
544
|
+
{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">
|
|
545
|
+
<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(); }}>
|
|
546
|
+
<CloseButton onClick={handleCloseUploadModal}>
|
|
547
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8"/>
|
|
548
|
+
</CloseButton>
|
|
549
|
+
<h3 id="upload-modal-title" className="text-xl font-bold text-white mb-4">
|
|
550
|
+
{GALLERY_COMPLEX.UI.UPLOAD_MODAL_HEADING}
|
|
551
|
+
</h3>
|
|
552
|
+
<form onSubmit={handleUploadSubmit} className="flex flex-col space-y-4">
|
|
553
|
+
<input type="file" accept="image/jpeg,image/png,image/gif" onChange={function (e) {
|
|
554
|
+
var _a;
|
|
555
|
+
var file = ((_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0]) || null;
|
|
556
|
+
setUploadForm(__assign(__assign({}, uploadForm), { file: file }));
|
|
557
|
+
}} disabled={isLoading} className="hidden" id="image-upload"/>
|
|
558
|
+
<label htmlFor="image-upload" className="cursor-pointer">
|
|
559
|
+
<div className="flex items-center justify-between bg-gray-700 text-white px-4 py-2 rounded-lg">
|
|
560
|
+
<span>{uploadForm.file ? uploadForm.file.name : GALLERY_COMPLEX.UI.CHOOSE_IMAGE_TEXT}</span>
|
|
561
|
+
<Upload className="h-4 w-4"/>
|
|
562
|
+
</div>
|
|
563
|
+
</label>
|
|
564
|
+
<input value={uploadForm.title} onChange={function (e) { return setUploadForm(__assign(__assign({}, uploadForm), { title: e.target.value })); }} placeholder={GALLERY_COMPLEX.UI.TITLE_PLACEHOLDER} className="p-2 bg-gray-700 text-white rounded-lg" disabled={isLoading}/>
|
|
565
|
+
<textarea value={uploadForm.description} onChange={function (e) { return setUploadForm(__assign(__assign({}, uploadForm), { description: e.target.value })); }} placeholder={GALLERY_COMPLEX.UI.DESCRIPTION_PLACEHOLDER} className="p-2 bg-gray-700 text-white rounded-lg h-24" disabled={isLoading}/>
|
|
566
|
+
<select value={uploadForm.category || "none"} onChange={function (e) {
|
|
567
|
+
return setUploadForm(__assign(__assign({}, uploadForm), { category: e.target.value }));
|
|
568
|
+
}} className="p-2 bg-gray-700 text-white rounded-lg" disabled={isLoading}>
|
|
569
|
+
<option value="none">{GALLERY_COMPLEX.UI.CATEGORY_NONE}</option>
|
|
570
|
+
<option value="indoor">{GALLERY_COMPLEX.UI.CATEGORY_INDOOR}</option>
|
|
571
|
+
<option value="outdoor">{GALLERY_COMPLEX.UI.CATEGORY_OUTDOOR}</option>
|
|
572
|
+
<option value="commercial">{GALLERY_COMPLEX.UI.CATEGORY_COMMERCIAL}</option>
|
|
573
|
+
</select>
|
|
574
|
+
<div className="flex space-x-3">
|
|
575
|
+
<SubmitButton type="submit" disabled={isLoading || !uploadForm.file}>
|
|
576
|
+
{isLoading ? GALLERY_COMPLEX.BUTTONS.UPLOADING_BUTTON : GALLERY_COMPLEX.BUTTONS.UPLOAD_BUTTON}
|
|
577
|
+
</SubmitButton>
|
|
578
|
+
<CancelButton onClick={handleCloseUploadModal}/>
|
|
579
|
+
</div>
|
|
580
|
+
</form>
|
|
581
|
+
</div>
|
|
582
|
+
</motion.div>)}
|
|
583
|
+
|
|
584
|
+
<motion.div initial={{ opacity: 0, scale: 0.8 }} animate={{ opacity: 0, scale: 0.8 }} transition={{ duration: 0.3 }} className="fixed bottom-6 right-6 z-40 pb-24"/>
|
|
585
|
+
</div>);
|
|
586
|
+
}
|