forked from kookmin-sw/cap-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kookmin-sw#2 from capstone-maru/dev
chore/docs: 프로젝트 구조 수정
- Loading branch information
Showing
5 changed files
with
24 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
'use client'; | ||
|
||
import useLoginStatus from '@/hooks/useLoginStatus'; | ||
import MainPageWithLogin from '@/pages/main-with-login'; | ||
import MainPageWithoutLogin from '@/pages/main-without-login'; | ||
|
||
export default function Home() { | ||
return <></>; | ||
const loginStatus = useLoginStatus(); | ||
|
||
return <>{loginStatus ? <MainPageWithLogin /> : <MainPageWithoutLogin />}</>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import { useAppSelector } from '@/lib/hooks'; | ||
import { useState } from 'react'; | ||
import { useEffect, useState } from 'react'; | ||
|
||
export default function useLoginStatus() { | ||
const [loginStatus, setLoginStatus] = useState(false); | ||
|
||
const status = useAppSelector(state => state.auth.status); | ||
if (status === 'logged-in') { | ||
setLoginStatus(true); | ||
} else { | ||
setLoginStatus(false); | ||
} | ||
useEffect(() => { | ||
if (status === 'logged-in') { | ||
setLoginStatus(true); | ||
} else { | ||
setLoginStatus(false); | ||
} | ||
}, [status]); | ||
|
||
return loginStatus; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function MainPageWithLogin() { | ||
return <></>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function MainPageWithoutLogin() { | ||
return <></>; | ||
} |