-
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.
- Loading branch information
1 parent
8518502
commit ae1216e
Showing
7 changed files
with
99 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from "react"; | ||
|
||
const MypageBadgeCount = ({ count }: { count: number }) => { | ||
return ( | ||
<div className="flex w-full"> | ||
<span className="m-auto w-auto rounded-[8px] bg-primary-05 px-[10px] py-[12px] text-title-bold text-primary-01"> | ||
획득 뱃지 {count}개! | ||
</span> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MypageBadgeCount; |
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,33 @@ | ||
import Image from "next/image"; | ||
import React, { FC } from "react"; | ||
|
||
import { Badge } from "@/apis/user/badges/badgesType"; | ||
|
||
interface Props { | ||
badge: Badge; | ||
} | ||
|
||
const MypageBadgeItem: FC<Props> = ({ badge }) => { | ||
const isAcquired = badge.isAquired ? "" : "grayscale"; | ||
return ( | ||
<div className="flex w-auto flex-col items-center justify-center gap-[6px]"> | ||
<Image | ||
className={isAcquired} | ||
src={badge.imageUrl} | ||
alt={badge.badgeName} | ||
width={96} | ||
height={96} | ||
/> | ||
<div className="flex flex-col"> | ||
<span className="text-center text-body2-semi text-gray-scale-600"> | ||
{badge.badgeName} | ||
</span> | ||
<span className="text-center text-caption1-regular text-gray-scale-600"> | ||
{badge.description} | ||
</span> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MypageBadgeItem; |
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 { FC } from "react"; | ||
|
||
import { BadgesResponse } from "@/apis/user/badges/badgesType"; | ||
|
||
import MypageBadgeCount from "./MypageBadgeCount"; | ||
import MypageBadgeItem from "./MypageBadgeItem"; | ||
|
||
interface Props { | ||
badges: BadgesResponse; | ||
} | ||
|
||
const MypageBadges: FC<Props> = ({ badges }) => { | ||
const acquiredCount = badges.filter((badge) => badge.isAquired).length; | ||
return ( | ||
<div className="flex flex-col gap-[18px]"> | ||
<MypageBadgeCount count={acquiredCount} /> | ||
|
||
<div className="grid grid-cols-3 justify-between gap-[24px]"> | ||
{badges.map((badge, index) => ( | ||
<MypageBadgeItem key={badge.badgeName + index} badge={badge} /> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MypageBadges; |
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