From 8d9549f7d5a20249fcc94143329b0405ed1eaff4 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sat, 31 Oct 2026 18:06:49 -0500 Subject: [PATCH] get over it --- .../components/TankSearch/index.module.css | 11 +-- .../src/components/TankSearch/index.tsx | 94 ++++++++++--------- .../website/src/components/TankSearchSort.tsx | 14 +-- .../src/components/Tooltip/index.module.css | 3 +- .../src/stores/tankopediaPersistent/index.ts | 4 +- 5 files changed, 62 insertions(+), 64 deletions(-) diff --git a/packages/website/src/components/TankSearch/index.module.css b/packages/website/src/components/TankSearch/index.module.css index aeef2c738..1bf4a5144 100644 --- a/packages/website/src/components/TankSearch/index.module.css +++ b/packages/website/src/components/TankSearch/index.module.css @@ -8,14 +8,13 @@ .label { margin: var(--space-4) 0; - /* mt="2" gap="1" align="center" justify="center" direction="column" */ + display: flex; + justify-content: center; .count { - /* gap="2" */ + display: flex; + flex-direction: column; + gap: var(--space-2); } } - - .test-warning { - /* justify="center" mt="4" */ - } } diff --git a/packages/website/src/components/TankSearch/index.tsx b/packages/website/src/components/TankSearch/index.tsx index b5919fb91..d0fedc80c 100644 --- a/packages/website/src/components/TankSearch/index.tsx +++ b/packages/website/src/components/TankSearch/index.tsx @@ -29,7 +29,6 @@ import { import type { MaybeSkeletonComponentProps } from "../../types/maybeSkeletonComponentProps"; import { Callout } from "../Callout"; import { ExperimentIcon } from "../ExperimentIcon"; -import { Flex } from "../Flex"; import { IncrementalLoader } from "../IncrementalLoader"; import { Link } from "../Link"; import { RecentlyViewedTanks } from "../RecentlyViewedTanks"; @@ -218,52 +217,59 @@ export const TankSearch = memo( {!skeleton && !compact && } {sorted.length > 0 && ( - -
- - {sorted.length === 1 - ? strings.website.common.tank_search.count_singular - : literals(strings.website.common.tank_search.count_plural, { - count: sorted.length.toLocaleString(locale), - })} - +
+ + {sorted.length === 1 + ? strings.website.common.tank_search.count_singular + : literals(strings.website.common.tank_search.count_plural, { + count: sorted.length.toLocaleString(locale), + })} + + {sortConfig && ( + <> + {" - "} + {literals(strings.website.common.tank_search.sorting_by, { + name: ( + strings.tanks.characteristics.items as Record< + string, + string + > + )[sortConfig], + })} + ,{" "} + { + strings.website.common.tank_search.sort.direction[ + tankopediaSort.direction + ] + } + + )} {onSelectAll && ( - { - event.preventDefault(); - onSelectAll(sorted); - TankopediaPersistent.mutate((draft) => { - draft.recentlyViewed = uniq([ - ...sorted.map(({ id }) => id), - ...draft.recentlyViewed, - ]) - .filter((id) => id in tankDefinitions.tanks) - .slice(0, MAX_RECENTLY_VIEWED); - }); - }} - > - {strings.website.common.tank_search.select_all} - + <> + {" "} + { + event.preventDefault(); + onSelectAll(sorted); + TankopediaPersistent.mutate((draft) => { + draft.recentlyViewed = uniq([ + ...sorted.map(({ id }) => id), + ...draft.recentlyViewed, + ]) + .filter((id) => id in tankDefinitions.tanks) + .slice(0, MAX_RECENTLY_VIEWED); + }); + }} + > + {strings.website.common.tank_search.select_all} + + )} -
- - {sortConfig && ( - - {literals(strings.website.common.tank_search.sorting_by, { - name: ( - strings.tanks.characteristics.items as Record< - string, - string - > - )[sortConfig], - })} - , {tankopediaSort.direction} - - )} - + +
)} {tankFilters.showTesting && !tankFilters.showNonTesting && ( diff --git a/packages/website/src/components/TankSearchSort.tsx b/packages/website/src/components/TankSearchSort.tsx index 5cefb3be5..2bfc7d288 100644 --- a/packages/website/src/components/TankSearchSort.tsx +++ b/packages/website/src/components/TankSearchSort.tsx @@ -107,10 +107,8 @@ export function TankSearchSort() { {strings.website.common.tank_search.sort.direction.label} { - const value = Number(_value); - + value={direction} + onValueChange={(value) => { if ( value !== TankopediaSortDirection.Ascending && value !== TankopediaSortDirection.Descending @@ -123,18 +121,14 @@ export function TankSearchSort() { }); }} > - + {strings.website.common.tank_search.sort.direction.ascending} - + diff --git a/packages/website/src/components/Tooltip/index.module.css b/packages/website/src/components/Tooltip/index.module.css index 523ac4075..19073f2bc 100644 --- a/packages/website/src/components/Tooltip/index.module.css +++ b/packages/website/src/components/Tooltip/index.module.css @@ -32,8 +32,7 @@ } } - &:hover, - &:focus-within { + &:hover { .text { display: block; } diff --git a/packages/website/src/stores/tankopediaPersistent/index.ts b/packages/website/src/stores/tankopediaPersistent/index.ts index 24cb9b583..c4162e751 100644 --- a/packages/website/src/stores/tankopediaPersistent/index.ts +++ b/packages/website/src/stores/tankopediaPersistent/index.ts @@ -1,8 +1,8 @@ import { Soapstone } from "soapstone"; export enum TankopediaSortDirection { - Ascending, - Descending, + Ascending = "ascending", + Descending = "descending", } export interface TankopediaPersistent {