From 175dfde32e9d4158cfdc4062ec9b273d847ac849 Mon Sep 17 00:00:00 2001 From: jsun969 Date: Mon, 23 Oct 2023 19:34:09 +0800 Subject: [PATCH] feat(game/result): add time and score --- app/_game/components/ResultDisplay.tsx | 21 +++++++++++++++++ public/images/result/trophy.svg | 31 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 public/images/result/trophy.svg diff --git a/app/_game/components/ResultDisplay.tsx b/app/_game/components/ResultDisplay.tsx index a05d336..c06c4df 100644 --- a/app/_game/components/ResultDisplay.tsx +++ b/app/_game/components/ResultDisplay.tsx @@ -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' @@ -44,6 +45,26 @@ export function ResultDisplay({ />
+
+ time +
{dayjs.duration(userScore.time, 'seconds').format('mm:ss')}
+ score +
+ {userScore.score}/{userScore.total} +
+
~ Test #{testId} ~
diff --git a/public/images/result/trophy.svg b/public/images/result/trophy.svg new file mode 100644 index 0000000..930b350 --- /dev/null +++ b/public/images/result/trophy.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file