forked from codesquad-members-2023/second-hand
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: 상품 상세 페이지 Header 컴포넌트 생성 (#171)
- ProductDetailMain에 있던 Header를 분리
- Loading branch information
Showing
5 changed files
with
36 additions
and
21 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
fe/src/components/ProductDetail/ProductDetailHeader/index.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,20 @@ | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import { ICON_NAME } from '@constants/iconName'; | ||
|
||
import Icon from '@components/common/Icon'; | ||
import * as S from './style'; | ||
|
||
const ProductDetailHeader = () => { | ||
const navigate = useNavigate(); | ||
return ( | ||
<S.Header> | ||
<button onClick={() => navigate(-1)}> | ||
<Icon name={ICON_NAME.CHEVRON_LEFT} /> | ||
</button> | ||
<Icon name={ICON_NAME.ELLIPSIS} /> | ||
</S.Header> | ||
); | ||
}; | ||
|
||
export default ProductDetailHeader; |
14 changes: 14 additions & 0 deletions
14
fe/src/components/ProductDetail/ProductDetailHeader/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,14 @@ | ||
import styled from 'styled-components'; | ||
|
||
const Header = styled.header` | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
position: fixed; | ||
width: 100%; | ||
height: 44px; | ||
padding: 16px; | ||
`; | ||
|
||
export { 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
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