@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,320 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState, useEffect, useCallback } from "react";
|
|
4
|
+
import { GallerySection } from "@/components/addOns/functional/galleries/GalleryComplex";
|
|
5
|
+
import Spinner from "@/components/addOns/non-functional/spinner";
|
|
6
|
+
import { motion } from "framer-motion";
|
|
7
|
+
import { useStrapiAuth } from "@/lib/auth-context";
|
|
8
|
+
import { useAuth } from "@clerk/nextjs";
|
|
9
|
+
import { GALLERY_PAGE } from "../constants/gallery";
|
|
10
|
+
|
|
11
|
+
interface StrapiUser {
|
|
12
|
+
id: number;
|
|
13
|
+
username: string;
|
|
14
|
+
email: string;
|
|
15
|
+
businessAdminId?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface UploadedImage {
|
|
19
|
+
id: number;
|
|
20
|
+
documentId: string;
|
|
21
|
+
title?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
url: string;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
category?: "none" | "indoor" | "outdoor" | "commercial";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default function GalleryPage() {
|
|
29
|
+
const { user, authLoading, checkSession } = useStrapiAuth();
|
|
30
|
+
const { isSignedIn, getToken } = useAuth();
|
|
31
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
32
|
+
const [error, setError] = useState<string | null>(null);
|
|
33
|
+
const [currentUploadedImages, setUploadedImages] = useState<UploadedImage[]>([]);
|
|
34
|
+
const [galleryUser, setUser] = useState<StrapiUser | null>(null);
|
|
35
|
+
const isAdmin = isSignedIn && !!user?.businessAdminId;
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
setUser(user);
|
|
39
|
+
}, [user]);
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
window.scrollTo(0, 0);
|
|
43
|
+
}, []);
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
const handleLogin = () => checkSession();
|
|
47
|
+
const handleLogout = () => checkSession();
|
|
48
|
+
window.addEventListener("user-login", handleLogin);
|
|
49
|
+
window.addEventListener("user-logout", handleLogout);
|
|
50
|
+
return () => {
|
|
51
|
+
window.removeEventListener("user-login", handleLogin);
|
|
52
|
+
window.removeEventListener("user-logout", handleLogout);
|
|
53
|
+
};
|
|
54
|
+
}, [checkSession]);
|
|
55
|
+
|
|
56
|
+
const fetchInitialData = useCallback(async () => {
|
|
57
|
+
try {
|
|
58
|
+
setIsLoading(true);
|
|
59
|
+
|
|
60
|
+
const headers: HeadersInit = { "Content-Type": "application/json" };
|
|
61
|
+
if (isSignedIn) {
|
|
62
|
+
const token = await getToken();
|
|
63
|
+
if (!token) {
|
|
64
|
+
throw new Error(GALLERY_PAGE.ERRORS.NO_AUTH_TOKEN);
|
|
65
|
+
}
|
|
66
|
+
headers.Authorization = `Bearer ${token}`;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const imagesResponse = await fetch("/api/gallery-data", {
|
|
70
|
+
headers,
|
|
71
|
+
});
|
|
72
|
+
if (!imagesResponse.ok) {
|
|
73
|
+
const errorText = await imagesResponse.text();
|
|
74
|
+
console.error("GalleryPage: Fetch images failed", { status: imagesResponse.status, errorText });
|
|
75
|
+
throw new Error(GALLERY_PAGE.ERRORS.FETCH_IMAGES_FAILED.replace("${errorText}", errorText));
|
|
76
|
+
}
|
|
77
|
+
const { data: images, meta } = await imagesResponse.json();
|
|
78
|
+
|
|
79
|
+
if (meta?.pagination?.total > 100) {
|
|
80
|
+
setError(GALLERY_PAGE.ERRORS.PAGINATION_WARNING);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
setUploadedImages(images || []);
|
|
84
|
+
} catch (err) {
|
|
85
|
+
console.error("GalleryPage: Fetch error", err);
|
|
86
|
+
setError(err instanceof Error ? err.message : GALLERY_PAGE.ERRORS.FETCH_ERROR);
|
|
87
|
+
} finally {
|
|
88
|
+
setIsLoading(false);
|
|
89
|
+
}
|
|
90
|
+
}, [isSignedIn, getToken]);
|
|
91
|
+
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
fetchInitialData();
|
|
94
|
+
}, [fetchInitialData]);
|
|
95
|
+
|
|
96
|
+
const handleImageUpload = async (
|
|
97
|
+
e: React.FormEvent<HTMLFormElement>,
|
|
98
|
+
file: File | null,
|
|
99
|
+
title: string,
|
|
100
|
+
description: string,
|
|
101
|
+
category: "none" | "indoor" | "outdoor" | "commercial"
|
|
102
|
+
) => {
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
if (!file) {
|
|
105
|
+
setError(GALLERY_PAGE.ERRORS.NO_FILE_SELECTED);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (!["image/jpeg", "image/png", "image/gif"].includes(file.type)) {
|
|
109
|
+
setError(GALLERY_PAGE.ERRORS.INVALID_FILE_TYPE);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (!isAdmin) {
|
|
113
|
+
console.error("GalleryPage: Unauthorized upload attempt", {
|
|
114
|
+
isSignedIn,
|
|
115
|
+
businessAdminId: user?.businessAdminId,
|
|
116
|
+
});
|
|
117
|
+
setError(GALLERY_PAGE.ERRORS.UNAUTHORIZED_UPLOAD);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
try {
|
|
122
|
+
setIsLoading(true);
|
|
123
|
+
const token = await getToken();
|
|
124
|
+
if (!token) {
|
|
125
|
+
setError(GALLERY_PAGE.ERRORS.AUTHENTICATION_ERROR);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const formData = new FormData();
|
|
130
|
+
formData.append("file", file);
|
|
131
|
+
formData.append("title", title || `Image ${new Date().toISOString()}`);
|
|
132
|
+
formData.append("description", description || "");
|
|
133
|
+
formData.append("category", category);
|
|
134
|
+
|
|
135
|
+
const response = await fetch("/api/gallery-data", {
|
|
136
|
+
method: "POST",
|
|
137
|
+
headers: {
|
|
138
|
+
Authorization: `Bearer ${token}`,
|
|
139
|
+
},
|
|
140
|
+
body: formData,
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
if (!response.ok) {
|
|
144
|
+
const errorData = await response.json();
|
|
145
|
+
console.error("GalleryPage: Upload failed", { status: response.status, errorData });
|
|
146
|
+
if (response.status === 401) {
|
|
147
|
+
setError(GALLERY_PAGE.ERRORS.AUTHENTICATION_ERROR);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
throw new Error(errorData.error || GALLERY_PAGE.ERRORS.UPLOAD_IMAGE_FAILED.replace("${response.status}", response.status.toString()));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const { data } = await response.json();
|
|
154
|
+
setUploadedImages(data || []);
|
|
155
|
+
setError(null);
|
|
156
|
+
} catch (err) {
|
|
157
|
+
console.error("GalleryPage: Upload Error", err);
|
|
158
|
+
setError(err instanceof Error ? err.message : GALLERY_PAGE.ERRORS.UPLOAD_IMAGE_ERROR);
|
|
159
|
+
} finally {
|
|
160
|
+
setIsLoading(false);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const handleDeleteImage = async (documentId: string) => {
|
|
165
|
+
if (!isAdmin) {
|
|
166
|
+
console.error("GalleryPage: Unauthorized delete attempt", {
|
|
167
|
+
isSignedIn,
|
|
168
|
+
businessAdminId: user?.businessAdminId,
|
|
169
|
+
});
|
|
170
|
+
setError(GALLERY_PAGE.ERRORS.UNAUTHORIZED_DELETE);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
try {
|
|
175
|
+
setIsLoading(true);
|
|
176
|
+
const token = await getToken();
|
|
177
|
+
if (!token) {
|
|
178
|
+
setError(GALLERY_PAGE.ERRORS.AUTHENTICATION_ERROR);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const response = await fetch("/api/gallery-data", {
|
|
183
|
+
method: "DELETE",
|
|
184
|
+
headers: {
|
|
185
|
+
"Content-Type": "application/json",
|
|
186
|
+
Authorization: `Bearer ${token}`,
|
|
187
|
+
},
|
|
188
|
+
body: JSON.stringify({ documentId }),
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
if (!response.ok) {
|
|
192
|
+
const errorData = await response.json();
|
|
193
|
+
console.error("GalleryPage: Delete failed", { status: response.status, errorData });
|
|
194
|
+
if (response.status === 401) {
|
|
195
|
+
setError(GALLERY_PAGE.ERRORS.AUTHENTICATION_ERROR);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
throw new Error(errorData.error || GALLERY_PAGE.ERRORS.DELETE_IMAGE_FAILED.replace("${response.status}", response.status.toString()));
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const { data } = await response.json();
|
|
202
|
+
setUploadedImages(data || []);
|
|
203
|
+
setError(null);
|
|
204
|
+
} catch (err) {
|
|
205
|
+
console.error("GalleryPage: Delete Error", err);
|
|
206
|
+
setError(err instanceof Error ? err.message : GALLERY_PAGE.ERRORS.DELETE_IMAGE_ERROR);
|
|
207
|
+
} finally {
|
|
208
|
+
setIsLoading(false);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
if (isLoading || authLoading) {
|
|
213
|
+
return <Spinner />;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return (
|
|
217
|
+
<div className="min-h-screen w-full bg-[#F7F7F7] relative overflow-hidden flex flex-col">
|
|
218
|
+
{error && <div className="text-red-500 text-center p-4">{error}</div>}
|
|
219
|
+
<style jsx>{`
|
|
220
|
+
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap");
|
|
221
|
+
|
|
222
|
+
:root {
|
|
223
|
+
--jubilee: #F47C7C;
|
|
224
|
+
--natural-white: #F7F7F7;
|
|
225
|
+
--caviar: #2D2D2D;
|
|
226
|
+
--storm-cloud: #4A636E;
|
|
227
|
+
--exuberant-blue: #FF54B4;
|
|
228
|
+
--modern-purple: #D946EF;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
* {
|
|
232
|
+
font-family: "Inter", system-ui, sans-serif;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.gradient-text {
|
|
236
|
+
background: linear-gradient(135deg, var(--exuberant-blue), var(--jubilee), var(--modern-purple));
|
|
237
|
+
-webkit-background-clip: text;
|
|
238
|
+
background-clip: text;
|
|
239
|
+
color: transparent;
|
|
240
|
+
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
@media (max-width: 1024px) {
|
|
244
|
+
.container-padding {
|
|
245
|
+
padding-left: 1.5rem;
|
|
246
|
+
padding-right: 1.5rem;
|
|
247
|
+
padding-top: 5rem;
|
|
248
|
+
padding-bottom: 5rem;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.main-heading {
|
|
252
|
+
font-size: 3rem;
|
|
253
|
+
margin-bottom: 3rem;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.content-text {
|
|
257
|
+
font-size: 1.25rem;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
@media (max-width: 640px) {
|
|
262
|
+
.container-padding {
|
|
263
|
+
padding-left: 0.5rem;
|
|
264
|
+
padding-right: 0.5rem;
|
|
265
|
+
padding-top: 4rem;
|
|
266
|
+
padding-bottom: 4rem;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.main-heading {
|
|
270
|
+
font-size: 2.5rem;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.content-text {
|
|
274
|
+
font-size: 1rem;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
`}</style>
|
|
278
|
+
<div
|
|
279
|
+
className="w-full px-6 py-20 lg:px-12 lg:py-40 flex-grow relative z-10 container-padding bg-white"
|
|
280
|
+
>
|
|
281
|
+
<motion.h1
|
|
282
|
+
initial={{ opacity: 0, y: -50 }}
|
|
283
|
+
animate={{ opacity: 1, y: 0 }}
|
|
284
|
+
className="text-4xl sm:text-5xl lg:text-7xl font-black mb-20 lg:mb-20 gradient-text text-center uppercase drop-shadow-lg main-heading pt-36 sm:pt-32"
|
|
285
|
+
>
|
|
286
|
+
{GALLERY_PAGE.UI.MAIN_HEADING}
|
|
287
|
+
</motion.h1>
|
|
288
|
+
{/* Admin Status Feedback, matching GallerySection */}
|
|
289
|
+
<div className="mb-4 text-center">
|
|
290
|
+
{authLoading || isLoading ? (
|
|
291
|
+
<p className="text-gray-400 text-sm font-medium">{GALLERY_PAGE.UI.LOADING_TEXT}</p>
|
|
292
|
+
) : isAdmin ? (
|
|
293
|
+
<p className="text-gray-400 text-sm font-medium">
|
|
294
|
+
{GALLERY_PAGE.UI.ADMIN_LOGGED_IN_MESSAGE}
|
|
295
|
+
</p>
|
|
296
|
+
) : user ? (
|
|
297
|
+
<p className="text-gray-400 text-sm font-medium">
|
|
298
|
+
</p>
|
|
299
|
+
) : (
|
|
300
|
+
<p className="text-gray-400 text-sm font-medium">
|
|
301
|
+
</p>
|
|
302
|
+
)}
|
|
303
|
+
</div>
|
|
304
|
+
<GallerySection
|
|
305
|
+
user={galleryUser}
|
|
306
|
+
setUser={setUser}
|
|
307
|
+
authLoading={authLoading}
|
|
308
|
+
uploadedImages={currentUploadedImages}
|
|
309
|
+
setUploadedImages={setUploadedImages}
|
|
310
|
+
error={error}
|
|
311
|
+
setError={setError}
|
|
312
|
+
isLoading={isLoading}
|
|
313
|
+
setIsLoading={setIsLoading}
|
|
314
|
+
handleImageUpload={handleImageUpload}
|
|
315
|
+
handleDeleteImage={handleDeleteImage}
|
|
316
|
+
/>
|
|
317
|
+
</div>
|
|
318
|
+
</div>
|
|
319
|
+
);
|
|
320
|
+
}
|
package/app/globals.css
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
/* CSS Variables - Light mode only */
|
|
6
|
+
:root {
|
|
7
|
+
--foreground-rgb: 0, 0, 0;
|
|
8
|
+
--background-start-rgb: 214, 219, 220;
|
|
9
|
+
--background-end-rgb: 255, 255, 255;
|
|
10
|
+
|
|
11
|
+
--background: 0 0% 100%;
|
|
12
|
+
--foreground: 0 0% 0%;
|
|
13
|
+
--card: 0 0% 100%;
|
|
14
|
+
--card-foreground: 0 0% 0%;
|
|
15
|
+
--popover: 0 0% 100%;
|
|
16
|
+
--popover-foreground: 0 0% 0%;
|
|
17
|
+
--primary: 0 0% 9%;
|
|
18
|
+
--primary-foreground: 0 0% 98%;
|
|
19
|
+
--secondary: 0 0% 96.1%;
|
|
20
|
+
--secondary-foreground: 0 0% 9%;
|
|
21
|
+
--muted: 0 0% 96.1%;
|
|
22
|
+
--muted-foreground: 0 0% 45.1%;
|
|
23
|
+
--accent: 0 0% 96.1%;
|
|
24
|
+
--accent-foreground: 0 0% 9%;
|
|
25
|
+
--destructive: 0 84.2% 60.2%;
|
|
26
|
+
--destructive-foreground: 0 0% 98%;
|
|
27
|
+
--border: 0 0% 89.8%;
|
|
28
|
+
--input: 0 0% 89.8%;
|
|
29
|
+
--ring: 0 0% 3.9%;
|
|
30
|
+
--chart-1: 12 76% 61%;
|
|
31
|
+
--chart-2: 173 58% 39%;
|
|
32
|
+
--chart-3: 197 37% 24%;
|
|
33
|
+
--chart-4: 43 74% 66%;
|
|
34
|
+
--chart-5: 27 87% 67%;
|
|
35
|
+
--radius: 0.5rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@layer base {
|
|
39
|
+
* {
|
|
40
|
+
@apply border-border;
|
|
41
|
+
}
|
|
42
|
+
body {
|
|
43
|
+
@apply bg-background text-foreground;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
.clip-diagonal-left {
|
|
49
|
+
clip-path: polygon(0 0, 100% 0, 0 100%);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.clip-diagonal-right {
|
|
53
|
+
clip-path: polygon(100% 0, 0% 100%, 100% 100%);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.align-items-start {
|
|
57
|
+
align-items: start;
|
|
58
|
+
}
|
package/app/layout.tsx
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import './globals.css';
|
|
2
|
+
import type { Metadata } from 'next';
|
|
3
|
+
import { Inter } from 'next/font/google';
|
|
4
|
+
import { ClerkProvider } from '@clerk/nextjs';
|
|
5
|
+
import { ThemeProvider } from "@/components/theme-provider";
|
|
6
|
+
import { AuthProvider } from "@/lib/auth-context";
|
|
7
|
+
import Navbar from '@/components/navBars/navbar';
|
|
8
|
+
import { Toaster } from "@/components/other/toaster";
|
|
9
|
+
import Footer from '@/components/footers/footer';
|
|
10
|
+
import IconBubble from '@/components/addOns/non-functional/IconBubble';
|
|
11
|
+
|
|
12
|
+
const inter = Inter({ subsets: ['latin'], preload: true });
|
|
13
|
+
|
|
14
|
+
export const metadata: Metadata = {
|
|
15
|
+
metadataBase: new URL(process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000'),
|
|
16
|
+
title: "DevVista Kit",
|
|
17
|
+
description: 'Your 24/7 fitness destination',
|
|
18
|
+
openGraph: {
|
|
19
|
+
title: "DevVista Kit",
|
|
20
|
+
description: '',
|
|
21
|
+
url: 'https://devvistatech.com/',
|
|
22
|
+
images: [{ url: '/images/FitStop.png' }],
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
27
|
+
return (
|
|
28
|
+
<ClerkProvider>
|
|
29
|
+
<html lang="en" className="h-full" suppressHydrationWarning>
|
|
30
|
+
<head>
|
|
31
|
+
<script async src={`https://www.googletagmanager.com/gtag/js?id=${process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID}`}></script>
|
|
32
|
+
<script
|
|
33
|
+
dangerouslySetInnerHTML={{
|
|
34
|
+
__html: `
|
|
35
|
+
window.dataLayer = window.dataLayer || [];
|
|
36
|
+
function gtag(){dataLayer.push(arguments);}
|
|
37
|
+
gtag('js', new Date());
|
|
38
|
+
gtag('config', '${process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID}');
|
|
39
|
+
`,
|
|
40
|
+
}}
|
|
41
|
+
/>
|
|
42
|
+
</head>
|
|
43
|
+
<body className={`${inter.className} h-full bg-gray-900 text-gray-700 antialiased`}>
|
|
44
|
+
<ThemeProvider
|
|
45
|
+
attribute="class"
|
|
46
|
+
defaultTheme="dark"
|
|
47
|
+
enableSystem={false}
|
|
48
|
+
disableTransitionOnChange
|
|
49
|
+
>
|
|
50
|
+
<AuthProvider>
|
|
51
|
+
<Navbar />
|
|
52
|
+
<main className="min-h-screen w-full">{children}</main>
|
|
53
|
+
<Toaster />
|
|
54
|
+
<Footer />
|
|
55
|
+
<IconBubble />
|
|
56
|
+
</AuthProvider>
|
|
57
|
+
</ThemeProvider>
|
|
58
|
+
</body>
|
|
59
|
+
</html>
|
|
60
|
+
</ClerkProvider>
|
|
61
|
+
);
|
|
62
|
+
}
|