-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FE] feat: 리뷰 상세 페이지 구현 #762
Merged
Merged
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a6812b4
refactor: 마이페이지 리뷰 디자인 수정
hae-on 2bc411a
refactor: border bottom 무조건 있도록 수정
hae-on baf67a3
refactor: bookmark 로직 삭제
hae-on 345abbe
refactor: 로딩 rotate 방향 수정
hae-on 69655d6
feat: link 아이콘 추가
hae-on 630c1d0
feat: 리뷰 상세 페이지 구현
hae-on fba407e
chore: develop merge
hae-on 1be4505
refactor: categotyType string을 CategoryVaraint type으로 변경
hae-on 2401b6f
chore: yarn 재설치
hae-on 2c9dab9
refactor: 필요없는 css 값 삭제
hae-on eceaf7a
refactor: params review id 받도록 수정
hae-on 38b1fe6
refactor: query key 추가
hae-on File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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 |
---|---|---|
|
@@ -40,7 +40,7 @@ const rotate = keyframes` | |
} | ||
|
||
100% { | ||
transform: rotate(-360deg); | ||
transform: rotate(360deg); | ||
} | ||
`; | ||
|
||
|
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,15 +1,16 @@ | ||
import { Button, Heading, theme } from '@fun-eat/design-system'; | ||
import { Button, Heading, Link, theme } from '@fun-eat/design-system'; | ||
import { Link as RouterLink } from 'react-router-dom'; | ||
import styled from 'styled-components'; | ||
|
||
import { SvgIcon } from '@/components/Common'; | ||
import { useRoutePage } from '@/hooks/common'; | ||
|
||
interface SectionTitleProps { | ||
name: string; | ||
bookmark?: boolean; | ||
link?: string; | ||
} | ||
Comment on lines
-9
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
const SectionTitle = ({ name, bookmark = false }: SectionTitleProps) => { | ||
const SectionTitle = ({ name, link }: SectionTitleProps) => { | ||
const { routeBack } = useRoutePage(); | ||
|
||
return ( | ||
|
@@ -18,18 +19,19 @@ const SectionTitle = ({ name, bookmark = false }: SectionTitleProps) => { | |
<Button type="button" variant="transparent" onClick={routeBack} aria-label="뒤로 가기"> | ||
<SvgIcon variant="arrow" color={theme.colors.gray5} width={15} height={15} /> | ||
</Button> | ||
<Heading size="xl" css="margin-left: 20px"> | ||
{name} | ||
</Heading> | ||
{link ? ( | ||
<Link as={RouterLink} to={link} block> | ||
<ProductName size="xl" css={{ marginLeft: '20px' }}> | ||
{name} | ||
</ProductName> | ||
</Link> | ||
) : ( | ||
<ProductName size="xl" css={{ marginLeft: '20px' }}> | ||
{name} | ||
</ProductName> | ||
)} | ||
{link && <SvgIcon variant="link" width={20} height={20} />} | ||
</SectionTitleWrapper> | ||
{bookmark && ( | ||
<Button type="button" customWidth="32px" variant="transparent" aria-label="북마크"> | ||
<SvgIcon | ||
variant={bookmark ? 'bookmarkFilled' : 'bookmark'} | ||
color={bookmark ? theme.colors.primary : theme.colors.gray5} | ||
/> | ||
</Button> | ||
)} | ||
</SectionTitleContainer> | ||
); | ||
}; | ||
|
@@ -45,9 +47,12 @@ const SectionTitleContainer = styled.div` | |
const SectionTitleWrapper = styled.div` | ||
display: flex; | ||
align-items: center; | ||
column-gap: 16px; | ||
|
||
svg { | ||
padding-top: 2px; | ||
} | ||
`; | ||
|
||
const ProductName = styled(Heading)` | ||
margin: 0 5px 0 16px; | ||
`; |
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
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,3 +1,4 @@ | ||
export { default as useReviewTagsQuery } from './useReviewTagsQuery'; | ||
export { default as useReviewFavoriteMutation } from './useReviewFavoriteMutation'; | ||
export { default as useReviewRegisterFormMutation } from './useReviewRegisterFormMutation'; | ||
export { default as useReviewDetailQuery } from './useReviewDetailQuery'; |
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 { useSuspendedQuery } from '../useSuspendedQuery'; | ||
|
||
import { reviewApi } from '@/apis'; | ||
import type { ReviewDetailResponse } from '@/types/response'; | ||
|
||
const fetchReviewDetail = async () => { | ||
const response = await reviewApi.get({ params: '/reviews' }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. params에 reviews가 아닌 reviewId가 들어가야 할 것 같네요! |
||
const data: ReviewDetailResponse = await response.json(); | ||
return data; | ||
}; | ||
|
||
const useReviewDetailQuery = () => { | ||
return useSuspendedQuery(['review'], () => fetchReviewDetail()); | ||
}; | ||
|
||
export default useReviewDetailQuery; |
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,29 @@ | ||
{ | ||
"reviews": { | ||
"id": 1, | ||
"userName": "펀잇", | ||
"profileImage": "https://github.com/woowacourse-teams/2023-fun-eat/assets/78616893/1f0fd418-131c-4cf8-b540-112d762b7c34", | ||
"image": "https://i.namu.wiki/i/9wnvUaEa1EkDqG-M0Pbwfdf19FJQQXV_-bnlU2SYaNcG05y2wbabiIrfrGES1M4xSgDjY39RwOvLNggDd3Huuw.webp", | ||
"rating": 4.5, | ||
"tags": [ | ||
{ | ||
"id": 5, | ||
"name": "단짠단짠", | ||
"tagType": "TASTE" | ||
}, | ||
{ | ||
"id": 1, | ||
"name": "망고망고", | ||
"tagType": "TASTE" | ||
} | ||
], | ||
"content": "맛있어용~!~!", | ||
"rebuy": true, | ||
"favoriteCount": 1320, | ||
"favorite": true, | ||
"createdAt": "2023-10-13T00:00:00", | ||
"categoryType": "food", | ||
"productId": 1, | ||
"productName": "칠성 사이다" | ||
} | ||
} |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⏰👍