-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: 스카우트 모달 내 태그 API 연결 및 기타 버그 수정 (#345)
* Feat: 유저 Tag List API 변경 * Feat: UserProfileTagList 구현 * Feat: 캐시 1분 * Feat: UserProfileModal 위치 변경 및 API 구현 * Refactor: emptyMessage 적용 * Refactor: isCollapsed -> isOpen으로 변경 * Feat: compliments 추출
- Loading branch information
1 parent
adb0734
commit e6f2c35
Showing
10 changed files
with
109 additions
and
38 deletions.
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
50 changes: 50 additions & 0 deletions
50
co-kkiri/src/components/modals/UserProfileModal/UserProfileTagList.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,50 @@ | ||
import styled from "styled-components"; | ||
import EvaluationChip from "@/components/commons/Chips/EvaluationChip"; | ||
import { TagType } from "@/types/tagtypes"; | ||
import DESIGN_TOKEN from "@/styles/tokens"; | ||
import { emptyMessages } from "@/components/commons/UserProfileCard/constants"; | ||
|
||
interface UserProfileTagListProps { | ||
reviewList: TagType[]; | ||
} | ||
|
||
export default function UserProfileTagList({ reviewList }: UserProfileTagListProps) { | ||
const noTags = reviewList.length === 0; | ||
const compliments = reviewList.filter((tag) => tag.type === "COMPLIMENT"); | ||
return ( | ||
<Container> | ||
{noTags ? ( | ||
<NoResultText>{emptyMessages.tags}</NoResultText> | ||
) : ( | ||
<> | ||
{compliments.map((tag, index) => ( | ||
<EvaluationChip | ||
key={`${tag.content}-${index}`} | ||
label={tag.content || ""} | ||
evaluationWay={tag.type} | ||
count={tag.count} | ||
/> | ||
))} | ||
</> | ||
)} | ||
</Container> | ||
); | ||
} | ||
|
||
const { typography, color } = DESIGN_TOKEN; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
gap: 0.6rem; | ||
`; | ||
|
||
const NoResultText = styled.p` | ||
margin: 4rem 0; | ||
color: ${color.gray[1]}; | ||
${typography.font12Regular} | ||
`; |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export type TagType = { | ||
type: 'COMPLIMENT' | 'IMPROVEMENT' | ||
content: string; | ||
count: number; | ||
} |