From ade238966bf02e08b206495c4fa6b20837a4ddfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Tue, 14 Oct 2025 21:53:58 -0500 Subject: [PATCH] feat: some cleanup --- packages/i18n/strings/en.json | 2 + .../src/components/PlaylistActions.tsx | 163 ++++++++++-------- .../website/src/components/PlaylistTable.tsx | 1 + .../src/components/PlaylistTankEntry.tsx | 1 + .../src/components/StickyRowHeaderCell.tsx | 1 - .../src/components/TankRowHeaderCell.tsx | 57 +++--- packages/website/tsconfig.json | 6 +- 7 files changed, 118 insertions(+), 113 deletions(-) diff --git a/packages/i18n/strings/en.json b/packages/i18n/strings/en.json index 367e61d45..be88518f9 100644 --- a/packages/i18n/strings/en.json +++ b/packages/i18n/strings/en.json @@ -863,6 +863,7 @@ "reset": "Reset", "shuffle": "Shuffle", "remove": "Remove played", + "tracking": "BlitzKit is tracking your playlist", "sort": { "button": "Sort by", @@ -879,6 +880,7 @@ "unrecorded": "--", "wins": "Wins" }, + "no_login_warning": "You are not logged in. BlitzKit will not keep track of your played tanks.", "generate": "Generate playlist", "name": "Playlist", diff --git a/packages/website/src/components/PlaylistActions.tsx b/packages/website/src/components/PlaylistActions.tsx index 117c85da6..b53ab9366 100644 --- a/packages/website/src/components/PlaylistActions.tsx +++ b/packages/website/src/components/PlaylistActions.tsx @@ -1,6 +1,6 @@ import { fisherYates } from "@blitzkit/core"; import { CaretDownIcon } from "@radix-ui/react-icons"; -import { Button, DropdownMenu, Flex } from "@radix-ui/themes"; +import { Button, DropdownMenu, Flex, Spinner } from "@radix-ui/themes"; import { useLocale } from "../hooks/useLocale"; import { App } from "../stores/app"; import { Playlist } from "../stores/playlist"; @@ -10,83 +10,96 @@ export function PlaylistActions() { const wargaming = App.use((state) => state.logins.wargaming); return ( - - + <> + + - + + + {wargaming && ( + <> + + + + + + + + + { + Playlist.mutate((draft) => { + draft.list = draft.list?.sort( + (a, b) => (a.then?.last ?? 0) - (b.then?.last ?? 0) + ); + }); + }} + > + {strings.website.tools.playlist.sort.last_played} + + { + Playlist.mutate((draft) => { + draft.list = draft.list?.sort( + (a, b) => + (a.then?.battles ?? 0) - (b.then?.battles ?? 0) + ); + }); + }} + > + {strings.website.tools.playlist.sort.least_played} + + + + + )} + {wargaming && ( - <> - - - - - - - - - { - Playlist.mutate((draft) => { - draft.list = draft.list?.sort( - (a, b) => (a.then?.last ?? 0) - (b.then?.last ?? 0) - ); - }); - }} - > - {strings.website.tools.playlist.sort.last_played} - - { - Playlist.mutate((draft) => { - draft.list = draft.list?.sort( - (a, b) => (a.then?.battles ?? 0) - (b.then?.battles ?? 0) - ); - }); - }} - > - {strings.website.tools.playlist.sort.least_played} - - - - + + + {strings.website.tools.playlist.tracking} + )} - + ); } diff --git a/packages/website/src/components/PlaylistTable.tsx b/packages/website/src/components/PlaylistTable.tsx index 6759d0635..bbf6abdc0 100644 --- a/packages/website/src/components/PlaylistTable.tsx +++ b/packages/website/src/components/PlaylistTable.tsx @@ -20,6 +20,7 @@ export function PlaylistTable() { height: "100%", width: "100%", borderRadius: 0, + whiteSpace: "nowrap", }} variant="surface" > diff --git a/packages/website/src/components/PlaylistTankEntry.tsx b/packages/website/src/components/PlaylistTankEntry.tsx index db424a9df..5a783d5f9 100644 --- a/packages/website/src/components/PlaylistTankEntry.tsx +++ b/packages/website/src/components/PlaylistTankEntry.tsx @@ -35,6 +35,7 @@ export const PlaylistTankEntry = memo( }} > - - {unwrap(tank.name)} - - - + + - {tank.testing && ( - - )} + - {unwrap(tank.name)} + {tank.testing && ( + + )} + + {unwrap(tank.name)} + ); diff --git a/packages/website/tsconfig.json b/packages/website/tsconfig.json index f0dab8b6a..db4d5dcac 100644 --- a/packages/website/tsconfig.json +++ b/packages/website/tsconfig.json @@ -3,10 +3,6 @@ "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "react", - "types": [ - "vite/client", - "vite-plugin-pwa/info.d.ts", - "vite-plugin-pwa/client.d.ts" - ] + "types": ["vite/client"] } }