From 2a2994ae69874a4c500eeb54648a75b8197f95ee Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Thu, 17 Apr 2025 13:00:53 -0500 Subject: [PATCH] feat: more responsive --- packages/i18n/strings/en.json | 2 +- .../{Heading.tsx => CompareOptions.tsx} | 17 +++-- .../CharacteristicsSection/index.tsx | 69 +++++++++---------- .../MetaSection/components/Listing.tsx | 3 +- .../Tankopedia/MetaSection/index.tsx | 8 +-- .../components/Tankopedia/VideoSection.tsx | 2 +- 6 files changed, 49 insertions(+), 52 deletions(-) rename packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/{Heading.tsx => CompareOptions.tsx} (84%) diff --git a/packages/i18n/strings/en.json b/packages/i18n/strings/en.json index 849f2daa9..81c900bc9 100644 --- a/packages/i18n/strings/en.json +++ b/packages/i18n/strings/en.json @@ -1010,7 +1010,7 @@ "characteristics": { "title": "Characteristics", "compare": { - "label": "Compare against", + "label": "Compare", "class": "Tier %s1 %s2", "tier": "All of tier %s1", "all": "All tanks" diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/Heading.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/CompareOptions.tsx similarity index 84% rename from packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/Heading.tsx rename to packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/CompareOptions.tsx index f03b81077..2c82ec205 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/Heading.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/CompareOptions.tsx @@ -1,6 +1,6 @@ import { TIER_ROMAN_NUMERALS } from '@blitzkit/core'; import { literals } from '@blitzkit/i18n/src/literals'; -import { Flex, Heading, SegmentedControl, Text } from '@radix-ui/themes'; +import { Flex, SegmentedControl, Text, type FlexProps } from '@radix-ui/themes'; import { useLocale } from '../../../../../../hooks/useLocale'; import { Duel } from '../../../../../../stores/duel'; import { @@ -8,7 +8,7 @@ import { TankopediaRelativeAgainst, } from '../../../../../../stores/tankopediaEphemeral'; -export function CharacteristicsHeading() { +export function CompareOptions(props: FlexProps) { const relativeAgainst = TankopediaEphemeral.use( (state) => state.relativeAgainst, ); @@ -18,19 +18,18 @@ export function CharacteristicsHeading() { return ( - - {strings.website.tools.tankopedia.characteristics.title} - - {strings.website.tools.tankopedia.characteristics.compare.label} + { mutateTankopediaEphemeral((draft) => { diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/index.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/index.tsx index 840f4c1c4..193d60475 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/index.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/index.tsx @@ -1,7 +1,6 @@ -import { Flex, Heading } from '@radix-ui/themes'; -import { useLocale } from '../../../hooks/useLocale'; +import { Flex } from '@radix-ui/themes'; import { Characteristics } from './components/Characteristics'; -import { CharacteristicsHeading } from './components/Characteristics/components/Heading'; +import { CompareOptions } from './components/Characteristics/components/CompareOptions'; import { Consumables } from './components/Consumables'; import { Equipment } from './components/Equipment'; import { Miscellaneous } from './components/Miscellaneous'; @@ -10,42 +9,42 @@ import { Provisions } from './components/Provisions'; import { Skills } from './components/Skills'; export function CharacteristicsSection() { - const { strings } = useLocale(); - return ( - - - - - {strings.website.tools.tankopedia.configuration.title} - - - - - - - - + + + + - - + + + + + + + + + + + + + diff --git a/packages/website/src/components/Tankopedia/MetaSection/components/Listing.tsx b/packages/website/src/components/Tankopedia/MetaSection/components/Listing.tsx index 369f1bdd5..79becdf1c 100644 --- a/packages/website/src/components/Tankopedia/MetaSection/components/Listing.tsx +++ b/packages/website/src/components/Tankopedia/MetaSection/components/Listing.tsx @@ -11,8 +11,7 @@ export function Listing({ label, ...props }: ListingProps) { minWidth="17rem" justify="between" gap="4" - px="1" - style={{ borderBottom: `1px solid ${Var('gray-11')}` }} + style={{ borderBottom: `1px solid ${Var('gray-a9')}` }} > {label} diff --git a/packages/website/src/components/Tankopedia/MetaSection/index.tsx b/packages/website/src/components/Tankopedia/MetaSection/index.tsx index bdd28a31a..ef108487f 100644 --- a/packages/website/src/components/Tankopedia/MetaSection/index.tsx +++ b/packages/website/src/components/Tankopedia/MetaSection/index.tsx @@ -24,12 +24,12 @@ export function MetaSection() { const ClassIcon = classIcons[protagonist.class]; const { locale, strings } = useLocale(); - console.log(protagonist.nation); - return ( diff --git a/packages/website/src/components/Tankopedia/VideoSection.tsx b/packages/website/src/components/Tankopedia/VideoSection.tsx index f910b2cde..f3e0ea55b 100644 --- a/packages/website/src/components/Tankopedia/VideoSection.tsx +++ b/packages/website/src/components/Tankopedia/VideoSection.tsx @@ -16,7 +16,7 @@ export function VideoSection({ skeleton }: MaybeSkeletonComponentProps) { const videos = reviews.reviews[tank.id]?.videos; const { strings } = useLocale(); - if (!videos) return null; + if (videos === undefined || videos.length === 0) return null; return (