-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[공통] 레이아웃 분리
- Loading branch information
Showing
26 changed files
with
647 additions
and
518 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 was deleted.
Oops, something went wrong.
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
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,46 @@ | ||
import { Link } from 'react-router-dom'; | ||
|
||
import AuthTitle from 'components/Auth/AuthTitle'; | ||
import { useAuth, useClearAuth } from 'store/auth'; | ||
import { useFilterFriend, useFilterNearby, useFilterScrap } from 'store/filter'; | ||
import { useSelected } from 'store/placeId'; | ||
|
||
import styles from './TopNavigation.module.scss'; | ||
|
||
export default function TopNavigation() { | ||
const auth = useAuth(); | ||
const clearAuth = useClearAuth(); | ||
const { setFilterFriend } = useFilterFriend(); | ||
const { setFilterScrap } = useFilterScrap(); | ||
const { setFilterNearby } = useFilterNearby(); | ||
const { setSelected } = useSelected(); | ||
return ( | ||
<div className={styles.navbar}> | ||
<AuthTitle /> | ||
<div className={styles.info}> | ||
{auth ? ( | ||
<> | ||
<div className={styles.info__nickname}>{auth.nickname}님</div> | ||
<Link | ||
to="/" | ||
onClick={() => { | ||
clearAuth(); setSelected(''); | ||
setFilterFriend(true); | ||
setFilterNearby(true); | ||
setFilterScrap(true); | ||
}} | ||
className={styles.info__logout} | ||
> | ||
로그아웃 | ||
</Link> | ||
</> | ||
) : ( | ||
<> | ||
<Link to="/login" className={styles.info__login}>로그인</Link> | ||
<Link to="/terms-of-service" className={styles.info__signup}>회원가입</Link> | ||
</> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
} |
File renamed without changes.
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
9 changes: 9 additions & 0 deletions
9
src/layout/TopBottomDefaultLayout/TopBottomDefaultLayout.module.scss
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,9 @@ | ||
@use "src/utils/styles/mediaQuery" as media; | ||
|
||
.main { | ||
margin-top: 80px; | ||
|
||
@include media.media-breakpoint-down(mobile) { | ||
margin: 0; | ||
} | ||
} |
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,20 @@ | ||
import { Outlet } from 'react-router-dom'; | ||
|
||
import BottomNavigation from 'components/common/BottomNavigation'; | ||
import TopNavigation from 'components/common/TopNavigation'; | ||
import useMediaQuery from 'utils/hooks/useMediaQuery'; | ||
|
||
import styles from './TopBottomDefaultLayout.module.scss'; | ||
|
||
export default function TopBottomDefaultLayout(): JSX.Element { | ||
const { isMobile } = useMediaQuery(); | ||
return ( | ||
<> | ||
{!isMobile && <TopNavigation />} | ||
<main className={styles.main}> | ||
<Outlet /> | ||
</main> | ||
{isMobile && <BottomNavigation />} | ||
</> | ||
); | ||
} |
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,9 @@ | ||
@use "src/utils/styles/mediaQuery" as media; | ||
|
||
.main { | ||
margin-top: 80px; | ||
|
||
@include media.media-breakpoint-down(mobile) { | ||
margin: 0; | ||
} | ||
} |
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,18 @@ | ||
import { Outlet } from 'react-router-dom'; | ||
|
||
import TopNavigation from 'components/common/TopNavigation'; | ||
import useMediaQuery from 'utils/hooks/useMediaQuery'; | ||
|
||
import styles from './TopDefaultLayout.module.scss'; | ||
|
||
export default function TopDefaultLayout(): JSX.Element { | ||
const { isMobile } = useMediaQuery(); | ||
return ( | ||
<> | ||
{!isMobile && <TopNavigation />} | ||
<main className={styles.main}> | ||
<Outlet /> | ||
</main> | ||
</> | ||
); | ||
} |
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
Oops, something went wrong.