Skip to content

Commit 010bf25

Browse files
authored
Merge pull request #36 from DevKor-github/feat/#22/post
feat: navigator 메인 탭 네 개에서만 보여주기
2 parents fd29e65 + 19f51b1 commit 010bf25

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/pages/Layout.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
import Navigator from '@/common/components/Navigator';
22
import { css } from '@styled-system/css';
3-
import { Outlet } from 'react-router';
3+
import { Outlet, useLocation } from 'react-router';
44

55
/**
66
* 모든 페이지들이 공유하는 Layout이에요
77
*/
88
const Layout = () => {
9+
const { pathname } = useLocation();
10+
11+
const visiblePaths = ['/', '/pick', '/chat', '/my'];
12+
const showNav = visiblePaths.includes(pathname);
13+
914
return (
1015
<div className={css({ position: 'fixed', top: 0, right: 0, bottom: 0, left: 0 })}>
1116
<Outlet />
12-
<Navigator />
17+
{showNav && <Navigator />}
1318
</div>
1419
);
1520
};

0 commit comments

Comments
 (0)