@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,604 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState, useRef, useEffect, Dispatch, SetStateAction } 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, TrashIconButton, CloseButton, SubmitButton, CancelButton, DeleteButton } from "@/components/other/button";
|
|
9
|
+
import { Upload, X } from "lucide-react";
|
|
10
|
+
import { useUser } from "@clerk/nextjs";
|
|
11
|
+
import { useStrapiAuth } from "@/lib/auth-context";
|
|
12
|
+
import { GALLERY_SIMPLE } from "./constants/gallerySimple";
|
|
13
|
+
|
|
14
|
+
interface StrapiUser {
|
|
15
|
+
id: number;
|
|
16
|
+
username: string;
|
|
17
|
+
email: string;
|
|
18
|
+
businessAdminId?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface UploadedImage {
|
|
22
|
+
id: number;
|
|
23
|
+
documentId: string;
|
|
24
|
+
title?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
url: string;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
category?: "none" | "indoor" | "outdoor" | "commercial";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface GallerySectionProps {
|
|
32
|
+
user: StrapiUser | null;
|
|
33
|
+
authLoading: boolean;
|
|
34
|
+
uploadedImages: UploadedImage[];
|
|
35
|
+
setUploadedImages: (images: UploadedImage[]) => void;
|
|
36
|
+
error: string | null;
|
|
37
|
+
setError: (error: string | null) => void;
|
|
38
|
+
isLoading: boolean;
|
|
39
|
+
setIsLoading: Dispatch<SetStateAction<boolean>>;
|
|
40
|
+
setUser: Dispatch<SetStateAction<StrapiUser | null>>;
|
|
41
|
+
handleImageUpload: (
|
|
42
|
+
e: React.FormEvent<HTMLFormElement>,
|
|
43
|
+
file: File | null,
|
|
44
|
+
title: string,
|
|
45
|
+
description: string,
|
|
46
|
+
category: "none" | "indoor" | "outdoor" | "commercial"
|
|
47
|
+
) => Promise<void>;
|
|
48
|
+
handleDeleteImage: (documentId: string) => Promise<void>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function GallerySection({
|
|
52
|
+
user,
|
|
53
|
+
authLoading,
|
|
54
|
+
uploadedImages,
|
|
55
|
+
setUploadedImages,
|
|
56
|
+
error,
|
|
57
|
+
setError,
|
|
58
|
+
isLoading,
|
|
59
|
+
setIsLoading,
|
|
60
|
+
setUser,
|
|
61
|
+
handleImageUpload,
|
|
62
|
+
handleDeleteImage,
|
|
63
|
+
}: GallerySectionProps) {
|
|
64
|
+
const { isSignedIn } = useUser();
|
|
65
|
+
const { checkSession } = useStrapiAuth();
|
|
66
|
+
const isAdmin = isSignedIn && !!user?.businessAdminId;
|
|
67
|
+
const [activeTab, setActiveTab] = useState("photos");
|
|
68
|
+
const [selectedImage, setSelectedImage] = useState<{ url: string } | null>(null);
|
|
69
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
70
|
+
const [visiblePhotos, setVisiblePhotos] = useState(12);
|
|
71
|
+
const [isConfirmDeleteOpen, setIsConfirmDeleteOpen] = useState(false);
|
|
72
|
+
const [isUploadModalOpen, setIsUploadModalOpen] = useState(false);
|
|
73
|
+
const [documentIdToDelete, setDocumentIdToDelete] = useState<string | null>(null);
|
|
74
|
+
const [selectedFile, setSelectedFile] = useState<File | null>(null);
|
|
75
|
+
const fileInputRef = useRef<HTMLInputElement>(null);
|
|
76
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
77
|
+
const { scrollYProgress } = useScroll({
|
|
78
|
+
target: containerRef,
|
|
79
|
+
offset: ["start end", "end start"],
|
|
80
|
+
});
|
|
81
|
+
const parallaxY = useTransform(scrollYProgress, [0, 1], [0, -50]);
|
|
82
|
+
|
|
83
|
+
const videos = GALLERY_SIMPLE.UI.VIDEO_TITLES.map((title, index) => ({
|
|
84
|
+
url: [
|
|
85
|
+
"https://www.youtube.com/embed/Ch5fnKgDZH8",
|
|
86
|
+
"https://www.youtube.com/embed/XW3zDzMZNv8",
|
|
87
|
+
"https://www.youtube.com/embed/odC_X6g1uFs",
|
|
88
|
+
"https://www.youtube.com/embed/DFuBBzMi6ZA",
|
|
89
|
+
"https://www.youtube.com/embed/zZNMJyMmcFQ",
|
|
90
|
+
"https://www.youtube.com/embed/VRpbsZGU4a0",
|
|
91
|
+
"https://www.youtube.com/embed/qE14UbB3-gs",
|
|
92
|
+
"https://www.youtube.com/embed/QoVE5TqMkvU",
|
|
93
|
+
"https://www.youtube.com/embed/7Fzgw0SK-8k",
|
|
94
|
+
"https://www.youtube.com/embed/wN0j6JoliAE",
|
|
95
|
+
"https://www.youtube.com/embed/vzFZzhB8KvA",
|
|
96
|
+
"https://www.youtube.com/embed/4thuylOfM9w",
|
|
97
|
+
"https://www.youtube.com/embed/sm3l_uPtaws",
|
|
98
|
+
"https://www.youtube.com/embed/xnnlanydT5I",
|
|
99
|
+
"https://www.youtube.com/embed/jLLePKwiFpI",
|
|
100
|
+
"https://www.youtube.com/embed/pBlpMq8JbIA",
|
|
101
|
+
][index],
|
|
102
|
+
title,
|
|
103
|
+
}));
|
|
104
|
+
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
const handleLogin = () => checkSession();
|
|
107
|
+
const handleLogout = () => checkSession();
|
|
108
|
+
window.addEventListener("user-login", handleLogin);
|
|
109
|
+
window.addEventListener("user-logout", handleLogout);
|
|
110
|
+
return () => {
|
|
111
|
+
window.removeEventListener("user-login", handleLogin);
|
|
112
|
+
window.removeEventListener("user-logout", handleLogout);
|
|
113
|
+
};
|
|
114
|
+
}, [checkSession]);
|
|
115
|
+
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
const checkMobile = () => setIsMobile(window.innerWidth < 768);
|
|
118
|
+
checkMobile();
|
|
119
|
+
window.addEventListener("resize", checkMobile);
|
|
120
|
+
return () => window.removeEventListener("resize", checkMobile);
|
|
121
|
+
}, []);
|
|
122
|
+
|
|
123
|
+
useEffect(() => {
|
|
124
|
+
if (selectedImage || isConfirmDeleteOpen || isUploadModalOpen) {
|
|
125
|
+
document.body.classList.add("overflow-hidden");
|
|
126
|
+
} else {
|
|
127
|
+
document.body.classList.remove("overflow-hidden");
|
|
128
|
+
}
|
|
129
|
+
return () => {
|
|
130
|
+
document.body.classList.remove("overflow-hidden");
|
|
131
|
+
};
|
|
132
|
+
}, [selectedImage, isConfirmDeleteOpen, isUploadModalOpen]);
|
|
133
|
+
|
|
134
|
+
useEffect(() => {
|
|
135
|
+
const event = new CustomEvent("modalStateChange", {
|
|
136
|
+
detail: { isOpen: !!selectedImage || isConfirmDeleteOpen || isUploadModalOpen },
|
|
137
|
+
});
|
|
138
|
+
window.dispatchEvent(event);
|
|
139
|
+
}, [selectedImage, isConfirmDeleteOpen, isUploadModalOpen]);
|
|
140
|
+
|
|
141
|
+
useEffect(() => {
|
|
142
|
+
const handleEsc = (e: KeyboardEvent) => {
|
|
143
|
+
if (e.key === "Escape") {
|
|
144
|
+
if (isConfirmDeleteOpen) {
|
|
145
|
+
handleCancelDelete();
|
|
146
|
+
} else if (selectedImage) {
|
|
147
|
+
handleCloseModal();
|
|
148
|
+
} else if (isUploadModalOpen) {
|
|
149
|
+
handleCloseUploadModal();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
window.addEventListener("keydown", handleEsc);
|
|
154
|
+
return () => window.removeEventListener("keydown", handleEsc);
|
|
155
|
+
}, [isConfirmDeleteOpen, selectedImage, isUploadModalOpen]);
|
|
156
|
+
|
|
157
|
+
const openConfirmDelete = (documentId: string) => {
|
|
158
|
+
if (!isAdmin) {
|
|
159
|
+
setError(GALLERY_SIMPLE.ERRORS.UNAUTHORIZED_DELETE);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
setDocumentIdToDelete(documentId);
|
|
163
|
+
setIsConfirmDeleteOpen(true);
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const handleConfirmDelete = async () => {
|
|
167
|
+
if (!isAdmin) {
|
|
168
|
+
setError(GALLERY_SIMPLE.ERRORS.UNAUTHORIZED_DELETE);
|
|
169
|
+
setIsConfirmDeleteOpen(false);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (documentIdToDelete !== null) {
|
|
173
|
+
setIsLoading(true);
|
|
174
|
+
try {
|
|
175
|
+
await handleDeleteImage(documentIdToDelete);
|
|
176
|
+
} finally {
|
|
177
|
+
setIsLoading(false);
|
|
178
|
+
setIsConfirmDeleteOpen(false);
|
|
179
|
+
setDocumentIdToDelete(null);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const handleCancelDelete = () => {
|
|
185
|
+
setIsConfirmDeleteOpen(false);
|
|
186
|
+
setDocumentIdToDelete(null);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const handleImageClick = (image: UploadedImage) => {
|
|
190
|
+
setSelectedImage({ url: image.url });
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
const handleCloseModal = () => {
|
|
194
|
+
setSelectedImage(null);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const handleCloseUploadModal = () => {
|
|
198
|
+
setIsUploadModalOpen(false);
|
|
199
|
+
setSelectedFile(null);
|
|
200
|
+
if (fileInputRef.current) {
|
|
201
|
+
fileInputRef.current.value = "";
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
const handleUploadSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
|
|
206
|
+
e.preventDefault();
|
|
207
|
+
if (!isAdmin) {
|
|
208
|
+
console.error("GallerySimple: Unauthorized upload attempt", {
|
|
209
|
+
isSignedIn,
|
|
210
|
+
businessAdminId: user?.businessAdminId,
|
|
211
|
+
});
|
|
212
|
+
setError(GALLERY_SIMPLE.ERRORS.UNAUTHORIZED_UPLOAD);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (!selectedFile || selectedFile.size === 0) {
|
|
216
|
+
setError(GALLERY_SIMPLE.ERRORS.INVALID_FILE);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
setIsLoading(true);
|
|
220
|
+
try {
|
|
221
|
+
await handleImageUpload(e, selectedFile, "", "", "none");
|
|
222
|
+
} catch (err) {
|
|
223
|
+
console.error("GallerySimple: Upload Error", err);
|
|
224
|
+
setError(err instanceof Error ? err.message : GALLERY_SIMPLE.ERRORS.UPLOAD_FAILED);
|
|
225
|
+
} finally {
|
|
226
|
+
setIsLoading(false);
|
|
227
|
+
setIsUploadModalOpen(false);
|
|
228
|
+
setSelectedFile(null);
|
|
229
|
+
if (fileInputRef.current) {
|
|
230
|
+
fileInputRef.current.value = "";
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
const loadMore = () => {
|
|
236
|
+
setVisiblePhotos((prev) => prev + 12);
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
const sectionVariants = {
|
|
240
|
+
hidden: { opacity: 0 },
|
|
241
|
+
visible: {
|
|
242
|
+
opacity: 1,
|
|
243
|
+
transition: { duration: 0.8, ease: [0.16, 1, 0.3, 1], staggerChildren: 0.1 },
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
const cardVariants = {
|
|
248
|
+
hidden: { opacity: 0, y: 30 },
|
|
249
|
+
visible: {
|
|
250
|
+
opacity: 1,
|
|
251
|
+
y: 0,
|
|
252
|
+
transition: { duration: 0.5 },
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
const modalVariants = {
|
|
257
|
+
hidden: { opacity: 0, y: "100vh" },
|
|
258
|
+
visible: { opacity: 1, y: 0, transition: { duration: 0.5, ease: [0.16, 1, 0.3, 1] } },
|
|
259
|
+
exit: { opacity: 0, y: "100vh", transition: { duration: 0.3, ease: "easeIn" } },
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
return (
|
|
263
|
+
<div className="w-full">
|
|
264
|
+
<style jsx>{`
|
|
265
|
+
:root {
|
|
266
|
+
--jubilee: #F47C7C;
|
|
267
|
+
--exuberant-blue: #FF54B4;
|
|
268
|
+
--modern-purple: #D946EF;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.glassmorphism {
|
|
272
|
+
background: rgba(255, 255, 255, 0.08);
|
|
273
|
+
backdrop-filter: blur(10px);
|
|
274
|
+
-webkit-backdrop-filter: blur(10px);
|
|
275
|
+
border: 2px solid transparent;
|
|
276
|
+
border-image: linear-gradient(45deg, var(--exuberant-blue), var(--jubilee), var(--modern-purple)) 1;
|
|
277
|
+
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.modal-glassmorphism {
|
|
281
|
+
background: rgba(255, 255, 255, 0.08);
|
|
282
|
+
backdrop-filter: blur(10px);
|
|
283
|
+
-webkit-backdrop-filter: blur(10px);
|
|
284
|
+
border: 2px solid transparent;
|
|
285
|
+
border-image: linear-gradient(45deg, var(--exuberant-blue), var(--jubilee), var(--modern-purple)) 1;
|
|
286
|
+
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
|
|
287
|
+
border-radius: 2rem;
|
|
288
|
+
max-height: 90vh;
|
|
289
|
+
overflow: hidden;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
@supports not (backdrop-filter: blur(10px)) {
|
|
293
|
+
.glassmorphism {
|
|
294
|
+
background: rgba(255, 255, 255, 0.2);
|
|
295
|
+
}
|
|
296
|
+
.modal-glassmorphism {
|
|
297
|
+
background: rgba(255, 255, 255, 0.2);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
@media (max-width: 768px) {
|
|
302
|
+
.glassmorphism {
|
|
303
|
+
backdrop-filter: none;
|
|
304
|
+
background: rgba(255, 255, 255, 0.2);
|
|
305
|
+
}
|
|
306
|
+
.modal-glassmorphism {
|
|
307
|
+
padding: 1rem;
|
|
308
|
+
max-height: 85vh;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.motion-card {
|
|
313
|
+
will-change: transform, opacity;
|
|
314
|
+
}
|
|
315
|
+
`}</style>
|
|
316
|
+
<motion.div
|
|
317
|
+
variants={sectionVariants}
|
|
318
|
+
initial="hidden"
|
|
319
|
+
whileInView="visible"
|
|
320
|
+
viewport={{ once: true }}
|
|
321
|
+
className="p-4 sm:p-8 lg:p-12"
|
|
322
|
+
ref={containerRef}
|
|
323
|
+
>
|
|
324
|
+
<Tabs defaultValue="photos" className="w-full">
|
|
325
|
+
<TabsList className="grid w-full md:w-3/4 mx-auto grid-cols-2 mb-12 glassmorphism bg-[#1B2743] rounded-[2rem] p-4 h-24 border-0">
|
|
326
|
+
<TabsTrigger
|
|
327
|
+
value="photos"
|
|
328
|
+
className="rounded-[1.5rem] text-xl sm:text-2xl font-bold text-gray-200 data-[state=active]:text-white data-[state=active]:bg-blue-600/90 bg-blue-100/20 backdrop-blur-lg border border-white/10 shadow-md h-full flex items-center justify-center transition-all duration-300 content-text mr-2"
|
|
329
|
+
>
|
|
330
|
+
{GALLERY_SIMPLE.UI.PHOTOS_TAB}
|
|
331
|
+
</TabsTrigger>
|
|
332
|
+
<TabsTrigger
|
|
333
|
+
value="videos"
|
|
334
|
+
className="rounded-[1.5rem] text-xl sm:text-2xl font-bold text-gray-200 data-[state=active]:text-white data-[state=active]:bg-blue-600/90 bg-blue-100/20 backdrop-blur-lg border border-white/10 shadow-md h-full flex items-center justify-center transition-all duration-300 content-text ml-2"
|
|
335
|
+
>
|
|
336
|
+
{GALLERY_SIMPLE.UI.VIDEOS_TAB}
|
|
337
|
+
</TabsTrigger>
|
|
338
|
+
</TabsList>
|
|
339
|
+
|
|
340
|
+
<TabsContent value="photos">
|
|
341
|
+
<div className="space-y-6">
|
|
342
|
+
{error && (
|
|
343
|
+
<p className="text-red-400 text-base sm:text-lg md:text-xl text-center">{error}</p>
|
|
344
|
+
)}
|
|
345
|
+
{isAdmin && (
|
|
346
|
+
<div className="flex justify-center pb-12">
|
|
347
|
+
<ActionButton
|
|
348
|
+
onClick={() => setIsUploadModalOpen(true)}
|
|
349
|
+
className="flex items-center gap-2"
|
|
350
|
+
disabled={isLoading}
|
|
351
|
+
>
|
|
352
|
+
<Upload className="h-4 w-4 sm:h-5 sm:w-5" />
|
|
353
|
+
{GALLERY_SIMPLE.BUTTONS.UPLOAD_IMAGE_BUTTON}
|
|
354
|
+
</ActionButton>
|
|
355
|
+
</div>
|
|
356
|
+
)}
|
|
357
|
+
{uploadedImages.length > 0 ? (
|
|
358
|
+
<>
|
|
359
|
+
<motion.div
|
|
360
|
+
className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-2 sm:gap-8"
|
|
361
|
+
style={{ y: isMobile ? 0 : parallaxY }}
|
|
362
|
+
>
|
|
363
|
+
{uploadedImages.slice(0, visiblePhotos).map((image, index) => (
|
|
364
|
+
<motion.div
|
|
365
|
+
key={image.documentId}
|
|
366
|
+
variants={cardVariants}
|
|
367
|
+
initial="hidden"
|
|
368
|
+
whileInView="visible"
|
|
369
|
+
viewport={{ once: true, amount: 0.2 }}
|
|
370
|
+
onClick={() => handleImageClick(image)}
|
|
371
|
+
className="cursor-pointer motion-card"
|
|
372
|
+
>
|
|
373
|
+
<Card className="overflow-hidden glassmorphism rounded-[1.5rem] shadow-4xl p-2 sm:p-4 relative">
|
|
374
|
+
<div className="relative w-full aspect-[3/2]">
|
|
375
|
+
<Image
|
|
376
|
+
src={image.url}
|
|
377
|
+
alt={GALLERY_SIMPLE.UI.DEFAULT_IMAGE_ALT}
|
|
378
|
+
fill
|
|
379
|
+
className="object-cover object-center rounded-[1rem] transition-all duration-300"
|
|
380
|
+
priority={index === 0}
|
|
381
|
+
loading={index === 0 ? "eager" : "lazy"}
|
|
382
|
+
quality={85}
|
|
383
|
+
/>
|
|
384
|
+
</div>
|
|
385
|
+
{isAdmin && (
|
|
386
|
+
<TrashIconButton
|
|
387
|
+
onClick={(e) => {
|
|
388
|
+
e.stopPropagation();
|
|
389
|
+
openConfirmDelete(image.documentId);
|
|
390
|
+
}}
|
|
391
|
+
aria-label={GALLERY_SIMPLE.UI.DELETE_BUTTON_ARIA.replace("${image.title || image.documentId}", image.title || image.documentId)}
|
|
392
|
+
/>
|
|
393
|
+
)}
|
|
394
|
+
</Card>
|
|
395
|
+
</motion.div>
|
|
396
|
+
))}
|
|
397
|
+
</motion.div>
|
|
398
|
+
{visiblePhotos < uploadedImages.length && (
|
|
399
|
+
<div className="mt-8 text-center">
|
|
400
|
+
<ActionButton
|
|
401
|
+
onClick={loadMore}
|
|
402
|
+
className="flex items-center gap-2"
|
|
403
|
+
>
|
|
404
|
+
{GALLERY_SIMPLE.BUTTONS.LOAD_MORE_BUTTON}
|
|
405
|
+
</ActionButton>
|
|
406
|
+
</div>
|
|
407
|
+
)}
|
|
408
|
+
</>
|
|
409
|
+
) : (
|
|
410
|
+
<p className="text-center text-gray-700 font-bold text-base sm:text-lg md:text-xl">
|
|
411
|
+
{GALLERY_SIMPLE.UI.NO_IMAGES_MESSAGE}
|
|
412
|
+
</p>
|
|
413
|
+
)}
|
|
414
|
+
<div className="mt-4 text-center">
|
|
415
|
+
{authLoading || isLoading ? (
|
|
416
|
+
<p className="text-gray-400 text-sm font-medium">{GALLERY_SIMPLE.UI.LOADING_MESSAGE}</p>
|
|
417
|
+
) : isAdmin ? (
|
|
418
|
+
<p className="text-gray-400 text-sm font-medium">{GALLERY_SIMPLE.UI.ADMIN_LOGGED_IN_MESSAGE}</p>
|
|
419
|
+
) : user ? (
|
|
420
|
+
<p className="text-gray-400 text-sm font-medium"></p>
|
|
421
|
+
) : (
|
|
422
|
+
<p className="text-gray-400 text-sm font-medium"></p>
|
|
423
|
+
)}
|
|
424
|
+
</div>
|
|
425
|
+
</div>
|
|
426
|
+
</TabsContent>
|
|
427
|
+
|
|
428
|
+
<TabsContent value="videos">
|
|
429
|
+
<motion.div
|
|
430
|
+
className="grid md:grid-cols-2 lg:grid-cols-3 gap-2 sm:gap-4"
|
|
431
|
+
style={{ y: isMobile ? 0 : parallaxY }}
|
|
432
|
+
>
|
|
433
|
+
{videos.map((video, index) => (
|
|
434
|
+
<motion.div
|
|
435
|
+
key={index}
|
|
436
|
+
variants={cardVariants}
|
|
437
|
+
initial="hidden"
|
|
438
|
+
whileInView="visible"
|
|
439
|
+
viewport={{ once: true, amount: 0.2 }}
|
|
440
|
+
className="motion-card"
|
|
441
|
+
>
|
|
442
|
+
<Card className="overflow-hidden glassmorphism rounded-[1.5rem] shadow-4xl p-4">
|
|
443
|
+
<div className="relative w-full aspect-[16/9]">
|
|
444
|
+
<iframe
|
|
445
|
+
width="100%"
|
|
446
|
+
height="100%"
|
|
447
|
+
src={video.url}
|
|
448
|
+
title={video.title}
|
|
449
|
+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
|
450
|
+
allowFullScreen
|
|
451
|
+
className="border-0 rounded-[1rem]"
|
|
452
|
+
loading="lazy"
|
|
453
|
+
/>
|
|
454
|
+
</div>
|
|
455
|
+
<p className="text-gray-700 text-xl sm:text-2xl font-bold mt-4 text-center drop-shadow-md content-text">
|
|
456
|
+
{video.title}
|
|
457
|
+
</p>
|
|
458
|
+
</Card>
|
|
459
|
+
</motion.div>
|
|
460
|
+
))}
|
|
461
|
+
</motion.div>
|
|
462
|
+
</TabsContent>
|
|
463
|
+
</Tabs>
|
|
464
|
+
</motion.div>
|
|
465
|
+
|
|
466
|
+
{selectedImage && (
|
|
467
|
+
<motion.div
|
|
468
|
+
variants={modalVariants}
|
|
469
|
+
initial="hidden"
|
|
470
|
+
animate="visible"
|
|
471
|
+
exit="exit"
|
|
472
|
+
className="fixed inset-0 bg-black/90 flex items-center justify-center z-[10000] p-4 isolate"
|
|
473
|
+
onClick={handleCloseModal}
|
|
474
|
+
role="dialog"
|
|
475
|
+
aria-modal="true"
|
|
476
|
+
aria-labelledby="modal-image"
|
|
477
|
+
>
|
|
478
|
+
<div
|
|
479
|
+
className="relative max-w-5xl w-full mx-4 p-6 bg-gray-800/50 border border-gray-700/50 rounded-lg shadow-lg max-h-[90vh] overflow-y-auto"
|
|
480
|
+
onClick={(e) => e.stopPropagation()}
|
|
481
|
+
>
|
|
482
|
+
<CloseButton
|
|
483
|
+
variant="close-form"
|
|
484
|
+
onClick={handleCloseModal}
|
|
485
|
+
>
|
|
486
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8" />
|
|
487
|
+
</CloseButton>
|
|
488
|
+
<div className="relative w-full h-[80vh]">
|
|
489
|
+
<Image
|
|
490
|
+
src={selectedImage.url}
|
|
491
|
+
alt={GALLERY_SIMPLE.UI.DEFAULT_IMAGE_ALT}
|
|
492
|
+
fill
|
|
493
|
+
className="object-contain rounded-lg"
|
|
494
|
+
quality={85}
|
|
495
|
+
/>
|
|
496
|
+
</div>
|
|
497
|
+
</div>
|
|
498
|
+
</motion.div>
|
|
499
|
+
)}
|
|
500
|
+
|
|
501
|
+
{isConfirmDeleteOpen && isAdmin && (
|
|
502
|
+
<motion.div
|
|
503
|
+
variants={modalVariants}
|
|
504
|
+
initial="hidden"
|
|
505
|
+
animate="visible"
|
|
506
|
+
exit="exit"
|
|
507
|
+
className="fixed inset-0 bg-black/90 flex items-center justify-center z-[10000] p-4 isolate"
|
|
508
|
+
onClick={handleCancelDelete}
|
|
509
|
+
role="dialog"
|
|
510
|
+
aria-modal="true"
|
|
511
|
+
aria-labelledby="modal-title"
|
|
512
|
+
>
|
|
513
|
+
<div
|
|
514
|
+
className="relative max-w-md w-full mx-4 p-6 bg-gray-800/50 border border-gray-700/50 rounded-lg shadow-lg"
|
|
515
|
+
onClick={(e) => e.stopPropagation()}
|
|
516
|
+
>
|
|
517
|
+
<CloseButton
|
|
518
|
+
onClick={handleCancelDelete}
|
|
519
|
+
>
|
|
520
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8" />
|
|
521
|
+
</CloseButton>
|
|
522
|
+
<h3 id="modal-title" className="text-xl font-bold text-white mb-4">
|
|
523
|
+
{GALLERY_SIMPLE.UI.DELETE_MODAL_HEADING}
|
|
524
|
+
</h3>
|
|
525
|
+
<p className="text-gray-300 text-sm mb-4">
|
|
526
|
+
{GALLERY_SIMPLE.UI.DELETE_CONFIRMATION_MESSAGE}
|
|
527
|
+
</p>
|
|
528
|
+
<div className="flex space-x-3">
|
|
529
|
+
<DeleteButton
|
|
530
|
+
onClick={handleConfirmDelete}
|
|
531
|
+
disabled={isLoading}
|
|
532
|
+
>
|
|
533
|
+
{isLoading ? GALLERY_SIMPLE.BUTTONS.DELETING_BUTTON : GALLERY_SIMPLE.BUTTONS.DELETE_BUTTON}
|
|
534
|
+
</DeleteButton>
|
|
535
|
+
<CancelButton
|
|
536
|
+
onClick={handleCancelDelete}
|
|
537
|
+
/>
|
|
538
|
+
</div>
|
|
539
|
+
</div>
|
|
540
|
+
</motion.div>
|
|
541
|
+
)}
|
|
542
|
+
|
|
543
|
+
{isUploadModalOpen && isAdmin && (
|
|
544
|
+
<motion.div
|
|
545
|
+
variants={modalVariants}
|
|
546
|
+
initial="hidden"
|
|
547
|
+
animate="visible"
|
|
548
|
+
exit="exit"
|
|
549
|
+
className="fixed inset-0 bg-black/90 flex items-center justify-center z-[10000] p-4 isolate"
|
|
550
|
+
onClick={handleCloseUploadModal}
|
|
551
|
+
role="dialog"
|
|
552
|
+
aria-modal="true"
|
|
553
|
+
aria-labelledby="upload-modal-title"
|
|
554
|
+
>
|
|
555
|
+
<div
|
|
556
|
+
className="relative max-w-md w-full mx-4 p-6 bg-gray-800/50 border border-gray-700/50 rounded-lg shadow-lg"
|
|
557
|
+
onClick={(e) => e.stopPropagation()}
|
|
558
|
+
>
|
|
559
|
+
<CloseButton
|
|
560
|
+
onClick={handleCloseUploadModal}
|
|
561
|
+
>
|
|
562
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8" />
|
|
563
|
+
</CloseButton>
|
|
564
|
+
<h3 id="upload-modal-title" className="text-xl font-bold text-white mb-4">
|
|
565
|
+
{GALLERY_SIMPLE.UI.UPLOAD_MODAL_HEADING}
|
|
566
|
+
</h3>
|
|
567
|
+
<form
|
|
568
|
+
onSubmit={handleUploadSubmit}
|
|
569
|
+
className="flex flex-col space-y-4"
|
|
570
|
+
>
|
|
571
|
+
<input
|
|
572
|
+
type="file"
|
|
573
|
+
accept="image/jpeg,image/png,image/gif"
|
|
574
|
+
onChange={(e) => {
|
|
575
|
+
setSelectedFile(e.target.files?.[0] || null);
|
|
576
|
+
}}
|
|
577
|
+
disabled={isLoading}
|
|
578
|
+
className="hidden"
|
|
579
|
+
id="image-upload"
|
|
580
|
+
/>
|
|
581
|
+
<label htmlFor="image-upload" className="cursor-pointer">
|
|
582
|
+
<div className="flex items-center justify-between bg-gray-700 text-white px-4 py-2 rounded-lg">
|
|
583
|
+
<span>{selectedFile ? selectedFile.name : GALLERY_SIMPLE.UI.CHOOSE_IMAGE_TEXT}</span>
|
|
584
|
+
<Upload className="h-4 w-4" />
|
|
585
|
+
</div>
|
|
586
|
+
</label>
|
|
587
|
+
<div className="flex space-x-3">
|
|
588
|
+
<SubmitButton
|
|
589
|
+
type="submit"
|
|
590
|
+
disabled={isLoading || !selectedFile}
|
|
591
|
+
>
|
|
592
|
+
{isLoading ? GALLERY_SIMPLE.BUTTONS.UPLOADING_BUTTON : GALLERY_SIMPLE.BUTTONS.UPLOAD_BUTTON}
|
|
593
|
+
</SubmitButton>
|
|
594
|
+
<CancelButton
|
|
595
|
+
onClick={handleCloseUploadModal}
|
|
596
|
+
/>
|
|
597
|
+
</div>
|
|
598
|
+
</form>
|
|
599
|
+
</div>
|
|
600
|
+
</motion.div>
|
|
601
|
+
)}
|
|
602
|
+
</div>
|
|
603
|
+
);
|
|
604
|
+
}
|