diff --git a/src/pages/index.js b/src/pages/index.js index 8cd6f88..cb1244d 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -9,7 +9,6 @@ import HeroSection from 'src/views/home/HeroSection' import SponsorsSection from 'src/views/home/SponsorsSection' import FeaturedEvents from 'src/views/home/FeaturedEvents' -import DJHighlightSection from 'src/views/home/DJHighlightSection' import PublicFooter from 'src/views/home/PublicFooter' import { fetchHomeData } from 'src/store/slices/eventsSlice' @@ -53,7 +52,6 @@ const Home = () => { {/**/} - diff --git a/src/views/home/DJHighlightSection.js b/src/views/home/DJHighlightSection.js deleted file mode 100644 index d71bbc4..0000000 --- a/src/views/home/DJHighlightSection.js +++ /dev/null @@ -1,218 +0,0 @@ -import { useEffect, useState } from 'react' -import { useRouter } from 'next/router' -import Box from '@mui/material/Box' -import Container from '@mui/material/Container' -import Typography from '@mui/material/Typography' -import Button from '@mui/material/Button' -import Skeleton from '@mui/material/Skeleton' -import { alpha } from '@mui/material/styles' -import { motion } from 'framer-motion' -import { useAppPalette } from 'src/components/palette' -import Icon from 'src/components/Icon' -import axios from 'axios' - -const MotionBox = motion(Box) - -const DJ_DEPARTMENT_ID = 17 - -function getEventImage(event) { - if (event?.images && Array.isArray(event.images) && event.images.length > 0) { - const img = event.images[0] - return typeof img === 'string' ? img : img?.url || null - } - return null -} - -export default function DJHighlightSection() { - const c = useAppPalette() - const router = useRouter() - const [event, setEvent] = useState(null) - const [loading, setLoading] = useState(true) - - useEffect(() => { - let cancelled = false - axios - .get(`/api/events?departmentId=${DJ_DEPARTMENT_ID}&limit=1`) - .then(res => { - if (cancelled) return - const events = res.data?.data || [] - if (events.length > 0) setEvent(events[0]) - }) - .catch(() => {}) - .finally(() => { if (!cancelled) setLoading(false) }) - return () => { cancelled = true } - }, []) - - // Don't render anything if no DJ event found - if (!loading && !event) return null - - const imageUrl = event ? getEventImage(event) : null - const accent = c.primary - - return ( - - {/* Subtle background glow */} - - - - {/* Section heading */} - - - Don't Miss - - - The DJ Evening - - - - {/* Event card */} - - {/* Image */} - - {loading ? ( - - ) : imageUrl ? ( - - ) : ( - - )} - - - {/* Bottom bar with name + button */} - - {loading ? ( - <> - - - - ) : ( - <> - - {event?.name || 'DJ Evening'} - - - - - )} - - - - - ) -}