diff --git a/src/components/EventCard.tsx b/src/components/EventCard.tsx index d0995e6..686529a 100644 --- a/src/components/EventCard.tsx +++ b/src/components/EventCard.tsx @@ -121,7 +121,7 @@ export default function EventCard({ key={`card-${publicId}`} className="w-full rounded-lg border border-border" > - +

{title}

@@ -151,7 +151,7 @@ export default function EventCard({
- +
diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 1a70c4e..446632e 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -2,12 +2,14 @@ import ProfileButton from '@/components/ProfileButton'; import { Button } from '@/components/ui/button'; import useAuth from '@/hooks/useAuth'; import useAuthStore from '@/hooks/useAuthStore'; +import useLayoutStore from '@/hooks/useLayoutStore'; import { useEffect } from 'react'; import { Link, useLocation } from 'react-router'; export default function Header() { const { user, handleLogout, refreshUser } = useAuth(); const isLoggedIn = useAuthStore((state) => state.isLoggedIn); + const isSubheaderActive = useLayoutStore((state) => state.isSubheaderActive); const setRedirectUrl = useAuthStore((state) => state.setRedirectUrl); const location = useLocation(); @@ -37,7 +39,9 @@ export default function Header() { }, [isLoggedIn, refreshUser]); return ( -
+
diff --git a/src/components/Subheader.tsx b/src/components/Subheader.tsx index 046ea07..f75175f 100644 --- a/src/components/Subheader.tsx +++ b/src/components/Subheader.tsx @@ -16,7 +16,9 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; +import useLayoutStore from '@/hooks/useLayoutStore'; import { ChevronLeftIcon, EllipsisVertical } from 'lucide-react'; +import { useEffect } from 'react'; type DropdownOptions = { onEditClick: () => void; @@ -32,6 +34,15 @@ export default function Subheader({ onBackClick: () => void; dropdownOptions?: DropdownOptions; }) { + const setSubheaderActive = useLayoutStore( + (state) => state.setSubheaderActive + ); + + useEffect(() => { + setSubheaderActive(true); + return () => setSubheaderActive(false); + }, [setSubheaderActive]); + return (
diff --git a/src/components/ui/alert-dialog.tsx b/src/components/ui/alert-dialog.tsx index 6cacf1b..60bccdc 100644 --- a/src/components/ui/alert-dialog.tsx +++ b/src/components/ui/alert-dialog.tsx @@ -53,7 +53,7 @@ function AlertDialogContent({ void; +} + +const useLayoutStore = create((set) => ({ + isSubheaderActive: false, + setSubheaderActive: (active) => set({ isSubheaderActive: active }), +})); + +export default useLayoutStore; diff --git a/src/routes/EventMain.tsx b/src/routes/EventMain.tsx index 0add14f..d6f312e 100644 --- a/src/routes/EventMain.tsx +++ b/src/routes/EventMain.tsx @@ -9,7 +9,7 @@ import { X, } from 'lucide-react'; import { type ComponentProps, useEffect, useState } from 'react'; -import { useNavigate, useParams } from 'react-router'; +import { useLocation, useNavigate, useParams } from 'react-router'; import { toast } from 'sonner'; // Hooks @@ -44,7 +44,9 @@ import { formatEventDate, getRemainingTime } from '@/utils/date'; export default function EventMain() { const { id } = useParams<{ id: string }>(); const navigate = useNavigate(); + const location = useLocation(); const queryClient = useQueryClient(); + const fromHome = location.state?.fromHome; const { user, isLoggedIn } = useAuth(); const { removeGuestRegistration } = useAuthStore(); @@ -158,14 +160,18 @@ export default function EventMain() { return (
{/* 1. 상단 네비게이션 */} - {view === 'ADMIN' && ( + {(fromHome || view === 'ADMIN') && ( navigate('/')} - dropdownOptions={{ - onEditClick: () => navigate('edit'), - onDeleteClick: onDeleteClick, - }} + dropdownOptions={ + view === 'ADMIN' + ? { + onEditClick: () => navigate('edit'), + onDeleteClick: onDeleteClick, + } + : undefined + } /> )} diff --git a/src/routes/EventRegister.tsx b/src/routes/EventRegister.tsx index 274e2a1..ee12115 100644 --- a/src/routes/EventRegister.tsx +++ b/src/routes/EventRegister.tsx @@ -79,7 +79,7 @@ export default function EventRegister() { return (
{/* 1. 상단 네비게이션 */} - navigate(-1)} /> + navigate(-1)} /> {/* 2. 메인 콘텐츠 */}
diff --git a/src/routes/Guests.tsx b/src/routes/Guests.tsx index d037324..95ce5cd 100644 --- a/src/routes/Guests.tsx +++ b/src/routes/Guests.tsx @@ -108,22 +108,22 @@ export default function Guests() { page.participants.map((guest) => (
-
+
- + {guest.name} {guest.email ? ( - + {guest.email} ) : null} {guest.status === 'WAITLISTED' && ( - + 대기 {guest.waitingNum}번 )} @@ -136,7 +136,7 @@ export default function Guests() {