diff --git a/components/layout/DefaultLayout.tsx b/components/layout/DefaultLayout.tsx deleted file mode 100644 index bb9a5ba..0000000 --- a/components/layout/DefaultLayout.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { HTMLAttributes } from 'react'; -import { styled } from '@nolmungshemung/ui-kits'; - -const StyledMainLayout = styled('div', { - display: 'grid', - gridTemplateAreas: ` - "header" - "main" - `, - gridTemplateRows: '5rem 1fr', - height: '100vh', - margin: 0, - padding: 0, -}); - -const MainLayout = (props: HTMLAttributes) => ( - {props.children} -); - -export default MainLayout; diff --git a/components/layout/Header.tsx b/components/layout/Header.tsx index 001d857..e03ea2d 100644 --- a/components/layout/Header.tsx +++ b/components/layout/Header.tsx @@ -1,29 +1,59 @@ -import Link from 'next/link'; -import { Text, Button, AppBar, styled } from '@nolmungshemung/ui-kits'; +import { AppBar, Text, Button, Box, styled } from '@nolmungshemung/ui-kits'; +import Router from 'next/router'; -const StyledAppBar = styled(AppBar, { - gridArea: 'header', - display: 'flex', - alignItems: 'center', - borderBottom: 'solid 1px $gray', - ':nth-child(1)': { - marginLeft: '22.5rem', - }, - ':nth-child(2)': { - marginLeft: '68.75rem', - }, +const HeaderButton = styled(Button, { + width: '5rem', + padding: '0 $sp-20', + height: '$height-md !important', + cursor: 'pointer', + marginRight: '$sp-12', }); -const Header = () => ( - - {/* passHref: href 속성을 Link의 children에게 전달 */} - - Writing Hub - - - -); +export function Header() { + const handleRouting = (path: string) => { + Router.push(path); + }; -export default Header; + return ( + + handleRouting('/')} + > + Writing Hub + + + {/* TODO: 로그인 세션에 따라서 다르게 처리하도록 수정 필요 */} + {/* + 필명등록 + + + 로그아웃 + + + 내피드 + */} + handleRouting('/login')} + > + 로그인 + + + + ); +} diff --git a/components/layout/index.ts b/components/layout/index.ts new file mode 100644 index 0000000..266dec8 --- /dev/null +++ b/components/layout/index.ts @@ -0,0 +1 @@ +export * from './Header'; diff --git a/pages/_app.tsx b/pages/_app.tsx index b07ac17..fc17fdb 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -4,6 +4,8 @@ import { ReactQueryDevtools } from 'react-query/devtools'; import { APP_STAGE } from '~/shared/constants/environments'; import { globalCss } from '@nolmungshemung/ui-kits'; import { reset } from 'stitches-reset'; +import { DefaultSeo } from 'next-seo'; +import { Header } from '~/components/layout'; globalCss({ ...reset, @@ -33,12 +35,16 @@ queryClient.setDefaultOptions({ function MyApp({ Component, pageProps }: AppProps) { return ( - - - - - - + <> + + + +
+ + + + + ); } diff --git a/pages/_document.tsx b/pages/_document.tsx index 011a9b2..1a1f56f 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -7,6 +7,10 @@ export default class MyDocument extends Document { return ( +