From ee1ecb83b76ce9b0de69aa15ade2e63a6917f3f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Tue, 28 Apr 2026 15:11:20 -0500 Subject: [PATCH] feat: class and type sorting --- packages/website-ue/src/components/TankCard/index.tsx | 2 +- packages/website-ue/src/pages/[...locale]/tanks/_index.tsx | 3 +++ .../src/pages/api/nations/{[id].webp.ts => [id]/card.webp.ts} | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) rename packages/website-ue/src/pages/api/nations/{[id].webp.ts => [id]/card.webp.ts} (92%) diff --git a/packages/website-ue/src/components/TankCard/index.tsx b/packages/website-ue/src/components/TankCard/index.tsx index 7367b8a1a..fb110e90e 100644 --- a/packages/website-ue/src/components/TankCard/index.tsx +++ b/packages/website-ue/src/components/TankCard/index.tsx @@ -27,7 +27,7 @@ export function TankCard({ id }: TankCardProps) {
diff --git a/packages/website-ue/src/pages/[...locale]/tanks/_index.tsx b/packages/website-ue/src/pages/[...locale]/tanks/_index.tsx index 0aaec7d91..ccbaf2fb5 100644 --- a/packages/website-ue/src/pages/[...locale]/tanks/_index.tsx +++ b/packages/website-ue/src/pages/[...locale]/tanks/_index.tsx @@ -34,6 +34,9 @@ function Content() { const tanksOrdered = useMemo(() => { let list = Object.values(tanks.tanks); + list = list.sort((a, b) => a.tank!.tank_type - b.tank!.tank_type); + list = list.sort((a, b) => a.tank!.tank_class - b.tank!.tank_class); + list = list.sort((a, b) => a.tank!.nation - b.tank!.nation); list = list.sort((a, b) => compareTiers(a.tank!.tier_catalog_id, b.tank!.tier_catalog_id), ); diff --git a/packages/website-ue/src/pages/api/nations/[id].webp.ts b/packages/website-ue/src/pages/api/nations/[id]/card.webp.ts similarity index 92% rename from packages/website-ue/src/pages/api/nations/[id].webp.ts rename to packages/website-ue/src/pages/api/nations/[id]/card.webp.ts index 870c3c2b7..447484749 100644 --- a/packages/website-ue/src/pages/api/nations/[id].webp.ts +++ b/packages/website-ue/src/pages/api/nations/[id]/card.webp.ts @@ -1,6 +1,6 @@ import { Nation } from "@protos/game/proto/legacy/blitz_static_tank_component"; import type { APIContext, GetStaticPaths } from "astro"; -import { game } from "../../../core/game/game"; +import { game } from "../../../../core/game/game"; export const getStaticPaths = (async () => { return Object.values(Nation)