diff --git a/src/app/(crew)/crew/detail/[id]/_components/create-gathering.tsx b/src/app/(crew)/crew/detail/[id]/_components/create-gathering.tsx index f513e379..064e3fca 100644 --- a/src/app/(crew)/crew/detail/[id]/_components/create-gathering.tsx +++ b/src/app/(crew)/crew/detail/[id]/_components/create-gathering.tsx @@ -1,13 +1,25 @@ 'use client'; +import { useRouter } from 'next/navigation'; import { useDisclosure } from '@mantine/hooks'; +import { useAuthStore } from '@/src/store/use-auth-store'; import CreateGatheringModalContainer from '@/src/app/(crew)/crew/_components/create-gathering-modal/container'; import Button from '@/src/components/common/input/button'; import { CreateGatheringRequestType } from '@/src/types/gathering-data'; export default function CreateGathering() { + const { isAuth } = useAuthStore(); + const router = useRouter(); const [opened, { open, close }] = useDisclosure(false); + const handleButtonClick = () => { + if (isAuth) { + open(); // 로그인 상태일 경우 모달 열기 + } else { + router.push('/login'); // 비로그인 상태일 경우 로그인 페이지로 이동 + } + }; + const initialValue: CreateGatheringRequestType = { title: '', introduce: '', @@ -19,7 +31,7 @@ export default function CreateGathering() { return ( <> - diff --git a/src/app/_components/hero/hero-crew.tsx b/src/app/_components/hero/hero-crew.tsx index 3956cf4f..3316364c 100644 --- a/src/app/_components/hero/hero-crew.tsx +++ b/src/app/_components/hero/hero-crew.tsx @@ -1,9 +1,12 @@ import Image from 'next/image'; import Link from 'next/link'; import { Button } from '@mantine/core'; +import { useAuthStore } from '@/src/store/use-auth-store'; import ImgHeroCrew from '@/public/assets/icons/ic-dumbbell.svg'; export default function HeroCrew() { + const { isAuth } = useAuthStore(); + return (
@@ -20,7 +23,7 @@ export default function HeroCrew() {