-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: 마이페이지 회원 탈퇴 버튼 위치를 수정한다. (#332)
* refactor: content header 생성 및 적용 * refactor: 마이페이지 회원 탈퇴, 로그아웃 위치 수정 * test: contentHeader storybook 작성 * refactor: verticalDivider 분리 * refactor: aria-hidden 추가
- Loading branch information
1 parent
4dbea93
commit eb25ea3
Showing
11 changed files
with
91 additions
and
64 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
frontend/src/components/@common/ContentHeader/ContentHeader.stories.tsx
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 type { Meta, StoryObj } from '@storybook/react'; | ||
import ContentHeader from '.'; | ||
|
||
const meta: Meta<typeof ContentHeader> = { | ||
component: ContentHeader, | ||
args: {}, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof ContentHeader>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
title: '콘텐츠 헤더 입니다.', | ||
}, | ||
}; |
21 changes: 21 additions & 0 deletions
21
frontend/src/components/@common/ContentHeader/ContentHeader.style.ts
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,21 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const HeaderBox = styled.header` | ||
position: sticky; | ||
z-index: ${({ theme: { zIndex } }) => zIndex.sticky}; | ||
top: 0; | ||
display: flex; | ||
align-items: center; | ||
height: 68px; | ||
background: ${(props) => props.theme.color.background}; | ||
border-bottom: solid 1px ${(props) => props.theme.color.gray}; | ||
`; | ||
|
||
export const Title = styled.p` | ||
width: 100%; | ||
font: normal 2.4rem /3.2rem 'GmarketSans'; | ||
text-align: center; | ||
`; |
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,15 @@ | ||
import { HeaderBox, Title } from './ContentHeader.style'; | ||
|
||
interface ContentHeaderProps { | ||
title: string; | ||
} | ||
|
||
const ContentHeader = ({ title }: ContentHeaderProps) => { | ||
return ( | ||
<HeaderBox> | ||
<Title>{title}</Title> | ||
</HeaderBox> | ||
); | ||
}; | ||
|
||
export default ContentHeader; |
13 changes: 13 additions & 0 deletions
13
frontend/src/components/@common/VerticalDivider/VerticalDivider.style.ts
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,13 @@ | ||
import styled from 'styled-components'; | ||
|
||
type Pixel = `${number}px`; | ||
|
||
const VerticalDivider = styled.div.attrs({ | ||
'aria-hidden': true, | ||
})<{ height: Pixel }>` | ||
width: 1px; /* 세로 선의 너비를 조절할 수 있습니다. */ | ||
height: ${({ height }) => height}; | ||
background: ${({ theme: { color } }) => color.gray}; /* 세로 선의 색상을 지정합니다. */ | ||
`; | ||
|
||
export default VerticalDivider; |
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,45 +1,30 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Wrapper = styled.main` | ||
position: relative; | ||
display: flex; | ||
flex-direction: column; | ||
`; | ||
|
||
export const TitleBox = styled.div` | ||
width: 100%; | ||
height: 68px; | ||
text-align: center; | ||
`; | ||
|
||
export const Title = styled.p` | ||
font: 900 4rem/6.8rem 'GmarketSans'; | ||
height: calc(100% - 68px); | ||
`; | ||
|
||
export const ButtonBox = styled.section` | ||
position: absolute; | ||
bottom: 68px; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
margin: 300px auto; | ||
button { | ||
cursor: pointer; | ||
} | ||
`; | ||
|
||
const Button = styled.button` | ||
width: 270px; | ||
export const Button = styled.button` | ||
height: 45px; | ||
background: #333333; | ||
color: ${({ theme: { color } }) => color.gray}; | ||
border-radius: 8px; | ||
`; | ||
|
||
export const Logout = styled(Button)` | ||
background: ${({ theme: { color } }) => color.grayLight}; | ||
`; | ||
|
||
export const Withdraw = styled(Button)` | ||
background: ${({ theme: { color } }) => color.gray}; | ||
`; |
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
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