@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,908 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState, useRef, useEffect } from "react";
|
|
4
|
+
import { Card } from "@/components/other/card";
|
|
5
|
+
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/other/tabs";
|
|
6
|
+
import { motion, useScroll, useTransform } from "framer-motion";
|
|
7
|
+
import Image from "next/image";
|
|
8
|
+
import { ActionButton, EditIconButton, TrashIconButton, CloseButton, SubmitButton, CancelButton, FilterButton, DeleteButton } from "@/components/other/button";
|
|
9
|
+
import { Upload, X } from "lucide-react";
|
|
10
|
+
import { useUser, useAuth } from "@clerk/nextjs";
|
|
11
|
+
import { useStrapiAuth } from "@/lib/auth-context";
|
|
12
|
+
import { GALLERY_COMPLEX } from "./constants/galleryComplex";
|
|
13
|
+
import { ImageDescCarousel } from "../ImageDescCarousel";
|
|
14
|
+
|
|
15
|
+
interface StrapiUser {
|
|
16
|
+
id: number;
|
|
17
|
+
username: string;
|
|
18
|
+
email: string;
|
|
19
|
+
businessAdminId?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface UploadedImage {
|
|
23
|
+
id: number;
|
|
24
|
+
documentId: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
url: string;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
category?: "none" | "indoor" | "outdoor" | "commercial";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface GallerySectionProps {
|
|
33
|
+
user: StrapiUser | null;
|
|
34
|
+
setUser: (user: StrapiUser | null) => void;
|
|
35
|
+
authLoading: boolean;
|
|
36
|
+
uploadedImages: UploadedImage[];
|
|
37
|
+
setUploadedImages: (images: UploadedImage[]) => void;
|
|
38
|
+
error: string | null;
|
|
39
|
+
setError: (error: string | null) => void;
|
|
40
|
+
isLoading: boolean;
|
|
41
|
+
setIsLoading: (isLoading: boolean) => void;
|
|
42
|
+
handleImageUpload: (
|
|
43
|
+
e: React.FormEvent<HTMLFormElement>,
|
|
44
|
+
file: File | null,
|
|
45
|
+
title: string,
|
|
46
|
+
description: string,
|
|
47
|
+
category: "none" | "indoor" | "outdoor" | "commercial"
|
|
48
|
+
) => Promise<void>;
|
|
49
|
+
handleDeleteImage: (documentId: string) => Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function GallerySection({
|
|
53
|
+
user,
|
|
54
|
+
setUser,
|
|
55
|
+
authLoading,
|
|
56
|
+
uploadedImages,
|
|
57
|
+
setUploadedImages,
|
|
58
|
+
error,
|
|
59
|
+
setError,
|
|
60
|
+
isLoading,
|
|
61
|
+
setIsLoading,
|
|
62
|
+
handleImageUpload,
|
|
63
|
+
handleDeleteImage,
|
|
64
|
+
}: GallerySectionProps) {
|
|
65
|
+
const { isSignedIn } = useUser();
|
|
66
|
+
const { getToken } = useAuth();
|
|
67
|
+
const { checkSession } = useStrapiAuth();
|
|
68
|
+
const isAdmin = isSignedIn && !!user?.businessAdminId || false;
|
|
69
|
+
const [activeTab, setActiveTab] = useState("photos");
|
|
70
|
+
const [activeSubTab, setActiveSubTab] = useState("all");
|
|
71
|
+
const [selectedImage, setSelectedImage] = useState<UploadedImage | null>(null);
|
|
72
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
73
|
+
const [visiblePhotos, setVisiblePhotos] = useState(12);
|
|
74
|
+
const [isConfirmDeleteOpen, setIsConfirmDeleteOpen] = useState(false);
|
|
75
|
+
const [documentIdToDelete, setDocumentIdToDelete] = useState<string | null>(null);
|
|
76
|
+
const [isEditModalOpen, setIsEditModalOpen] = useState(false);
|
|
77
|
+
const [isUploadModalOpen, setIsUploadModalOpen] = useState(false);
|
|
78
|
+
const [editForm, setEditForm] = useState<{
|
|
79
|
+
id: number;
|
|
80
|
+
documentId: string;
|
|
81
|
+
title: string;
|
|
82
|
+
description: string;
|
|
83
|
+
category?: "none" | "indoor" | "outdoor" | "commercial";
|
|
84
|
+
}>({ id: 0, documentId: "", title: "", description: "", category: "none" });
|
|
85
|
+
const [uploadForm, setUploadForm] = useState<{
|
|
86
|
+
file: File | null;
|
|
87
|
+
title: string;
|
|
88
|
+
description: string;
|
|
89
|
+
category?: "none" | "indoor" | "outdoor" | "commercial";
|
|
90
|
+
}>({ file: null, title: "", description: "", category: "none" });
|
|
91
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
92
|
+
const { scrollYProgress } = useScroll({
|
|
93
|
+
target: containerRef,
|
|
94
|
+
offset: ["start end", "end start"],
|
|
95
|
+
});
|
|
96
|
+
const parallaxY = useTransform(scrollYProgress, [0, 1], [0, -50]);
|
|
97
|
+
|
|
98
|
+
const videos = GALLERY_COMPLEX.UI.VIDEO_TITLES.map((title, index) => ({
|
|
99
|
+
url: [
|
|
100
|
+
"https://www.youtube.com/embed/Ch5fnKgDZH8",
|
|
101
|
+
"https://www.youtube.com/embed/XW3zDzMZNv8",
|
|
102
|
+
"https://www.youtube.com/embed/odC_X6g1uFs",
|
|
103
|
+
"https://www.youtube.com/embed/DFuBBzMi6ZA",
|
|
104
|
+
"https://www.youtube.com/embed/zZNMJyMmcFQ",
|
|
105
|
+
"https://www.youtube.com/embed/VRpbsZGU4a0",
|
|
106
|
+
"https://www.youtube.com/embed/qE14UbB3-gs",
|
|
107
|
+
"https://www.youtube.com/embed/QoVE5TqMkvU",
|
|
108
|
+
"https://www.youtube.com/embed/7Fzgw0SK-8k",
|
|
109
|
+
"https://www.youtube.com/embed/wN0j6JoliAE",
|
|
110
|
+
"https://www.youtube.com/embed/vzFZzhB8KvA",
|
|
111
|
+
"https://www.youtube.com/embed/4thuylOfM9w",
|
|
112
|
+
"https://www.youtube.com/embed/sm3l_uPtaws",
|
|
113
|
+
"https://www.youtube.com/embed/xnnlanydT5I",
|
|
114
|
+
"https://www.youtube.com/embed/jLLePKwiFpI",
|
|
115
|
+
"https://www.youtube.com/embed/pBlpMq8JbIA",
|
|
116
|
+
][index],
|
|
117
|
+
title,
|
|
118
|
+
}));
|
|
119
|
+
|
|
120
|
+
const filteredImages = activeTab === "photos"
|
|
121
|
+
? activeSubTab === "all"
|
|
122
|
+
? uploadedImages
|
|
123
|
+
: uploadedImages.filter((img) => (img.category || "none") === activeSubTab)
|
|
124
|
+
: uploadedImages.filter((img) => (img.category || "none") === activeTab);
|
|
125
|
+
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
const handleLogin = () => checkSession();
|
|
128
|
+
const handleLogout = () => checkSession();
|
|
129
|
+
window.addEventListener("user-login", handleLogin);
|
|
130
|
+
window.addEventListener("user-logout", handleLogout);
|
|
131
|
+
return () => {
|
|
132
|
+
window.removeEventListener("user-login", handleLogin);
|
|
133
|
+
window.removeEventListener("user-logout", handleLogout);
|
|
134
|
+
};
|
|
135
|
+
}, [checkSession]);
|
|
136
|
+
|
|
137
|
+
useEffect(() => {
|
|
138
|
+
const checkMobile = () => setIsMobile(window.innerWidth < 768);
|
|
139
|
+
checkMobile();
|
|
140
|
+
window.addEventListener("resize", checkMobile);
|
|
141
|
+
return () => window.removeEventListener("resize", checkMobile);
|
|
142
|
+
}, []);
|
|
143
|
+
|
|
144
|
+
useEffect(() => {
|
|
145
|
+
if (selectedImage || isConfirmDeleteOpen || isEditModalOpen || isUploadModalOpen) {
|
|
146
|
+
document.body.classList.add("overflow-hidden");
|
|
147
|
+
} else {
|
|
148
|
+
document.body.classList.remove("overflow-hidden");
|
|
149
|
+
}
|
|
150
|
+
return () => {
|
|
151
|
+
document.body.classList.remove("overflow-hidden");
|
|
152
|
+
};
|
|
153
|
+
}, [selectedImage, isConfirmDeleteOpen, isEditModalOpen, isUploadModalOpen]);
|
|
154
|
+
|
|
155
|
+
useEffect(() => {
|
|
156
|
+
const event = new CustomEvent("modalStateChange", {
|
|
157
|
+
detail: { isOpen: !!selectedImage || isConfirmDeleteOpen || isEditModalOpen || isUploadModalOpen },
|
|
158
|
+
});
|
|
159
|
+
window.dispatchEvent(event);
|
|
160
|
+
}, [selectedImage, isConfirmDeleteOpen, isEditModalOpen, isUploadModalOpen]);
|
|
161
|
+
|
|
162
|
+
useEffect(() => {
|
|
163
|
+
const handleEsc = (e: KeyboardEvent) => {
|
|
164
|
+
if (e.key === "Escape") {
|
|
165
|
+
if (isConfirmDeleteOpen) {
|
|
166
|
+
handleCancelDelete();
|
|
167
|
+
} else if (selectedImage) {
|
|
168
|
+
handleCloseModal();
|
|
169
|
+
} else if (isEditModalOpen) {
|
|
170
|
+
handleCloseEditModal();
|
|
171
|
+
} else if (isUploadModalOpen) {
|
|
172
|
+
handleCloseUploadModal();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
window.addEventListener("keydown", handleEsc);
|
|
177
|
+
return () => window.removeEventListener("keydown", handleEsc);
|
|
178
|
+
}, [isConfirmDeleteOpen, selectedImage, isEditModalOpen, isUploadModalOpen]);
|
|
179
|
+
|
|
180
|
+
const openConfirmDelete = (documentId: string) => {
|
|
181
|
+
if (!isAdmin) {
|
|
182
|
+
setError(GALLERY_COMPLEX.ERRORS.UNAUTHORIZED_DELETE);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
setDocumentIdToDelete(documentId);
|
|
186
|
+
setIsConfirmDeleteOpen(true);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const handleConfirmDelete = async () => {
|
|
190
|
+
if (!isAdmin) {
|
|
191
|
+
setError(GALLERY_COMPLEX.ERRORS.UNAUTHORIZED_DELETE);
|
|
192
|
+
setIsConfirmDeleteOpen(false);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (documentIdToDelete !== null) {
|
|
196
|
+
setIsLoading(true);
|
|
197
|
+
try {
|
|
198
|
+
await handleDeleteImage(documentIdToDelete);
|
|
199
|
+
} finally {
|
|
200
|
+
setIsLoading(false);
|
|
201
|
+
setIsConfirmDeleteOpen(false);
|
|
202
|
+
setDocumentIdToDelete(null);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
const handleCancelDelete = () => {
|
|
208
|
+
setIsConfirmDeleteOpen(false);
|
|
209
|
+
setDocumentIdToDelete(null);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
const handleImageClick = (image: UploadedImage) => {
|
|
213
|
+
setSelectedImage(image);
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
const handleCloseModal = () => {
|
|
217
|
+
setSelectedImage(null);
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
const openEditModal = (image: UploadedImage) => {
|
|
221
|
+
if (!isAdmin) {
|
|
222
|
+
setError(GALLERY_COMPLEX.ERRORS.UNAUTHORIZED_EDIT);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
setEditForm({
|
|
226
|
+
id: image.id,
|
|
227
|
+
documentId: image.documentId,
|
|
228
|
+
title: image.title?.trim() && !image.title.match(/Image \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/) ? image.title : "",
|
|
229
|
+
description: image.description || "",
|
|
230
|
+
category: image.category || "none",
|
|
231
|
+
});
|
|
232
|
+
setIsEditModalOpen(true);
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
const handleCloseEditModal = () => {
|
|
236
|
+
setIsEditModalOpen(false);
|
|
237
|
+
setEditForm({ id: 0, documentId: "", title: "", description: "", category: "none" });
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const handleCloseUploadModal = () => {
|
|
241
|
+
setIsUploadModalOpen(false);
|
|
242
|
+
setUploadForm({ file: null, title: "", description: "", category: "none" });
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
const handleEditImage = async (e: React.FormEvent<HTMLFormElement>) => {
|
|
246
|
+
e.preventDefault();
|
|
247
|
+
if (!isAdmin) {
|
|
248
|
+
console.error("GallerySection: Unauthorized edit attempt", {
|
|
249
|
+
isSignedIn,
|
|
250
|
+
businessAdminId: user?.businessAdminId,
|
|
251
|
+
});
|
|
252
|
+
setError(GALLERY_COMPLEX.ERRORS.UNAUTHORIZED_EDIT);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
try {
|
|
257
|
+
setIsLoading(true);
|
|
258
|
+
const token = await getToken();
|
|
259
|
+
if (!token) {
|
|
260
|
+
console.error("GallerySection: No authentication token available");
|
|
261
|
+
setError(GALLERY_COMPLEX.ERRORS.AUTHENTICATION_ERROR);
|
|
262
|
+
setUser(null);
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
const payload = {
|
|
267
|
+
documentId: editForm.documentId,
|
|
268
|
+
title: editForm.title || `Image ${new Date().toISOString()}`,
|
|
269
|
+
description: editForm.description || "",
|
|
270
|
+
category: editForm.category || "none",
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
const response = await fetch("/api/gallery-data", {
|
|
274
|
+
method: "PUT",
|
|
275
|
+
headers: {
|
|
276
|
+
"Content-Type": "application/json",
|
|
277
|
+
Authorization: `Bearer ${token}`,
|
|
278
|
+
},
|
|
279
|
+
body: JSON.stringify(payload),
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
if (!response.ok) {
|
|
283
|
+
const errorData = await response.json();
|
|
284
|
+
console.error("GallerySection: Edit failed", { status: response.status, errorData });
|
|
285
|
+
if (response.status === 401) {
|
|
286
|
+
setError(GALLERY_COMPLEX.ERRORS.AUTHENTICATION_ERROR);
|
|
287
|
+
setUser(null);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
throw new Error(errorData.error || GALLERY_COMPLEX.ERRORS.EDIT_FAILED_STATUS.replace("${response.status}", response.status.toString()));
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const { data } = await response.json();
|
|
294
|
+
setUploadedImages(data || []);
|
|
295
|
+
setError(null);
|
|
296
|
+
setIsEditModalOpen(false);
|
|
297
|
+
setEditForm({ id: 0, documentId: "", title: "", description: "", category: "none" });
|
|
298
|
+
} catch (err) {
|
|
299
|
+
console.error("GallerySection: Edit Error", err);
|
|
300
|
+
setError(err instanceof Error ? err.message : GALLERY_COMPLEX.ERRORS.EDIT_FAILED);
|
|
301
|
+
} finally {
|
|
302
|
+
setIsLoading(false);
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
const handleUploadSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
|
|
307
|
+
e.preventDefault();
|
|
308
|
+
if (!isAdmin) {
|
|
309
|
+
console.error("GallerySection: Unauthorized upload attempt", {
|
|
310
|
+
isSignedIn,
|
|
311
|
+
businessAdminId: user?.businessAdminId,
|
|
312
|
+
});
|
|
313
|
+
setError(GALLERY_COMPLEX.ERRORS.UNAUTHORIZED_UPLOAD);
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
setIsLoading(true);
|
|
317
|
+
try {
|
|
318
|
+
await handleImageUpload(
|
|
319
|
+
e,
|
|
320
|
+
uploadForm.file,
|
|
321
|
+
uploadForm.title,
|
|
322
|
+
uploadForm.description,
|
|
323
|
+
uploadForm.category || "none"
|
|
324
|
+
);
|
|
325
|
+
setUploadForm({ file: null, title: "", description: "", category: "none" });
|
|
326
|
+
setIsUploadModalOpen(false);
|
|
327
|
+
} catch (err) {
|
|
328
|
+
console.error("GallerySection: Upload Error", err);
|
|
329
|
+
setError(err instanceof Error ? err.message : GALLERY_COMPLEX.ERRORS.UPLOAD_FAILED);
|
|
330
|
+
} finally {
|
|
331
|
+
setIsLoading(false);
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
const loadMore = () => {
|
|
336
|
+
setVisiblePhotos((prev) => prev + 12);
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
const sectionVariants = {
|
|
340
|
+
hidden: { opacity: 0 },
|
|
341
|
+
visible: {
|
|
342
|
+
opacity: 1,
|
|
343
|
+
transition: { duration: 0.8, ease: [0.16, 1, 0.3, 1], staggerChildren: 0.1 },
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
const cardVariants = {
|
|
348
|
+
hidden: { opacity: 0, y: 30 },
|
|
349
|
+
visible: {
|
|
350
|
+
opacity: 1,
|
|
351
|
+
y: 0,
|
|
352
|
+
transition: { duration: 0.5 },
|
|
353
|
+
},
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
const modalVariants = {
|
|
357
|
+
hidden: { opacity: 0, y: "100vh" },
|
|
358
|
+
visible: { opacity: 1, y: 0, transition: { duration: 0.5, ease: [0.16, 1, 0.3, 1] } },
|
|
359
|
+
exit: { opacity: 0, y: "100vh", transition: { duration: 0.3, ease: "easeIn" } },
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
return (
|
|
363
|
+
<div className="w-full">
|
|
364
|
+
<style jsx>{`
|
|
365
|
+
:root {
|
|
366
|
+
--jubilee: #F47C7C;
|
|
367
|
+
--exuberant-blue: #FF69B4;
|
|
368
|
+
--modern-purple: #D946EF;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.glassmorphism {
|
|
372
|
+
background: rgba(255, 255, 255, 0.08);
|
|
373
|
+
backdrop-filter: blur(10px);
|
|
374
|
+
-webkit-backdrop-filter: blur(10px);
|
|
375
|
+
border: 2px solid transparent;
|
|
376
|
+
border-image: linear-gradient(45deg, var(--exuberant-blue), var(--jubilee), var(--modern-purple)) 1;
|
|
377
|
+
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.modal-glassmorphism {
|
|
381
|
+
background: rgba(255, 255, 255, 0.08);
|
|
382
|
+
backdrop-filter: blur(10px);
|
|
383
|
+
-webkit-backdrop-filter: blur(10px);
|
|
384
|
+
border: 2px solid transparent;
|
|
385
|
+
border-image: linear-gradient(45deg, var(--exuberant-blue), var(--jubilee), var(--modern-purple)) 1;
|
|
386
|
+
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
|
|
387
|
+
border-radius: 2rem;
|
|
388
|
+
max-height: 90vh;
|
|
389
|
+
overflow: hidden;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
@supports not (backdrop-filter: blur(10px)) {
|
|
393
|
+
.glassmorphism {
|
|
394
|
+
background: rgba(255, 255, 255, 0.2);
|
|
395
|
+
}
|
|
396
|
+
.modal-glassmorphism {
|
|
397
|
+
background: rgba(255, 255, 255, 0.2);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
@media (max-width: 768px) {
|
|
402
|
+
.glassmorphism {
|
|
403
|
+
backdrop-filter: none;
|
|
404
|
+
background: rgba(255, 255, 255, 0.2);
|
|
405
|
+
}
|
|
406
|
+
.modal-glassmorphism {
|
|
407
|
+
padding: 1rem;
|
|
408
|
+
max-height: 85vh;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.motion-card {
|
|
413
|
+
will-change: transform, opacity;
|
|
414
|
+
}
|
|
415
|
+
`}</style>
|
|
416
|
+
<motion.div
|
|
417
|
+
variants={sectionVariants}
|
|
418
|
+
initial="hidden"
|
|
419
|
+
whileInView="visible"
|
|
420
|
+
viewport={{ once: true }}
|
|
421
|
+
className="p-4 sm:p-8 lg:p-12"
|
|
422
|
+
ref={containerRef}
|
|
423
|
+
>
|
|
424
|
+
<Tabs defaultValue="photos" className="w-full" onValueChange={(value) => setActiveTab(value)}>
|
|
425
|
+
<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">
|
|
426
|
+
{["photos", "videos"].map((tab) => (
|
|
427
|
+
<TabsTrigger
|
|
428
|
+
key={tab}
|
|
429
|
+
value={tab}
|
|
430
|
+
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"
|
|
431
|
+
>
|
|
432
|
+
{tab === "photos" ? GALLERY_COMPLEX.UI.PHOTOS_TAB : GALLERY_COMPLEX.UI.VIDEOS_TAB}
|
|
433
|
+
</TabsTrigger>
|
|
434
|
+
))}
|
|
435
|
+
</TabsList>
|
|
436
|
+
{/* Replace the existing photos tab content with ImageDescCarousel */}
|
|
437
|
+
<ImageDescCarousel
|
|
438
|
+
user={user}
|
|
439
|
+
uploadedImages={filteredImages}
|
|
440
|
+
setUploadedImages={setUploadedImages}
|
|
441
|
+
error={error}
|
|
442
|
+
setError={setError}
|
|
443
|
+
isLoading={isLoading}
|
|
444
|
+
setIsLoading={setIsLoading}
|
|
445
|
+
handleImageUpload={handleImageUpload}
|
|
446
|
+
handleDeleteImage={handleDeleteImage}
|
|
447
|
+
/>
|
|
448
|
+
<TabsContent value="photos">
|
|
449
|
+
<Tabs defaultValue="all" onValueChange={(value) => setActiveSubTab(value)}>
|
|
450
|
+
{isMobile ? (
|
|
451
|
+
<div className="flex justify-center mb-6 max-w-2xl mx-auto">
|
|
452
|
+
<select
|
|
453
|
+
value={activeSubTab}
|
|
454
|
+
onChange={(e) => setActiveSubTab(e.target.value)}
|
|
455
|
+
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"
|
|
456
|
+
>
|
|
457
|
+
{["all", "indoor", "outdoor", "commercial"].map((subTab) => (
|
|
458
|
+
<option key={subTab} value={subTab}>
|
|
459
|
+
{subTab === "all" ? GALLERY_COMPLEX.UI.ALL_SUB_TAB :
|
|
460
|
+
subTab === "indoor" ? GALLERY_COMPLEX.UI.INDOOR_SUB_TAB :
|
|
461
|
+
subTab === "outdoor" ? GALLERY_COMPLEX.UI.OUTDOOR_SUB_TAB :
|
|
462
|
+
GALLERY_COMPLEX.UI.COMMERCIAL_SUB_TAB}
|
|
463
|
+
</option>
|
|
464
|
+
))}
|
|
465
|
+
</select>
|
|
466
|
+
</div>
|
|
467
|
+
) : (
|
|
468
|
+
<div className="flex justify-center gap-4 mb-12 max-w-2xl mx-auto">
|
|
469
|
+
{["all", "indoor", "outdoor", "commercial"].map((subTab) => (
|
|
470
|
+
<FilterButton
|
|
471
|
+
key={subTab}
|
|
472
|
+
isActive={activeSubTab === subTab}
|
|
473
|
+
useBlueActive={true}
|
|
474
|
+
onClick={() => setActiveSubTab(subTab)}
|
|
475
|
+
>
|
|
476
|
+
{subTab === "all" ? GALLERY_COMPLEX.UI.ALL_SUB_TAB :
|
|
477
|
+
subTab === "indoor" ? GALLERY_COMPLEX.UI.INDOOR_SUB_TAB :
|
|
478
|
+
subTab === "outdoor" ? GALLERY_COMPLEX.UI.OUTDOOR_SUB_TAB :
|
|
479
|
+
GALLERY_COMPLEX.UI.COMMERCIAL_SUB_TAB}
|
|
480
|
+
</FilterButton>
|
|
481
|
+
))}
|
|
482
|
+
</div>
|
|
483
|
+
)}
|
|
484
|
+
|
|
485
|
+
{["all", "indoor", "outdoor", "commercial"].map((subTab) => (
|
|
486
|
+
<TabsContent key={subTab} value={subTab}>
|
|
487
|
+
<div className="space-y-6">
|
|
488
|
+
{error && (
|
|
489
|
+
<p className="text-red-400 text-base sm:text-lg md:text-xl text-center">{error}</p>
|
|
490
|
+
)}
|
|
491
|
+
{isAdmin && (
|
|
492
|
+
<div className="flex justify-center pb-12">
|
|
493
|
+
<ActionButton
|
|
494
|
+
onClick={() => setIsUploadModalOpen(true)}
|
|
495
|
+
className="flex items-center gap-2"
|
|
496
|
+
disabled={isLoading}
|
|
497
|
+
>
|
|
498
|
+
<Upload className="h-4 w-4 sm:h-5 sm:w-5" />
|
|
499
|
+
{GALLERY_COMPLEX.BUTTONS.UPLOAD_IMAGE_BUTTON}
|
|
500
|
+
</ActionButton>
|
|
501
|
+
</div>
|
|
502
|
+
)}
|
|
503
|
+
{filteredImages.length > 0 ? (
|
|
504
|
+
<>
|
|
505
|
+
<motion.div
|
|
506
|
+
className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-2 sm:gap-8"
|
|
507
|
+
style={{ y: isMobile ? 0 : parallaxY }}
|
|
508
|
+
>
|
|
509
|
+
{filteredImages.slice(0, visiblePhotos).map((image, index) => (
|
|
510
|
+
<motion.div
|
|
511
|
+
key={image.documentId}
|
|
512
|
+
variants={cardVariants}
|
|
513
|
+
initial="hidden"
|
|
514
|
+
whileInView="visible"
|
|
515
|
+
viewport={{ once: true, amount: 0.2 }}
|
|
516
|
+
onClick={() => handleImageClick(image)}
|
|
517
|
+
className="cursor-pointer motion-card"
|
|
518
|
+
>
|
|
519
|
+
<Card className="overflow-hidden glassmorphism rounded-[1.5rem] shadow-4xl p-2 sm:p-4 relative">
|
|
520
|
+
<div className="relative w-full aspect-[3/2]">
|
|
521
|
+
<Image
|
|
522
|
+
src={image.url}
|
|
523
|
+
alt={
|
|
524
|
+
image.title?.trim() &&
|
|
525
|
+
!image.title.match(/Image \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/)
|
|
526
|
+
? image.title
|
|
527
|
+
: GALLERY_COMPLEX.UI.DEFAULT_IMAGE_ALT
|
|
528
|
+
}
|
|
529
|
+
fill
|
|
530
|
+
className="object-cover object-center rounded-[1rem] transition-all duration-300"
|
|
531
|
+
priority={index === 0}
|
|
532
|
+
loading={index === 0 ? "eager" : "lazy"}
|
|
533
|
+
quality={85}
|
|
534
|
+
/>
|
|
535
|
+
</div>
|
|
536
|
+
{isAdmin && (
|
|
537
|
+
<div className="absolute top-2 right-2 flex space-x-2">
|
|
538
|
+
<EditIconButton
|
|
539
|
+
onClick={(e) => {
|
|
540
|
+
e.stopPropagation();
|
|
541
|
+
openEditModal(image);
|
|
542
|
+
}}
|
|
543
|
+
/>
|
|
544
|
+
<TrashIconButton
|
|
545
|
+
onClick={(e) => {
|
|
546
|
+
e.stopPropagation();
|
|
547
|
+
openConfirmDelete(image.documentId);
|
|
548
|
+
}}
|
|
549
|
+
/>
|
|
550
|
+
</div>
|
|
551
|
+
)}
|
|
552
|
+
{(image.title?.trim() &&
|
|
553
|
+
!image.title.match(/Image \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/) ||
|
|
554
|
+
image.description?.trim()) && (
|
|
555
|
+
<div className="p-4">
|
|
556
|
+
{image.title?.trim() &&
|
|
557
|
+
!image.title.match(/Image \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/) && (
|
|
558
|
+
<h3 className="text-lg font-semibold text-gray-700">{image.title}</h3>
|
|
559
|
+
)}
|
|
560
|
+
{image.description?.trim() && (
|
|
561
|
+
<p className="text-sm text-gray-600 line-clamp-2">{image.description}</p>
|
|
562
|
+
)}
|
|
563
|
+
</div>
|
|
564
|
+
)}
|
|
565
|
+
</Card>
|
|
566
|
+
</motion.div>
|
|
567
|
+
))}
|
|
568
|
+
</motion.div>
|
|
569
|
+
{visiblePhotos < filteredImages.length && (
|
|
570
|
+
<div className="mt-8 text-center">
|
|
571
|
+
<ActionButton
|
|
572
|
+
onClick={loadMore}
|
|
573
|
+
className="flex items-center gap-2"
|
|
574
|
+
>
|
|
575
|
+
{GALLERY_COMPLEX.BUTTONS.LOAD_MORE_BUTTON}
|
|
576
|
+
</ActionButton>
|
|
577
|
+
</div>
|
|
578
|
+
)}
|
|
579
|
+
</>
|
|
580
|
+
) : (
|
|
581
|
+
<p className="text-center text-gray-700 font-bold text-base sm:text-lg md:text-xl">
|
|
582
|
+
{GALLERY_COMPLEX.UI.NO_IMAGES_MESSAGE}
|
|
583
|
+
</p>
|
|
584
|
+
)}
|
|
585
|
+
</div>
|
|
586
|
+
</TabsContent>
|
|
587
|
+
))}
|
|
588
|
+
</Tabs>
|
|
589
|
+
</TabsContent>
|
|
590
|
+
|
|
591
|
+
<TabsContent value="videos">
|
|
592
|
+
<motion.div
|
|
593
|
+
className="grid md:grid-cols-2 lg:grid-cols-3 gap-2 sm:gap-4"
|
|
594
|
+
style={{ y: isMobile ? 0 : parallaxY }}
|
|
595
|
+
>
|
|
596
|
+
{videos.map((video, index) => (
|
|
597
|
+
<motion.div
|
|
598
|
+
key={index}
|
|
599
|
+
variants={cardVariants}
|
|
600
|
+
initial="hidden"
|
|
601
|
+
whileInView="visible"
|
|
602
|
+
viewport={{ once: true, amount: 0.2 }}
|
|
603
|
+
className="motion-card"
|
|
604
|
+
>
|
|
605
|
+
<Card className="overflow-hidden glassmorphism rounded-[1.5rem] shadow-4xl p-4">
|
|
606
|
+
<div className="relative w-full aspect-[16/9]">
|
|
607
|
+
<iframe
|
|
608
|
+
width="100%"
|
|
609
|
+
height="100%"
|
|
610
|
+
src={video.url}
|
|
611
|
+
title={video.title}
|
|
612
|
+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
|
613
|
+
allowFullScreen
|
|
614
|
+
className="border-0 rounded-[1rem]"
|
|
615
|
+
loading="lazy"
|
|
616
|
+
/>
|
|
617
|
+
</div>
|
|
618
|
+
<p className="text-gray-700 text-xl sm:text-2xl font-bold mt-4 text-center drop-shadow-md content-text">
|
|
619
|
+
{video.title}
|
|
620
|
+
</p>
|
|
621
|
+
</Card>
|
|
622
|
+
</motion.div>
|
|
623
|
+
))}
|
|
624
|
+
</motion.div>
|
|
625
|
+
</TabsContent>
|
|
626
|
+
</Tabs>
|
|
627
|
+
<div className="mt-4 text-center">
|
|
628
|
+
{authLoading || isLoading ? (
|
|
629
|
+
<p className="text-gray-400 text-sm font-medium">{GALLERY_COMPLEX.UI.LOADING_MESSAGE}</p>
|
|
630
|
+
) : isAdmin ? (
|
|
631
|
+
<p className="text-gray-400 text-sm font-medium">{GALLERY_COMPLEX.UI.ADMIN_LOGGED_IN_MESSAGE}</p>
|
|
632
|
+
) : user ? (
|
|
633
|
+
<p className="text-gray-400 text-sm font-medium"></p>
|
|
634
|
+
) : (
|
|
635
|
+
<p className="text-gray-400 text-sm font-medium"></p>
|
|
636
|
+
)}
|
|
637
|
+
</div>
|
|
638
|
+
</motion.div>
|
|
639
|
+
{selectedImage && (
|
|
640
|
+
<motion.div
|
|
641
|
+
variants={modalVariants}
|
|
642
|
+
initial="hidden"
|
|
643
|
+
animate="visible"
|
|
644
|
+
exit="exit"
|
|
645
|
+
className="fixed inset-0 bg-black/90 flex items-center justify-center z-[10000] p-2 sm:p-4 isolate"
|
|
646
|
+
onClick={handleCloseModal}
|
|
647
|
+
role="dialog"
|
|
648
|
+
aria-modal="true"
|
|
649
|
+
aria-labelledby="modal-image"
|
|
650
|
+
>
|
|
651
|
+
<div
|
|
652
|
+
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"
|
|
653
|
+
onClick={(e) => e.stopPropagation()}
|
|
654
|
+
>
|
|
655
|
+
<CloseButton
|
|
656
|
+
variant="close-form"
|
|
657
|
+
onClick={handleCloseModal}
|
|
658
|
+
>
|
|
659
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8" />
|
|
660
|
+
</CloseButton>
|
|
661
|
+
<div className="relative w-full h-[70vh] sm:h-[80vh]">
|
|
662
|
+
<Image
|
|
663
|
+
src={selectedImage.url}
|
|
664
|
+
alt={
|
|
665
|
+
selectedImage.title?.trim() &&
|
|
666
|
+
!selectedImage.title.match(/Image \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/)
|
|
667
|
+
? selectedImage.title
|
|
668
|
+
: GALLERY_COMPLEX.UI.DEFAULT_IMAGE_ALT
|
|
669
|
+
}
|
|
670
|
+
fill
|
|
671
|
+
className="object-contain rounded-2xl"
|
|
672
|
+
quality={85}
|
|
673
|
+
/>
|
|
674
|
+
{(selectedImage.title?.trim() &&
|
|
675
|
+
!selectedImage.title.match(/Image \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/) ||
|
|
676
|
+
selectedImage.description?.trim()) && (
|
|
677
|
+
<div className="absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-3 sm:p-4">
|
|
678
|
+
{selectedImage.title?.trim() &&
|
|
679
|
+
!selectedImage.title.match(/Image \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/) && (
|
|
680
|
+
<h3 className="text-lg sm:text-xl md:text-2xl font-bold text-white drop-shadow-lg">
|
|
681
|
+
{selectedImage.title}
|
|
682
|
+
</h3>
|
|
683
|
+
)}
|
|
684
|
+
{selectedImage.description?.trim() && (
|
|
685
|
+
<p className="text-xs sm:text-sm md:text-base text-gray-200 drop-shadow-md line-clamp-2">
|
|
686
|
+
{selectedImage.description}
|
|
687
|
+
</p>
|
|
688
|
+
)}
|
|
689
|
+
</div>
|
|
690
|
+
)}
|
|
691
|
+
</div>
|
|
692
|
+
</div>
|
|
693
|
+
</motion.div>
|
|
694
|
+
)}
|
|
695
|
+
|
|
696
|
+
{isConfirmDeleteOpen && isAdmin && (
|
|
697
|
+
<motion.div
|
|
698
|
+
variants={modalVariants}
|
|
699
|
+
initial="hidden"
|
|
700
|
+
animate="visible"
|
|
701
|
+
exit="exit"
|
|
702
|
+
className="fixed inset-0 bg-black/90 flex items-center justify-center z-[10000] p-4 isolate"
|
|
703
|
+
onClick={handleCancelDelete}
|
|
704
|
+
role="dialog"
|
|
705
|
+
aria-modal="true"
|
|
706
|
+
aria-labelledby="modal-title"
|
|
707
|
+
>
|
|
708
|
+
<div
|
|
709
|
+
className="relative max-w-md w-full mx-4 p-6 bg-gray-800/50 border border-gray-700/50 rounded-lg shadow-lg"
|
|
710
|
+
onClick={(e) => e.stopPropagation()}
|
|
711
|
+
>
|
|
712
|
+
<CloseButton
|
|
713
|
+
onClick={handleCancelDelete}
|
|
714
|
+
>
|
|
715
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8" />
|
|
716
|
+
</CloseButton>
|
|
717
|
+
<h3 id="modal-title" className="text-xl font-bold text-white mb-4">
|
|
718
|
+
{GALLERY_COMPLEX.UI.DELETE_MODAL_HEADING}
|
|
719
|
+
</h3>
|
|
720
|
+
<p className="text-gray-300 text-sm mb-4">
|
|
721
|
+
{GALLERY_COMPLEX.UI.DELETE_CONFIRMATION_MESSAGE}
|
|
722
|
+
</p>
|
|
723
|
+
<div className="flex space-x-3">
|
|
724
|
+
<DeleteButton
|
|
725
|
+
onClick={handleConfirmDelete}
|
|
726
|
+
disabled={isLoading}
|
|
727
|
+
>
|
|
728
|
+
{isLoading ? GALLERY_COMPLEX.BUTTONS.DELETING_BUTTON : GALLERY_COMPLEX.BUTTONS.DELETE_BUTTON}
|
|
729
|
+
</DeleteButton>
|
|
730
|
+
<CancelButton
|
|
731
|
+
onClick={handleCancelDelete}
|
|
732
|
+
/>
|
|
733
|
+
</div>
|
|
734
|
+
</div>
|
|
735
|
+
</motion.div>
|
|
736
|
+
)}
|
|
737
|
+
|
|
738
|
+
{isEditModalOpen && isAdmin && (
|
|
739
|
+
<motion.div
|
|
740
|
+
variants={modalVariants}
|
|
741
|
+
initial="hidden"
|
|
742
|
+
animate="visible"
|
|
743
|
+
exit="exit"
|
|
744
|
+
className="fixed inset-0 bg-black/90 flex items-center justify-center z-[10000] p-4 isolate"
|
|
745
|
+
onClick={handleCloseEditModal}
|
|
746
|
+
role="dialog"
|
|
747
|
+
aria-modal="true"
|
|
748
|
+
aria-labelledby="edit-modal-title"
|
|
749
|
+
>
|
|
750
|
+
<div
|
|
751
|
+
className="relative max-w-md w-full mx-4 p-6 bg-gray-800/50 border border-gray-700/50 rounded-lg shadow-lg"
|
|
752
|
+
onClick={(e) => e.stopPropagation()}
|
|
753
|
+
>
|
|
754
|
+
<CloseButton
|
|
755
|
+
onClick={handleCloseEditModal}
|
|
756
|
+
>
|
|
757
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8" />
|
|
758
|
+
</CloseButton>
|
|
759
|
+
<h3 id="edit-modal-title" className="text-xl font-bold text-white mb-4">
|
|
760
|
+
{GALLERY_COMPLEX.UI.EDIT_MODAL_HEADING}
|
|
761
|
+
</h3>
|
|
762
|
+
<form onSubmit={handleEditImage} className="flex flex-col space-y-4">
|
|
763
|
+
<input
|
|
764
|
+
value={editForm.title}
|
|
765
|
+
onChange={(e) => setEditForm({ ...editForm, title: e.target.value })}
|
|
766
|
+
placeholder={GALLERY_COMPLEX.UI.TITLE_PLACEHOLDER}
|
|
767
|
+
className="p-2 bg-gray-700 text-white rounded-lg"
|
|
768
|
+
disabled={isLoading}
|
|
769
|
+
/>
|
|
770
|
+
<textarea
|
|
771
|
+
value={editForm.description}
|
|
772
|
+
onChange={(e) => setEditForm({ ...editForm, description: e.target.value })}
|
|
773
|
+
placeholder={GALLERY_COMPLEX.UI.DESCRIPTION_PLACEHOLDER}
|
|
774
|
+
className="p-2 bg-gray-700 text-white rounded-lg h-24"
|
|
775
|
+
disabled={isLoading}
|
|
776
|
+
/>
|
|
777
|
+
<select
|
|
778
|
+
value={editForm.category || "none"}
|
|
779
|
+
onChange={(e) =>
|
|
780
|
+
setEditForm({
|
|
781
|
+
...editForm,
|
|
782
|
+
category: e.target.value as "none" | "indoor" | "outdoor" | "commercial",
|
|
783
|
+
})
|
|
784
|
+
}
|
|
785
|
+
className="p-2 bg-gray-700 text-white rounded-lg"
|
|
786
|
+
disabled={isLoading}
|
|
787
|
+
>
|
|
788
|
+
<option value="none">{GALLERY_COMPLEX.UI.CATEGORY_NONE}</option>
|
|
789
|
+
<option value="indoor">{GALLERY_COMPLEX.UI.CATEGORY_INDOOR}</option>
|
|
790
|
+
<option value="outdoor">{GALLERY_COMPLEX.UI.CATEGORY_OUTDOOR}</option>
|
|
791
|
+
<option value="commercial">{GALLERY_COMPLEX.UI.CATEGORY_COMMERCIAL}</option>
|
|
792
|
+
</select>
|
|
793
|
+
<div className="flex space-x-3">
|
|
794
|
+
<SubmitButton
|
|
795
|
+
type="submit"
|
|
796
|
+
disabled={isLoading}
|
|
797
|
+
>
|
|
798
|
+
{isLoading ? GALLERY_COMPLEX.BUTTONS.SAVING_BUTTON : GALLERY_COMPLEX.BUTTONS.SAVE_BUTTON}
|
|
799
|
+
</SubmitButton>
|
|
800
|
+
<CancelButton
|
|
801
|
+
onClick={handleCloseEditModal}
|
|
802
|
+
/>
|
|
803
|
+
</div>
|
|
804
|
+
</form>
|
|
805
|
+
</div>
|
|
806
|
+
</motion.div>
|
|
807
|
+
)}
|
|
808
|
+
|
|
809
|
+
{isUploadModalOpen && isAdmin && (
|
|
810
|
+
<motion.div
|
|
811
|
+
variants={modalVariants}
|
|
812
|
+
initial="hidden"
|
|
813
|
+
animate="visible"
|
|
814
|
+
exit="exit"
|
|
815
|
+
className="fixed inset-0 bg-black/90 flex items-center justify-center z-[10000] p-4 isolate"
|
|
816
|
+
onClick={handleCloseUploadModal}
|
|
817
|
+
role="dialog"
|
|
818
|
+
aria-modal="true"
|
|
819
|
+
aria-labelledby="upload-modal-title"
|
|
820
|
+
>
|
|
821
|
+
<div
|
|
822
|
+
className="relative max-w-md w-full mx-4 p-6 bg-gray-800/50 border border-gray-700/50 rounded-lg shadow-lg"
|
|
823
|
+
onClick={(e) => e.stopPropagation()}
|
|
824
|
+
>
|
|
825
|
+
<CloseButton
|
|
826
|
+
onClick={handleCloseUploadModal}
|
|
827
|
+
>
|
|
828
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8" />
|
|
829
|
+
</CloseButton>
|
|
830
|
+
<h3 id="upload-modal-title" className="text-xl font-bold text-white mb-4">
|
|
831
|
+
{GALLERY_COMPLEX.UI.UPLOAD_MODAL_HEADING}
|
|
832
|
+
</h3>
|
|
833
|
+
<form
|
|
834
|
+
onSubmit={handleUploadSubmit}
|
|
835
|
+
className="flex flex-col space-y-4"
|
|
836
|
+
>
|
|
837
|
+
<input
|
|
838
|
+
type="file"
|
|
839
|
+
accept="image/jpeg,image/png,image/gif"
|
|
840
|
+
onChange={(e) => {
|
|
841
|
+
const file = e.target.files?.[0] || null;
|
|
842
|
+
setUploadForm({ ...uploadForm, file });
|
|
843
|
+
}}
|
|
844
|
+
disabled={isLoading}
|
|
845
|
+
className="hidden"
|
|
846
|
+
id="image-upload"
|
|
847
|
+
/>
|
|
848
|
+
<label htmlFor="image-upload" className="cursor-pointer">
|
|
849
|
+
<div className="flex items-center justify-between bg-gray-700 text-white px-4 py-2 rounded-lg">
|
|
850
|
+
<span>{uploadForm.file ? uploadForm.file.name : GALLERY_COMPLEX.UI.CHOOSE_IMAGE_TEXT}</span>
|
|
851
|
+
<Upload className="h-4 w-4" />
|
|
852
|
+
</div>
|
|
853
|
+
</label>
|
|
854
|
+
<input
|
|
855
|
+
value={uploadForm.title}
|
|
856
|
+
onChange={(e) => setUploadForm({ ...uploadForm, title: e.target.value })}
|
|
857
|
+
placeholder={GALLERY_COMPLEX.UI.TITLE_PLACEHOLDER}
|
|
858
|
+
className="p-2 bg-gray-700 text-white rounded-lg"
|
|
859
|
+
disabled={isLoading}
|
|
860
|
+
/>
|
|
861
|
+
<textarea
|
|
862
|
+
value={uploadForm.description}
|
|
863
|
+
onChange={(e) => setUploadForm({ ...uploadForm, description: e.target.value })}
|
|
864
|
+
placeholder={GALLERY_COMPLEX.UI.DESCRIPTION_PLACEHOLDER}
|
|
865
|
+
className="p-2 bg-gray-700 text-white rounded-lg h-24"
|
|
866
|
+
disabled={isLoading}
|
|
867
|
+
/>
|
|
868
|
+
<select
|
|
869
|
+
value={uploadForm.category || "none"}
|
|
870
|
+
onChange={(e) =>
|
|
871
|
+
setUploadForm({
|
|
872
|
+
...uploadForm,
|
|
873
|
+
category: e.target.value as "none" | "indoor" | "outdoor" | "commercial",
|
|
874
|
+
})
|
|
875
|
+
}
|
|
876
|
+
className="p-2 bg-gray-700 text-white rounded-lg"
|
|
877
|
+
disabled={isLoading}
|
|
878
|
+
>
|
|
879
|
+
<option value="none">{GALLERY_COMPLEX.UI.CATEGORY_NONE}</option>
|
|
880
|
+
<option value="indoor">{GALLERY_COMPLEX.UI.CATEGORY_INDOOR}</option>
|
|
881
|
+
<option value="outdoor">{GALLERY_COMPLEX.UI.CATEGORY_OUTDOOR}</option>
|
|
882
|
+
<option value="commercial">{GALLERY_COMPLEX.UI.CATEGORY_COMMERCIAL}</option>
|
|
883
|
+
</select>
|
|
884
|
+
<div className="flex space-x-3">
|
|
885
|
+
<SubmitButton
|
|
886
|
+
type="submit"
|
|
887
|
+
disabled={isLoading || !uploadForm.file}
|
|
888
|
+
>
|
|
889
|
+
{isLoading ? GALLERY_COMPLEX.BUTTONS.UPLOADING_BUTTON : GALLERY_COMPLEX.BUTTONS.UPLOAD_BUTTON}
|
|
890
|
+
</SubmitButton>
|
|
891
|
+
<CancelButton
|
|
892
|
+
onClick={handleCloseUploadModal}
|
|
893
|
+
/>
|
|
894
|
+
</div>
|
|
895
|
+
</form>
|
|
896
|
+
</div>
|
|
897
|
+
</motion.div>
|
|
898
|
+
)}
|
|
899
|
+
|
|
900
|
+
<motion.div
|
|
901
|
+
initial={{ opacity: 0, scale: 0.8 }}
|
|
902
|
+
animate={{ opacity: 0, scale: 0.8 }}
|
|
903
|
+
transition={{ duration: 0.3 }}
|
|
904
|
+
className="fixed bottom-6 right-6 z-40 pb-24"
|
|
905
|
+
/>
|
|
906
|
+
</div>
|
|
907
|
+
);
|
|
908
|
+
}
|