File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed
Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 1+ import { useRouter } from "next/router" ;
2+ import useUserStore from "@/store/useUserStore" ;
13import Image from "next/image" ;
2- import Link from "next/link" ;
34
45export default function Section1 ( ) {
6+ const user = useUserStore ( ( state ) => state . user ) ;
7+ const isLoggedIn = ! ! user ;
8+ const router = useRouter ( ) ;
9+
10+ const handleMainClick = ( ) => {
11+ if ( isLoggedIn ) {
12+ router . push ( "/mydashboard" ) ;
13+ } else {
14+ router . push ( "/login" ) ;
15+ }
16+ } ;
17+
518 return (
619 < section className = "w-full bg-[var(--color-black)] text-[var(--color-white)] px-4 pt-[94px] sm:pt-[42px] flex flex-col items-center" >
720 { /* 히어로 이미지 */ }
@@ -34,12 +47,12 @@ export default function Section1() {
3447 </ span >
3548
3649 { /* CTA 버튼 */ }
37- < Link
38- href = "/login"
39- className = "mt-[66px] w-[280px] h-[54px] flex items-center justify-center rounded-lg bg-[var(--primary)] text-[var(--color-white)] font-16m sm:mt-[70px]"
50+ < button
51+ onClick = { handleMainClick }
52+ className = "mt-[66px] w-[280px] h-[54px] flex items-center justify-center rounded-lg bg-[var(--primary)] text-[var(--color-white)] font-16m sm:mt-[70px] cursor-pointer "
4053 >
41- 로그인하기
42- </ Link >
54+ { isLoggedIn ? "대시보드 이동하기" : " 로그인하기" }
55+ </ button >
4356 </ section >
4457 ) ;
4558}
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import InvitedDashBoard from "@/components/table/invited/InvitedDashBoard";
1212import NewDashboard from "@/components/modal/NewDashboard" ;
1313import { Modal } from "@/components/modal/Modal" ;
1414import { CustomBtn } from "@/components/button/CustomButton" ;
15-
1615import LoadingSpinner from "@/components/common/LoadingSpinner" ;
1716
1817interface Dashboard {
You can’t perform that action at this time.
0 commit comments