From f985cc49dab5ecafbcb75056a78e97c2663fba86 Mon Sep 17 00:00:00 2001 From: evermake Date: Sat, 30 Nov 2024 23:13:01 +0500 Subject: [PATCH] minor style fixes and next level button --- frontend/src/api/me.ts | 2 +- frontend/src/components/mahjong/Mahjong.tsx | 25 ++++++++++++++------- frontend/src/components/ui/dialog.tsx | 4 ++-- frontend/src/routes/index.tsx | 10 ++++----- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/frontend/src/api/me.ts b/frontend/src/api/me.ts index 21e514f..246cd87 100644 --- a/frontend/src/api/me.ts +++ b/frontend/src/api/me.ts @@ -16,7 +16,7 @@ export function useMe() { {}, { refetchInterval: 1000 * 60 * 5, // 5 minutes - retry: false + retry: false, }, ) diff --git a/frontend/src/components/mahjong/Mahjong.tsx b/frontend/src/components/mahjong/Mahjong.tsx index 4e6350d..1402df3 100644 --- a/frontend/src/components/mahjong/Mahjong.tsx +++ b/frontend/src/components/mahjong/Mahjong.tsx @@ -2,7 +2,7 @@ import type { DotLottieWorker } from '@lottiefiles/dotlottie-react' import type { Coordinate, Tile as TileT } from './game' import { $api } from '@/api' import { useMe } from '@/api/me' -import { getLevelById, type LevelInfo } from '@/components/mahjong/levels.ts' +import { getLevelById, type LevelInfo, levels } from '@/components/mahjong/levels.ts' import { calculateScore } from '@/components/mahjong/score.ts' import { Button } from '@/components/ui/button' import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@/components/ui/card.tsx' @@ -426,7 +426,7 @@ export function Mahjong({ level }: { level: LevelInfo }) { {}}> - + Поздравляем! @@ -451,6 +451,8 @@ function Results({ score?: number }) { const level = getLevelById(levelId) + const levelIndex = levels.findIndex(l => l.id === levelId) + const nextLevel = levels[levelIndex + 1] const me = useMe() const refSent = useRef(false) @@ -540,7 +542,7 @@ function Results({ - + Без подсказок! @@ -555,7 +557,7 @@ function Results({ - + Без лишних кликов! @@ -570,7 +572,7 @@ function Results({ - + Очень быстро! @@ -585,7 +587,7 @@ function Results({ - + Идеально! @@ -625,8 +627,15 @@ function Results({ ))} - - + )} +