From 0bba768fbf1635fed62104a09006fe5d3b338caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Wed, 28 Aug 2024 18:08:23 -0500 Subject: [PATCH] feat: deprecated tanks --- .vscode/settings.json | 1 + scripts/buildAssets/definitions.ts | 3 +- .../[id]/components/CalloutsSection.tsx | 37 +++++++++++++++++++ .../[id]/components/TestingSection.tsx | 23 ------------ src/app/tools/tankopedia/[id]/page.tsx | 4 +- src/core/blitzkit/tankDefinitions/index.ts | 3 +- 6 files changed, 44 insertions(+), 27 deletions(-) create mode 100644 src/app/tools/tankopedia/[id]/components/CalloutsSection.tsx delete mode 100644 src/app/tools/tankopedia/[id]/components/TestingSection.tsx diff --git a/.vscode/settings.json b/.vscode/settings.json index f24f382fa..15e2b4208 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -28,6 +28,7 @@ "blitzkit", "blitzrinth", "blitzstars", + "Callouts", "Camo", "CDON", "classname", diff --git a/scripts/buildAssets/definitions.ts b/scripts/buildAssets/definitions.ts index 318db172a..61b24dc17 100644 --- a/scripts/buildAssets/definitions.ts +++ b/scripts/buildAssets/definitions.ts @@ -813,7 +813,8 @@ export async function definitions() { : 'researchable', tier: tank.level as Tier, class: tankTags[0] as TankClass, - testing: tankTags.includes('testTank') ? true : undefined, + testing: tankTags.includes('testTank'), + deprecated: tankTags.includes('deprecated'), price: tankPrice, camouflage: { still: tankDefinition.root.invisibility.still, diff --git a/src/app/tools/tankopedia/[id]/components/CalloutsSection.tsx b/src/app/tools/tankopedia/[id]/components/CalloutsSection.tsx new file mode 100644 index 000000000..554bdfa37 --- /dev/null +++ b/src/app/tools/tankopedia/[id]/components/CalloutsSection.tsx @@ -0,0 +1,37 @@ +import { MinusCircledIcon } from '@radix-ui/react-icons'; +import { Callout, Flex } from '@radix-ui/themes'; +import { ExperimentIcon } from '../../../../../components/ExperimentIcon'; +import * as Duel from '../../../../../stores/duel'; + +export function CalloutsSection() { + const tank = Duel.use((state) => state.protagonist.tank); + + if (!tank.testing && !tank.deprecated) return null; + + return ( + + {tank.deprecated && ( + + + + + + This tank is deprecated and may display undefined behavior. + + + )} + + {tank.testing && ( + + + + + + Tanks in testing are subject to change and may not represent the + final product. + + + )} + + ); +} diff --git a/src/app/tools/tankopedia/[id]/components/TestingSection.tsx b/src/app/tools/tankopedia/[id]/components/TestingSection.tsx deleted file mode 100644 index 91d7795de..000000000 --- a/src/app/tools/tankopedia/[id]/components/TestingSection.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { Callout, Flex } from '@radix-ui/themes'; -import { ExperimentIcon } from '../../../../../components/ExperimentIcon'; -import * as Duel from '../../../../../stores/duel'; - -export function TestingSection() { - const tank = Duel.use((state) => state.protagonist.tank); - - if (!tank.testing) return null; - - return ( - - - - - - - Tanks in testing are subject to change and may not represent the final - product. - - - - ); -} diff --git a/src/app/tools/tankopedia/[id]/page.tsx b/src/app/tools/tankopedia/[id]/page.tsx index 1aa3d8b14..4e8740d8b 100644 --- a/src/app/tools/tankopedia/[id]/page.tsx +++ b/src/app/tools/tankopedia/[id]/page.tsx @@ -7,6 +7,7 @@ import PageWrapper from '../../../../components/PageWrapper'; import { useAdExempt } from '../../../../hooks/useAdExempt'; import * as Duel from '../../../../stores/duel'; import * as TankopediaEphemeral from '../../../../stores/tankopediaEphemeral'; +import { CalloutsSection } from './components/CalloutsSection'; import { HistorySection } from './components/HistorySection'; import { CharacteristicsSection } from './components/Model/CharacteristicsSection'; import { GameModeSection } from './components/Model/GameModeSection'; @@ -14,7 +15,6 @@ import { HeroSection } from './components/Model/HeroSection'; import { MetaSection } from './components/Model/MetaSection'; import { TechTreeSection } from './components/Model/TechTreeSection'; import { ShotDisplaySection } from './components/ShotDisplaySection'; -import { TestingSection } from './components/TestingSection'; import { VideoSection } from './components/VideoSection'; export default function Page({ params }: { params: { id: string } }) { @@ -83,10 +83,10 @@ export default function Page({ params }: { params: { id: string } }) { + {!exempt && } - {!exempt && } diff --git a/src/core/blitzkit/tankDefinitions/index.ts b/src/core/blitzkit/tankDefinitions/index.ts index 7c196541c..c71876e65 100644 --- a/src/core/blitzkit/tankDefinitions/index.ts +++ b/src/core/blitzkit/tankDefinitions/index.ts @@ -56,7 +56,8 @@ export interface TankDefinition { provisions: number; tier: Tier; class: TankClass; - testing?: boolean; + testing: boolean; + deprecated: boolean; turrets: TurretDefinition[]; engines: EngineDefinition[]; tracks: TrackDefinition[];