-
Notifications
You must be signed in to change notification settings - Fork 2
[feat] 마이페이지 좋아요 기능 연결 및 /mycd 라우팅 처리 #119
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d412ce6
feat: 마이페이지 트랙리스트 재생 클릭 시 /mycd 라우팅 (#118)
hansololiviakim 58a6eaa
feat: 좋아요한 CD 출력 컴포넌트 Cd → Playlist 변경, 반응형 추가 (#118)
hansololiviakim f05d028
feat: api 수정에 맞춰 추천 response type 수정 (#118)
hansololiviakim b6c6a98
feat: 좋아요한 CD 리스트에서 비공개여부에 따라 라우팅 분기 (#118)
hansololiviakim e11ad5b
style: button에 폰트 상속되도록 font-family: inherit 추가 (#118)
hansololiviakim 0fcd366
fix: usePlaylistDetail enabled 조건 우선순위 수정 (#118)
hansololiviakim 9f014ab
style: 오탈자 수정 (#118)
hansololiviakim 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,50 +5,66 @@ import styled from 'styled-components' | |||||
| import type { CdCustomData } from '@/entities/playlist' | ||||||
| import { LikeButton } from '@/features/like' | ||||||
| import Cd from '@/shared/ui/Cd' | ||||||
| import type { CdProps } from '@/shared/ui/Cd' | ||||||
|
|
||||||
| interface PlaylistProps { | ||||||
| title: string | ||||||
| username: string | ||||||
| id: number | ||||||
| stickers?: CdCustomData[] | ||||||
| cdVariant?: CdProps['variant'] | ||||||
| isPublic?: boolean | ||||||
| } | ||||||
|
|
||||||
| const Playlist = ({ id, title, username, stickers }: PlaylistProps) => { | ||||||
| const Playlist = ({ | ||||||
| id, | ||||||
| title, | ||||||
| username, | ||||||
| stickers, | ||||||
| cdVariant = 'xl', | ||||||
| isPublic = true, | ||||||
| }: PlaylistProps) => { | ||||||
| const navigate = useNavigate() | ||||||
|
|
||||||
| // 마이페이지에서만 아래 옵션을 사용하고 있어 구분하기 위함 | ||||||
| const isFromMypage = cdVariant === 'responsive' | ||||||
hansololiviakim marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| const handleClick = () => { | ||||||
| if (isFromMypage) return | ||||||
| navigate(`/discover/${id}`) | ||||||
| } | ||||||
|
|
||||||
| return ( | ||||||
| <Wrapper onClick={handleClick}> | ||||||
| <CdBox> | ||||||
| <Cd variant="xl" stickers={stickers} /> | ||||||
| <Wrapper onClick={handleClick} $cdVariant={cdVariant}> | ||||||
| <CdBox $cdVariant={cdVariant}> | ||||||
| <Cd variant={cdVariant} stickers={stickers} isPublic={isPublic} /> | ||||||
| <ButtonContainer> | ||||||
| <LikeButton playlistId={id} type="HOME" /> | ||||||
| </ButtonContainer> | ||||||
| </CdBox> | ||||||
| <InfoBox> | ||||||
| <Title>{title}</Title> | ||||||
| <UserName>{username}</UserName> | ||||||
| </InfoBox> | ||||||
| {!isFromMypage && ( | ||||||
| <InfoBox> | ||||||
| <Title>{title}</Title> | ||||||
| <UserName>{username}</UserName> | ||||||
| </InfoBox> | ||||||
| )} | ||||||
| </Wrapper> | ||||||
| ) | ||||||
| } | ||||||
|
|
||||||
| export default Playlist | ||||||
|
|
||||||
| const Wrapper = styled.div` | ||||||
| const Wrapper = styled.div<{ $cdVariant: string }>` | ||||||
| display: flex; | ||||||
| flex-direction: column; | ||||||
| gap: 12px; | ||||||
| width: 140px; | ||||||
| width: ${({ $cdVariant }) => ($cdVariant === 'responsive' ? '100%' : '140px')}; | ||||||
| ` | ||||||
|
|
||||||
| const CdBox = styled.div` | ||||||
| const CdBox = styled.div<{ $cdVariant: string }>` | ||||||
| position: relative; | ||||||
| width: 140px; | ||||||
| height: 140px; | ||||||
| width: ${({ $cdVariant }) => ($cdVariant === 'responsive' ? '100%' : '140px')}; | ||||||
|
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.
Suggested change
|
||||||
| aspect-ratio: 1 / 1; | ||||||
| border-radius: 16px; | ||||||
|
|
||||||
| display: flex; | ||||||
|
|
||||||
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.
Uh oh!
There was an error while loading. Please reload this page.