feat: deprecated tanks

This commit is contained in:
TrèsAbhi committed 2024-08-28 18:08:23 -05:00
1 parent 8f12a77e12
commit 0bba768fbf
6 files changed
+44 -27

No files matched your search

+1
View File
@@ -28,6 +28,7 @@
"blitzkit",
"blitzrinth",
"blitzstars",
"Callouts",
"Camo",
"CDON",
"classname",
+2 -1
View File
@@ -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,
@@ -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 (
<Flex direction="column" align="center" gap="2" mb="4">
{tank.deprecated && (
<Callout.Root color="red">
<Callout.Icon>
<MinusCircledIcon />
</Callout.Icon>
<Callout.Text>
This tank is deprecated and may display undefined behavior.
</Callout.Text>
</Callout.Root>
)}
{tank.testing && (
<Callout.Root color="red">
<Callout.Icon>
<ExperimentIcon style={{ width: '1em', height: '1em' }} />
</Callout.Icon>
<Callout.Text>
Tanks in testing are subject to change and may not represent the
final product.
</Callout.Text>
</Callout.Root>
)}
</Flex>
);
}
@@ -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 (
<Flex justify="center" mb="4">
<Callout.Root>
<Callout.Icon>
<ExperimentIcon style={{ width: '1em', height: '1em' }} />
</Callout.Icon>
<Callout.Text>
Tanks in testing are subject to change and may not represent the final
product.
</Callout.Text>
</Callout.Root>
</Flex>
);
}
+2 -2
View File
@@ -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 } }) {
<PageWrapper p="0" noMaxWidth color="purple" size={1600} gap="9">
<HeroSection id={id} />
<ShotDisplaySection />
<CalloutsSection />
<MetaSection />
{!exempt && <AdMidSectionResponsive />}
<TechTreeSection />
<TestingSection />
<CharacteristicsSection />
{!exempt && <AdMidSectionResponsive />}
<GameModeSection />
+2 -1
View File
@@ -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[];