-
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.
[FE] refactor: 검색 탭 삭제 및 순서 수정 (#578)
* feat: 검색 탭 삭제 * feat: 상품 목록, 꿀조합 페이지에 검색 아이콘 추가 * refactor: Title 컴포넌트를 Common에서 Product로 이동 * refactor: 검색 탭 삭제 후 검색 페이지로 분리 * refactor: dynamic segment로 변경해서 타입체킹을 하는 방법으로 변경 * chore: msw 버전업 * feat: 새로운 헤더 디자인 추가 * feat: 검색 페이지와 통합 검색 페이지 분리 * feat: 검색 페이지 헤더 ui 변경 * refactor: 검색 페이지 헤더 ui 변경 * refactor: Title->ProductTitle로 네이밍 변경 * fix: AuthLayout 에러 해결
- Loading branch information
Showing
18 changed files
with
361 additions
and
136 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
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 was deleted.
Oops, something went wrong.
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
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,31 @@ | ||
import type { PropsWithChildren } from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
import Header from '../Common/Header/Header'; | ||
import NavigationBar from '../Common/NavigationBar/NavigationBar'; | ||
|
||
const SimpleHeaderLayout = ({ children }: PropsWithChildren) => { | ||
return ( | ||
<SimpleHeaderLayoutContainer> | ||
<Header hasSearch={false} /> | ||
<MainWrapper id="main">{children}</MainWrapper> | ||
<NavigationBar /> | ||
</SimpleHeaderLayoutContainer> | ||
); | ||
}; | ||
|
||
export default SimpleHeaderLayout; | ||
|
||
const SimpleHeaderLayoutContainer = styled.div` | ||
height: 100%; | ||
max-width: 600px; | ||
margin: 0 auto; | ||
`; | ||
|
||
const MainWrapper = styled.main` | ||
position: relative; | ||
height: calc(100% - 120px); | ||
padding: 20px; | ||
overflow-x: hidden; | ||
overflow-y: 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
16 changes: 16 additions & 0 deletions
16
frontend/src/components/Product/ProductTitle/ProductTitle.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,16 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import ProductTitle from './ProductTitle'; | ||
|
||
const meta: Meta<typeof ProductTitle> = { | ||
title: 'common/ProductTitle', | ||
component: ProductTitle, | ||
args: { | ||
headingTitle: '상품 목록', | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof ProductTitle>; | ||
|
||
export const Default: Story = {}; |
51 changes: 51 additions & 0 deletions
51
frontend/src/components/Product/ProductTitle/ProductTitle.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,51 @@ | ||
import { Heading, Link, theme } from '@fun-eat/design-system'; | ||
import { Link as RouterLink } from 'react-router-dom'; | ||
import styled from 'styled-components'; | ||
|
||
import SvgIcon from '../../Common/Svg/SvgIcon'; | ||
|
||
import { PATH } from '@/constants/path'; | ||
|
||
interface ProductTitleProps { | ||
content: string; | ||
routeDestination: string; | ||
} | ||
|
||
const ProductTitle = ({ content, routeDestination }: ProductTitleProps) => { | ||
return ( | ||
<ProductTitleContainer> | ||
<ProductTitleLink as={RouterLink} to={routeDestination} replace> | ||
<HeadingTitle>{content}</HeadingTitle> | ||
<DropDownIcon variant="arrow" color={theme.colors.black} width={15} height={15} /> | ||
</ProductTitleLink> | ||
<Link as={RouterLink} to={`${PATH.SEARCH}/products`}> | ||
<SvgIcon variant="search" /> | ||
</Link> | ||
</ProductTitleContainer> | ||
); | ||
}; | ||
|
||
export default ProductTitle; | ||
|
||
const ProductTitleContainer = styled.div` | ||
position: relative; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-items: center; | ||
`; | ||
|
||
const ProductTitleLink = styled(Link)` | ||
display: flex; | ||
gap: 20px; | ||
align-items: center; | ||
margin-left: 36%; | ||
`; | ||
|
||
const HeadingTitle = styled(Heading)` | ||
font-size: 2.4rem; | ||
`; | ||
|
||
const DropDownIcon = styled(SvgIcon)` | ||
rotate: 270deg; | ||
`; |
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
Oops, something went wrong.