From 76dc9f0742aa60eb77d1088a1f3b57b171c1d14b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Wed, 29 Apr 2026 10:46:37 -0500 Subject: [PATCH] feat: node rendering Co-authored-by: Copilot --- ...sticsOrder.ts => characteristicsOrder.tsx} | 9 ++++++- .../src/hooks/useCharacteristicRenderer.ts | 4 +-- packages/website-ue/src/icons/Vintage.tsx | 26 +++++++++++++++++++ .../pages/[...locale]/tanks/[slug]/_index.tsx | 6 ----- 4 files changed, 36 insertions(+), 9 deletions(-) rename packages/website-ue/src/core/tankopedia/{characteristicsOrder.ts => characteristicsOrder.tsx} (94%) create mode 100644 packages/website-ue/src/icons/Vintage.tsx diff --git a/packages/website-ue/src/core/tankopedia/characteristicsOrder.ts b/packages/website-ue/src/core/tankopedia/characteristicsOrder.tsx similarity index 94% rename from packages/website-ue/src/core/tankopedia/characteristicsOrder.ts rename to packages/website-ue/src/core/tankopedia/characteristicsOrder.tsx index 5dfaee313..fc8175c79 100644 --- a/packages/website-ue/src/core/tankopedia/characteristicsOrder.ts +++ b/packages/website-ue/src/core/tankopedia/characteristicsOrder.tsx @@ -4,6 +4,8 @@ import { TankClass, TankType, } from "@protos/game/proto/legacy/blitz_static_tank_component"; +import type { ReactNode } from "react"; +import { VintageIcon } from "../../icons/Vintage"; import { GunType, type CharacteristicName, @@ -24,7 +26,7 @@ export interface CharacteristicRenderConfig { output: CharacteristicOutput; strings: Strings; gameStrings: Record; - }) => string; + }) => ReactNode; } type CharacteristicsOrder = { @@ -52,6 +54,11 @@ export const characteristicsOrder: CharacteristicsOrder = [ name: "tier", render({ output, strings }) { const [, name] = (output as string).split("."); + + if (name == "vintage") { + return ; + } + return strings.tiers[name as keyof typeof strings.tiers]; }, }, diff --git a/packages/website-ue/src/hooks/useCharacteristicRenderer.ts b/packages/website-ue/src/hooks/useCharacteristicRenderer.ts index c41d09893..436627a94 100644 --- a/packages/website-ue/src/hooks/useCharacteristicRenderer.ts +++ b/packages/website-ue/src/hooks/useCharacteristicRenderer.ts @@ -1,4 +1,4 @@ -import { useMemo } from "react"; +import { useMemo, type ReactNode } from "react"; import type { CharacteristicOutput } from "../core/tankopedia/characteristics"; import { characteristicsOrder, @@ -28,7 +28,7 @@ export function useCharacteristicRenderer() { function renderCharacteristic( characteristic: CharacteristicOutput, config: CharacteristicRenderConfig, - ): string | null { + ): ReactNode { if (characteristic === null) return null; if (config.render) diff --git a/packages/website-ue/src/icons/Vintage.tsx b/packages/website-ue/src/icons/Vintage.tsx new file mode 100644 index 000000000..010f839da --- /dev/null +++ b/packages/website-ue/src/icons/Vintage.tsx @@ -0,0 +1,26 @@ +import type { ComponentProps } from "react"; + +export function VintageIcon(props: ComponentProps<"svg">) { + return ( + + + + + + + + + + + ); +} diff --git a/packages/website-ue/src/pages/[...locale]/tanks/[slug]/_index.tsx b/packages/website-ue/src/pages/[...locale]/tanks/[slug]/_index.tsx index 23c05944d..75a68b965 100644 --- a/packages/website-ue/src/pages/[...locale]/tanks/[slug]/_index.tsx +++ b/packages/website-ue/src/pages/[...locale]/tanks/[slug]/_index.tsx @@ -149,12 +149,6 @@ function Content() {

characteristics

- {/* {Object.entries(characteristics).map(([key, value]) => ( -

- {key}: {value} -

- ))} */} - {characteristicsOrder.map((group) => { return ( <>