-
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.
Merge pull request #220 from choooz/JR-899-refactor-search-page
[JR-899] 검색 페이지 리팩토링
- Loading branch information
Showing
36 changed files
with
665 additions
and
421 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
apps/jurumarble/src/app/drink-info/[id]/components/DrinkInfoContainer.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
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
2 changes: 1 addition & 1 deletion
2
apps/jurumarble/src/types/my.ts → .../jurumarble/src/app/my/constants/index.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
42 changes: 42 additions & 0 deletions
42
apps/jurumarble/src/app/search/components/DrinkInfoList.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,42 @@ | ||
import Path from 'lib/Path'; | ||
import { useRouter } from 'next/navigation'; | ||
import styled from 'styled-components'; | ||
|
||
import DrinkItem from './DrinkItem'; | ||
import { useSearchChangeContext, useSearchValueContext } from '../context'; | ||
|
||
function DrinkInfoList() { | ||
const router = useRouter(); | ||
|
||
const { drinkList, selectedTab } = useSearchValueContext(); | ||
|
||
const { onToggleReplaceLoginPageModal, drinkSubscribe } = | ||
useSearchChangeContext(); | ||
|
||
const onClickDrinkItem = (id: number) => { | ||
router.push(`${Path.DRINK_INFO_PAGE}/${id}`); | ||
}; | ||
|
||
return ( | ||
<Container> | ||
{drinkList.map((drinkInfo) => ( | ||
<DrinkItem | ||
key={drinkInfo.id} | ||
drinkInfo={drinkInfo} | ||
onClickDrinkItem={() => onClickDrinkItem(drinkInfo.id)} | ||
onToggleReplaceLoginPageModal={onToggleReplaceLoginPageModal} | ||
/> | ||
))} | ||
{selectedTab === 'drinkInfo' && <div ref={drinkSubscribe} />} | ||
</Container> | ||
); | ||
} | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 8px; | ||
margin-top: 24px; | ||
`; | ||
|
||
export default DrinkInfoList; |
34 changes: 34 additions & 0 deletions
34
apps/jurumarble/src/app/search/components/DrinkInfoTopSectionItem.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,34 @@ | ||
import { DRINK_INFO_SORT_LIST } from 'lib/constants'; | ||
import styled from 'styled-components'; | ||
|
||
import DrinkInfoList from './DrinkInfoList'; | ||
import RegionSmallSelect from './RegionSmallSelect'; | ||
import SortSelect from './SortSelect'; | ||
import { useSearchChangeContext, useSearchValueContext } from '../context'; | ||
|
||
function DrinkInfoTopSectionItem() { | ||
const { drinkInfoSortOption } = useSearchValueContext(); | ||
const { onChangeDrinkInfoSortOption } = useSearchChangeContext(); | ||
|
||
return ( | ||
<> | ||
<SelectContainer> | ||
<SortSelect | ||
defaultOption={drinkInfoSortOption} | ||
onChangeSortOption={onChangeDrinkInfoSortOption} | ||
options={DRINK_INFO_SORT_LIST} | ||
/> | ||
<RegionSmallSelect /> | ||
</SelectContainer> | ||
<DrinkInfoList /> | ||
</> | ||
); | ||
} | ||
|
||
const SelectContainer = styled.div` | ||
display: flex; | ||
margin-top: 40px; | ||
gap: 4px; | ||
`; | ||
|
||
export default DrinkInfoTopSectionItem; |
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
apps/jurumarble/src/app/search/components/DrinkVoteBottomSectionItem.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,34 @@ | ||
import { DRINK_VOTE_SORT_LIST } from 'lib/constants'; | ||
import styled from 'styled-components'; | ||
|
||
import DrinkVoteList from './DrinkVoteList'; | ||
import RegionSmallSelect from './RegionSmallSelect'; | ||
import SortSelect from './SortSelect'; | ||
import { useSearchChangeContext, useSearchValueContext } from '../context'; | ||
|
||
function DrinkVoteBottomSectionItem() { | ||
const { drinkVoteSortOption } = useSearchValueContext(); | ||
const { onChangeDrinkVoteSortOption } = useSearchChangeContext(); | ||
|
||
return ( | ||
<> | ||
<SelectContainer> | ||
<SortSelect | ||
defaultOption={drinkVoteSortOption} | ||
onChangeSortOption={onChangeDrinkVoteSortOption} | ||
options={DRINK_VOTE_SORT_LIST} | ||
/> | ||
<RegionSmallSelect /> | ||
</SelectContainer> | ||
<DrinkVoteList /> | ||
</> | ||
); | ||
} | ||
|
||
const SelectContainer = styled.div` | ||
display: flex; | ||
margin-top: 40px; | ||
gap: 4px; | ||
`; | ||
|
||
export default DrinkVoteBottomSectionItem; |
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
25 changes: 25 additions & 0 deletions
25
apps/jurumarble/src/app/search/components/NoSearchResult.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,25 @@ | ||
import Image from 'next/image'; | ||
import { noSearchResult } from 'public/images'; | ||
import styled from 'styled-components'; | ||
|
||
function NoSearchResult() { | ||
return ( | ||
<Container> | ||
<Image | ||
alt="검색 결과가 없습니다." | ||
src={noSearchResult} | ||
width={140} | ||
height={140} | ||
/> | ||
<Text>검색 결과가 없어요. 다른 검색어를 입력해보세요.</Text> | ||
</Container> | ||
); | ||
} | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
`; | ||
|
||
const Text = styled.p``; | ||
|
||
export default NoSearchResult; |
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.