Skip to content

Commit

Permalink
✨ add success rate
Browse files Browse the repository at this point in the history
  • Loading branch information
w00khyung committed Dec 15, 2023
1 parent 16ce311 commit 10ad2aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/(route)/(index)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,21 @@ export default function HomePage() {
}

const { champion, certificatedCount, explorationCount } = todayStatusQuery.data.data
const successRate = Math.round((certificatedCount / (certificatedCount + explorationCount)) * 100) || 0

return (
<div className='relative h-full px-8 py-4 pt-16'>
<h1 className='text-2xl'>오늘의 도달률</h1>
<div className='mb-7 flex items-end'>
<div className='h-[88px] text-[88px] font-extrabold leading-[88px] text-[#8A72FF]'>100</div>
<div className='h-[88px] text-[88px] font-extrabold leading-[88px] text-[#8A72FF]'>{successRate}</div>
<span className='text-[40px] font-extrabold'>%</span>
</div>
<div className='text-xl'>🌙 탐사 필요 {explorationCount}</div>
<div className='mt-3 text-xl'>🌕 탐사 완료 {certificatedCount}</div>

<div className='absolute bottom-[7%] right-2'>
<div className='relative aspect-[297/529] h-[60vh] w-full'>
<Image src={CHAMPION[champion]} fill alt='' />
<Image src={CHAMPION[champion]} fill alt={champion} />
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions app/(route)/sign-up/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export default function SignUp() {
{Object.keys(CHAMPION.DEFAULT).map((champion) => (
<button
key={champion}
type='button'
onClick={() => {
setSelectedChampion(champion as Champion)
}}
Expand Down

0 comments on commit 10ad2aa

Please sign in to comment.