Skip to content
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

feat(game/result): add time and score #81

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions app/_game/components/ResultDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Image from 'next/image'
import { useState } from 'react'

import { type userScores } from '~/db/schema'
import dayjs from '~/lib/dayjs'
import { type User } from '~/stores/User.store'

import { getResultTier } from '../helpers/getResultTier'
Expand Down Expand Up @@ -44,6 +45,26 @@ export function ResultDisplay({
/>
</div>
<div className="flex h-full flex-col items-center justify-between px-[10px] py-[20px] sm:w-1/2 sm:justify-center sm:gap-[48px] sm:p-[24px]">
<div className="flex items-center justify-center gap-[10px] text-[13px] sm:gap-[16px] sm:text-[16px]">
<Image
src="/images/play/clock.svg"
height={24}
width={24}
alt="time"
className="h-[18px] w-[18px] sm:h-[24px] sm:w-[24px]"
/>
<div>{dayjs.duration(userScore.time, 'seconds').format('mm:ss')}</div>
<Image
src="/images/result/trophy.svg"
height={24}
width={24}
alt="score"
className="h-[18px] w-[18px] sm:h-[24px] sm:w-[24px]"
/>
<div>
{userScore.score}/{userScore.total}
</div>
</div>
<div className="text-center">
<div className="text-[16px] sm:text-[20px]">~ Test #{testId} ~</div>
<div className="text-[13px] sm:text-[16px] sm:text-[#A9A9A9]">
Expand Down
31 changes: 31 additions & 0 deletions public/images/result/trophy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.