-
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 #41 from mash-up-kr/feature/header
Header, Layout 컴포넌트 추가
- Loading branch information
Showing
12 changed files
with
139 additions
and
2 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,52 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import * as Styled from './Header.styled'; | ||
|
||
import Logo from '@/assets/svg/logo-admin-272.svg'; | ||
import { | ||
NavigationItem, | ||
NavigationSize, | ||
} from '@/components/common/Navigation/Navigation.component'; | ||
import { Team, Role } from '@/components/common/UserProfile/UserProfile.component'; | ||
|
||
import { colors } from '@/styles'; | ||
|
||
import { Navigation, UserProfile } from '@/components'; | ||
|
||
// TODO: (@mango90): router 변경해주기 | ||
const navigationItems: NavigationItem[] = [ | ||
{ | ||
label: '지원서 내역', | ||
to: window.location.pathname, | ||
}, | ||
{ | ||
label: 'SMS 발송 내역', | ||
to: '/1', | ||
}, | ||
{ | ||
label: '지원서 설문지 내역', | ||
to: '/2', | ||
}, | ||
]; | ||
|
||
const Header = () => { | ||
return ( | ||
<Styled.HeaderContainer> | ||
<Styled.HeaderContainerInner> | ||
<Link to="/"> | ||
<Logo /> | ||
<Styled.VisuallyHiddenLogo>Mash-Up Adminsoo</Styled.VisuallyHiddenLogo> | ||
</Link> | ||
<Navigation | ||
size={NavigationSize.md} | ||
items={navigationItems} | ||
inActiveColor={colors.gray70} | ||
showBottomBorder={false} | ||
/> | ||
<UserProfile team={Team.branding} role={Role.subLeader} /> | ||
</Styled.HeaderContainerInner> | ||
</Styled.HeaderContainer> | ||
); | ||
}; | ||
|
||
export default 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
import { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
import Header from './Header.component'; | ||
|
||
export default { | ||
title: 'Header', | ||
component: Header, | ||
} as ComponentMeta<typeof Header>; | ||
|
||
const Template: ComponentStory<typeof Header> = () => <Header />; | ||
|
||
export const header = Template.bind({}); |
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,24 @@ | ||
import { css } from '@emotion/react'; | ||
import styled from '@emotion/styled'; | ||
import { HEADER_HEIGHT } from '@/constants'; | ||
|
||
export const HeaderContainer = styled.header` | ||
${({ theme }) => css` | ||
height: ${HEADER_HEIGHT}; | ||
border-bottom: 0.1rem solid ${theme.colors.gray30}; | ||
`} | ||
`; | ||
|
||
export const HeaderContainerInner = styled.div` | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
max-width: 120rem; | ||
margin: 0 auto; | ||
`; | ||
|
||
export const VisuallyHiddenLogo = styled.h2` | ||
${({ theme }) => css` | ||
${theme.a11y.visuallyHidden}; | ||
`} | ||
`; |
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,17 @@ | ||
import React from 'react'; | ||
import { Outlet } from 'react-router-dom'; | ||
import { Header } from '@/components'; | ||
import * as Styled from './Layout.styled'; | ||
|
||
const Layout = () => { | ||
return ( | ||
<> | ||
<Header /> | ||
<Styled.Main> | ||
<Outlet /> | ||
</Styled.Main> | ||
</> | ||
); | ||
}; | ||
|
||
export default Layout; |
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,8 @@ | ||
import styled from '@emotion/styled'; | ||
import { HEADER_HEIGHT } from '@/constants'; | ||
|
||
export const Main = styled.main` | ||
max-width: 120rem; | ||
min-height: calc(100vh - ${HEADER_HEIGHT}); | ||
margin: 0 auto; | ||
`; |
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 @@ | ||
import React from 'react'; | ||
|
||
import { LinkProps as ReactRouterDomLinkProps, Link as ReactRouterDomLink } from 'react-router-dom'; | ||
|
||
const Link = ({ children, ...restProps }: ReactRouterDomLinkProps) => { | ||
return <ReactRouterDomLink {...restProps}>{children}</ReactRouterDomLink>; | ||
}; | ||
|
||
export default Link; |
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 @@ | ||
export * from './ui'; |
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 const HEADER_HEIGHT = '7rem'; |