-
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.
login 페이지에 적용해 두었던 AppBar를 공통 컴포넌트로 분리함 - DefaultLayout.tsx 파일은 필요없을 것 같아 제거 - _app.tsx 에 Header컴포넌트 공통으로 적용 ref #38
- Loading branch information
Showing
5 changed files
with
72 additions
and
51 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = () => ( | ||
<StyledAppBar> | ||
{/* passHref: href 속성을 Link의 children에게 전달 */} | ||
<Link href="/main" passHref> | ||
<Text>Writing Hub</Text> | ||
</Link> | ||
<Button outline="black" size="md"> | ||
로그인 | ||
</Button> | ||
</StyledAppBar> | ||
); | ||
export function Header() { | ||
const handleRouting = (path: string) => { | ||
Router.push(path); | ||
}; | ||
|
||
export default Header; | ||
return ( | ||
<AppBar | ||
sticky={true} | ||
css={{ | ||
paddingTop: '$sp-16', | ||
justifyContent: 'space-around', | ||
borderBottom: '1px solid $gray', | ||
height: '4rem', | ||
}} | ||
> | ||
<Text | ||
weight="bold" | ||
css={{ | ||
color: '#333333', | ||
cursor: 'pointer', | ||
}} | ||
onClick={() => handleRouting('/')} | ||
> | ||
Writing Hub | ||
</Text> | ||
<Box> | ||
{/* TODO: 로그인 세션에 따라서 다르게 처리하도록 수정 필요 */} | ||
{/* <HeaderButton size="lg" color="white" outline="black"> | ||
필명등록 | ||
</HeaderButton> | ||
<HeaderButton size="lg" color="white" outline="black"> | ||
로그아웃 | ||
</HeaderButton> | ||
<HeaderButton size="lg" color="white" outline="black"> | ||
내피드 | ||
</HeaderButton> */} | ||
<HeaderButton | ||
size="lg" | ||
color="white" | ||
outline="black" | ||
onClick={() => handleRouting('/login')} | ||
> | ||
로그인 | ||
</HeaderButton> | ||
</Box> | ||
</AppBar> | ||
); | ||
} |
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 @@ | ||
export * from './Header'; |
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