mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-05 00:07:20 +00:00
Add player-stats-table (#2088)
## Description: This PR adds the player-stats-table component, which displays a player’s statistics in a structured table format. It focuses on presenting core stats such as building stats, Player Metrics and more. The component will later be integrated into the player modal so that users can view detailed stats alongside other profile information. It should look like this: <img width="597" height="386" alt="スクリーンショット 2025-09-23 10 16 59" src="https://github.com/user-attachments/assets/9ae07a25-982f-45c4-9bf5-21c8b90d4fae" /> <img width="551" height="644" alt="スクリーンショット 2025-09-23 10 17 13" src="https://github.com/user-attachments/assets/1bdbca32-be2f-4c3a-b172-d11914b9a3cf" /> <img width="525" height="219" alt="スクリーンショット 2025-09-23 10 17 41" src="https://github.com/user-attachments/assets/7da45a98-8602-4b25-b455-c51319752de9" /> ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: aotumuri
This commit is contained in:
+14
-16
@@ -1,12 +1,8 @@
|
||||
import { z } from "zod";
|
||||
import { UnitType } from "./game/Game";
|
||||
|
||||
export const BombUnitSchema = z.union([
|
||||
z.literal("abomb"),
|
||||
z.literal("hbomb"),
|
||||
z.literal("mirv"),
|
||||
z.literal("mirvw"),
|
||||
]);
|
||||
export const bombUnits = ["abomb", "hbomb", "mirv", "mirvw"] as const;
|
||||
export const BombUnitSchema = z.enum(bombUnits);
|
||||
export type BombUnit = z.infer<typeof BombUnitSchema>;
|
||||
export type NukeType =
|
||||
| UnitType.AtomBomb
|
||||
@@ -21,7 +17,8 @@ export const unitTypeToBombUnit = {
|
||||
[UnitType.MIRVWarhead]: "mirvw",
|
||||
} as const satisfies Record<NukeType, BombUnit>;
|
||||
|
||||
export const BoatUnitSchema = z.union([z.literal("trade"), z.literal("trans")]);
|
||||
export const boatUnits = ["trade", "trans"] as const;
|
||||
export const BoatUnitSchema = z.enum(boatUnits);
|
||||
export type BoatUnit = z.infer<typeof BoatUnitSchema>;
|
||||
export type BoatUnitType = UnitType.TradeShip | UnitType.TransportShip;
|
||||
|
||||
@@ -30,15 +27,16 @@ export type BoatUnitType = UnitType.TradeShip | UnitType.TransportShip;
|
||||
// [UnitType.TransportShip]: "trans",
|
||||
// } as const satisfies Record<BoatUnitType, BoatUnit>;
|
||||
|
||||
export const OtherUnitSchema = z.union([
|
||||
z.literal("city"),
|
||||
z.literal("defp"),
|
||||
z.literal("port"),
|
||||
z.literal("wshp"),
|
||||
z.literal("silo"),
|
||||
z.literal("saml"),
|
||||
z.literal("fact"),
|
||||
]);
|
||||
export const otherUnits = [
|
||||
"city",
|
||||
"defp",
|
||||
"port",
|
||||
"wshp",
|
||||
"silo",
|
||||
"saml",
|
||||
"fact",
|
||||
] as const;
|
||||
export const OtherUnitSchema = z.enum(otherUnits);
|
||||
export type OtherUnit = z.infer<typeof OtherUnitSchema>;
|
||||
export type OtherUnitType =
|
||||
| UnitType.City
|
||||
|
||||
Reference in New Issue
Block a user