mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: tank class and icon
This commit is contained in:
1 parent
6ef0610331
commit
4bc0a95973
1 file changed
+19
-9
@@ -1,6 +1,7 @@
|
|||||||
import { ChevronLeftIcon, MixIcon } from '@radix-ui/react-icons';
|
import { ChevronLeftIcon, MixIcon } from '@radix-ui/react-icons';
|
||||||
import { Button, Flex, Heading, Text } from '@radix-ui/themes';
|
import { Button, Flex, Heading, Text } from '@radix-ui/themes';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
import { classIcons } from '../../../../../../components/ClassIcon';
|
||||||
import { TIER_ROMAN_NUMERALS } from '../../../../../../core/blitzkit/tankDefinitions/constants';
|
import { TIER_ROMAN_NUMERALS } from '../../../../../../core/blitzkit/tankDefinitions/constants';
|
||||||
import { useFullScreen } from '../../../../../../hooks/useFullScreen';
|
import { useFullScreen } from '../../../../../../hooks/useFullScreen';
|
||||||
import { useWideFormat } from '../../../../../../hooks/useWideFormat';
|
import { useWideFormat } from '../../../../../../hooks/useWideFormat';
|
||||||
@@ -11,14 +12,15 @@ import { TankSandbox } from './TankSandbox';
|
|||||||
import { Options } from './components/Options';
|
import { Options } from './components/Options';
|
||||||
|
|
||||||
export function HeroSection() {
|
export function HeroSection() {
|
||||||
const protagonistTank = useDuel((state) => state.protagonist!.tank);
|
const protagonist = useDuel((state) => state.protagonist!.tank);
|
||||||
const antagonistTank = useDuel((state) => state.antagonist!.tank);
|
const antagonist = useDuel((state) => state.antagonist!.tank);
|
||||||
const wideFormat = useWideFormat(880);
|
const wideFormat = useWideFormat(880);
|
||||||
const compareTanks =
|
const compareTanks =
|
||||||
protagonistTank.id === antagonistTank.id
|
protagonist.id === antagonist.id
|
||||||
? [protagonistTank.id]
|
? [protagonist.id]
|
||||||
: [protagonistTank.id, antagonistTank.id];
|
: [protagonist.id, antagonist.id];
|
||||||
const isFullScreen = useFullScreen();
|
const isFullScreen = useFullScreen();
|
||||||
|
const Icon = classIcons[protagonist.class];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
@@ -58,18 +60,26 @@ export function HeroSection() {
|
|||||||
<Heading
|
<Heading
|
||||||
size={wideFormat ? '9' : '8'}
|
size={wideFormat ? '9' : '8'}
|
||||||
align={wideFormat ? undefined : 'center'}
|
align={wideFormat ? undefined : 'center'}
|
||||||
|
color={
|
||||||
|
protagonist.treeType === 'collector'
|
||||||
|
? 'blue'
|
||||||
|
: protagonist.treeType === 'premium'
|
||||||
|
? 'amber'
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{protagonistTank.nameFull ?? protagonistTank.name}
|
<Icon style={{ width: '0.75em', height: '0.75em' }} />{' '}
|
||||||
|
{protagonist.nameFull ?? protagonist.name}
|
||||||
</Heading>
|
</Heading>
|
||||||
|
|
||||||
<Text color="gray">
|
<Text color="gray">
|
||||||
Tier {TIER_ROMAN_NUMERALS[protagonistTank.tier]}{' '}
|
Tier {TIER_ROMAN_NUMERALS[protagonist.tier]}{' '}
|
||||||
{
|
{
|
||||||
(strings.common.nations_adjectives as Record<string, string>)[
|
(strings.common.nations_adjectives as Record<string, string>)[
|
||||||
protagonistTank.nation
|
protagonist.nation
|
||||||
]
|
]
|
||||||
}{' '}
|
}{' '}
|
||||||
{strings.common.tank_class_short[protagonistTank.class]}
|
{strings.common.tank_class_short[protagonist.class]}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Flex gap="4" mt="-1">
|
<Flex gap="4" mt="-1">
|
||||||
|
|||||||
Reference in new issue
Block a user