mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: class and type sorting
This commit is contained in:
1 parent
d6e37119a8
commit
ee1ecb83b7
3 files changed
+5
-2
No files matched your search
@@ -27,7 +27,7 @@ export function TankCard({ id }: TankCardProps) {
|
|||||||
<div
|
<div
|
||||||
className={styles.flag}
|
className={styles.flag}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(/api/nations/${tank.tank!.nation}.webp)`,
|
backgroundImage: `url(/api/nations/${tank.tank!.nation}/card.webp)`,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ function Content() {
|
|||||||
const tanksOrdered = useMemo(() => {
|
const tanksOrdered = useMemo(() => {
|
||||||
let list = Object.values(tanks.tanks);
|
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) =>
|
list = list.sort((a, b) =>
|
||||||
compareTiers(a.tank!.tier_catalog_id, b.tank!.tier_catalog_id),
|
compareTiers(a.tank!.tier_catalog_id, b.tank!.tier_catalog_id),
|
||||||
);
|
);
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import { Nation } from "@protos/game/proto/legacy/blitz_static_tank_component";
|
import { Nation } from "@protos/game/proto/legacy/blitz_static_tank_component";
|
||||||
import type { APIContext, GetStaticPaths } from "astro";
|
import type { APIContext, GetStaticPaths } from "astro";
|
||||||
import { game } from "../../../core/game/game";
|
import { game } from "../../../../core/game/game";
|
||||||
|
|
||||||
export const getStaticPaths = (async () => {
|
export const getStaticPaths = (async () => {
|
||||||
return Object.values(Nation)
|
return Object.values(Nation)
|
||||||
Reference in new issue
Block a user