-
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 #124 from YAPP-Github/feature/FE-088
Feature/fe-088 : 먹팟 필터링 관련 수정사항 반영
- Loading branch information
Showing
28 changed files
with
291 additions
and
84 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export const boardKeys = { | ||
all: ['board'] as const, | ||
list: (cityId?: number, provinceId?: number) => [...boardKeys.all, 'list', cityId, provinceId] as const, | ||
detail: (boardId: number) => [...boardKeys.all, 'detail', boardId] as const, | ||
detail: (boardId: number, cityId?: number, provinceId?: number) => | ||
[...boardKeys.all, 'detail', boardId, cityId, provinceId] as const, | ||
regions: () => [...boardKeys.all, 'regions'] as const, | ||
}; |
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
52 changes: 52 additions & 0 deletions
52
src/app/board/components/ContentSection/FooterLinkButtons.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,52 @@ | ||
'use client'; | ||
|
||
import Link from 'next/link'; | ||
import { IconButton } from '@/components'; | ||
import { useRegionsFilterStore } from '@/store'; | ||
import { BoardDetail } from '@/api/types'; | ||
import { getQueryString } from '@/utils/queryString'; | ||
import { disabledLink, footerButtons } from './ContentSection.css'; | ||
|
||
interface Props { | ||
prevId: BoardDetail['prevId']; | ||
nextId: BoardDetail['nextId']; | ||
} | ||
|
||
const FooterLinkButtons = ({ prevId, nextId }: Props) => { | ||
const { cityId, provinceId } = useRegionsFilterStore(({ cityId, provinceId }) => ({ | ||
cityId, | ||
provinceId, | ||
})); | ||
|
||
const isPrevDisabled = prevId === null; | ||
const isNextDisabled = nextId === null; | ||
|
||
return ( | ||
<div className={footerButtons}> | ||
<Link | ||
href={`/board/${prevId}${getQueryString({ | ||
cityId, | ||
provinceId, | ||
})}`} | ||
className={disabledLink({ | ||
disabled: isPrevDisabled, | ||
})} | ||
> | ||
<IconButton iconType="chevronleft" hover disabled={isPrevDisabled} /> | ||
</Link> | ||
<Link | ||
href={`/board/${nextId}${getQueryString({ | ||
cityId, | ||
provinceId, | ||
})}`} | ||
className={disabledLink({ | ||
disabled: isNextDisabled, | ||
})} | ||
> | ||
<IconButton iconType="chevronright" hover disabled={isNextDisabled} /> | ||
</Link> | ||
</div> | ||
); | ||
}; | ||
|
||
export default FooterLinkButtons; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use client'; | ||
|
||
import Link from 'next/link'; | ||
import { PropsWithChildren } from 'react'; | ||
import { getQueryString } from '@/utils/queryString'; | ||
import { useRegionsFilterStore } from '@/store'; | ||
|
||
interface Props extends PropsWithChildren { | ||
boardId: number; | ||
} | ||
|
||
const BoardCardLink = ({ boardId, children }: Props) => { | ||
const { cityId, provinceId } = useRegionsFilterStore(({ cityId, provinceId }) => ({ | ||
cityId, | ||
provinceId, | ||
})); | ||
|
||
return ( | ||
<Link | ||
href={`/board/${boardId}${getQueryString({ | ||
cityId, | ||
provinceId, | ||
})}`} | ||
> | ||
{children} | ||
</Link> | ||
); | ||
}; | ||
|
||
export default BoardCardLink; |
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.