-
Notifications
You must be signed in to change notification settings - Fork 6
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
refactor: 범용적인 DropDown 컴포넌트를 celuveat-ui-library 배포 후 적용 #652
Merged
The head ref may contain hidden characters: "650-feat-dropdown-\uB77C\uC774\uBE0C\uB7EC\uB9AC-\uBC30\uD3EC-\uBC0F-\uC801\uC6A9"
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1eb311e
chore: celuveat-ui-library 설치
turtle601 56684d4
refactor: celuveat-library를 적용, InfoDropDown 코드 수정
turtle601 8e9b42d
fix: svg 경로로 인한 storybook 에러 해결
turtle601 c419518
refactor: celuveat-library를 적용, CelebDropDown 코드 수정
turtle601 1a55f8f
fix: github action ci 오류 수정
turtle601 11bae73
fix: 사용하지 않은 memo 제거 (#650)
turtle601 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
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
39 changes: 39 additions & 0 deletions
39
frontend/src/components/CelebDropDown/CelebDropDownOption.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,39 @@ | ||
import { styled } from 'styled-components'; | ||
import { Celeb } from '~/@types/celeb.types'; | ||
import ProfileImage from '~/components/@common/ProfileImage'; | ||
import { FONT_SIZE } from '~/styles/common'; | ||
|
||
import CelebIcon from '~/assets/icons/celeb.svg'; | ||
|
||
interface CelebDropDownOptionProps { | ||
celeb: Celeb; | ||
} | ||
|
||
function CelebDropDownOption({ celeb }: CelebDropDownOptionProps) { | ||
return ( | ||
<div> | ||
{celeb.id === -1 ? ( | ||
<CelebIcon /> | ||
) : ( | ||
<ProfileImage name={celeb.name} imageUrl={celeb.profileImageUrl} size="32px" /> | ||
)} | ||
<div> | ||
<StyledCelebName>{celeb.name}</StyledCelebName> | ||
<StyledChannelName>{celeb.youtubeChannelName}</StyledChannelName> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default CelebDropDownOption; | ||
|
||
const StyledCelebName = styled.div` | ||
font-family: SUIT-Medium, sans-serif; | ||
`; | ||
|
||
const StyledChannelName = styled.div` | ||
padding-top: 0.4rem; | ||
|
||
color: var(--gray-3); | ||
font-size: ${FONT_SIZE.sm}; | ||
`; |
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,26 @@ | ||
import NavItem from '~/components/@common/NavItem'; | ||
import ProfileImage from '~/components/@common/ProfileImage'; | ||
import CelebIcon from '~/assets/icons/celeb.svg'; | ||
|
||
import { Celeb } from '~/@types/celeb.types'; | ||
|
||
interface CelebNavItemProps { | ||
celeb: Celeb; | ||
} | ||
|
||
function CelebNavItem({ celeb }: CelebNavItemProps) { | ||
return ( | ||
<div> | ||
{celeb.id === -1 ? ( | ||
<NavItem label="전체 셀럽" icon={<CelebIcon />} /> | ||
) : ( | ||
<NavItem | ||
label={celeb.youtubeChannelName.replace('@', '')} | ||
icon={<ProfileImage name={celeb.name} imageUrl={celeb.profileImageUrl} size="40px" />} | ||
/> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default CelebNavItem; |
27 changes: 27 additions & 0 deletions
27
frontend/src/components/CelebDropDown/hooks/useCelebSelect.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { useState } from 'react'; | ||
import { shallow } from 'zustand/shallow'; | ||
import { OPTION_FOR_CELEB_ALL } from '~/constants/options'; | ||
import useRestaurantsQueryStringState from '~/hooks/store/useRestaurantsQueryStringState'; | ||
|
||
import { Celeb } from '~/@types/celeb.types'; | ||
|
||
export const useCelebSelect = () => { | ||
const [selectedCeleb, setSelectedCeleb] = useState<Celeb>(OPTION_FOR_CELEB_ALL); | ||
|
||
const [setCelebId, setCurrentPage] = useRestaurantsQueryStringState( | ||
state => [state.setCelebId, state.setCurrentPage], | ||
shallow, | ||
); | ||
|
||
const selectCeleb = (celeb: Celeb) => () => { | ||
setCelebId(celeb.id); | ||
setCurrentPage(0); | ||
|
||
setSelectedCeleb(celeb); | ||
}; | ||
|
||
return { | ||
selectedCeleb, | ||
selectCeleb, | ||
}; | ||
}; |
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.
어떤 오류를 수정한걸까요?
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.
저번에 yarn.lock을 최신화 할 경우(라이브러리를 다운 받거나 yarn.lock)을 수정할 때 github ci cd에서 빌드 시 오류가 발생하였는데 yarn cache 문제 때문이었습니다. 따라서 이를 해결했습니다!!