From 87438abaa38d9130181af6c834c51a7675cd5299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Wed, 31 Dec 2025 13:38:18 -0600 Subject: [PATCH] feat: simplify --- .../TankSearch/components/FilterControl.tsx | 67 ++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/packages/website/src/components/TankSearch/components/FilterControl.tsx b/packages/website/src/components/TankSearch/components/FilterControl.tsx index 6e57a2164..fba0b8019 100644 --- a/packages/website/src/components/TankSearch/components/FilterControl.tsx +++ b/packages/website/src/components/TankSearch/components/FilterControl.tsx @@ -7,7 +7,11 @@ import { TankType, TIER_ROMAN_NUMERALS, } from "@blitzkit/core"; -import { TrashIcon } from "@radix-ui/react-icons"; +import { + LockClosedIcon, + LockOpen2Icon, + TrashIcon, +} from "@radix-ui/react-icons"; import { Box, Button, @@ -15,11 +19,14 @@ import { Flex, IconButton, Text, + Tooltip, + type FlexProps, } from "@radix-ui/themes"; import { times } from "lodash-es"; import type { ComponentProps, ReactNode } from "react"; import { awaitableGameDefinitions } from "../../../core/awaitables/gameDefinitions"; import { useLocale } from "../../../hooks/useLocale"; +import { App } from "../../../stores/app"; import { TankFilters, type CaseType } from "../../../stores/tankFilters"; import { classIcons } from "../../ClassIcon"; import { GunAutoloaderIcon } from "../../GunAutoloaderIcon"; @@ -69,6 +76,7 @@ export function FilterControl() { + ); } @@ -587,3 +595,60 @@ function IndividualShellFilter({ ); } + +function OwnershipFilter() { + const wargaming = App.use((state) => state.logins.wargaming); + const { strings } = useLocale(); + + return wargaming ? ( + + ) : ( + + + + ); +} + +function OwnershipFilterInternal(props: FlexProps) { + const wargaming = App.use((state) => state.logins.wargaming); + const showOwned = TankFilters.use((state) => state.showOwned); + const showUnowned = TankFilters.use((state) => state.showUnowned); + + return ( + + { + TankFilters.mutate((draft) => { + draft.showOwned = !draft.showOwned; + }); + }} + > + + + + { + TankFilters.mutate((draft) => { + draft.showUnowned = !draft.showUnowned; + }); + }} + > + + + + ); +}