From 65e239a22b7dbf15934217a4b5ef26e4ae615213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Sun, 31 Mar 2024 22:16:29 -0500 Subject: [PATCH] feat: hide module actions on no upgrades --- .../Characteristics/components/Modules.tsx | 76 +++++++++++-------- 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/src/app/tools/tankopedia/[id]/components/Characteristics/components/Modules.tsx b/src/app/tools/tankopedia/[id]/components/Characteristics/components/Modules.tsx index 76dfe680c..ff1564892 100644 --- a/src/app/tools/tankopedia/[id]/components/Characteristics/components/Modules.tsx +++ b/src/app/tools/tankopedia/[id]/components/Characteristics/components/Modules.tsx @@ -7,42 +7,56 @@ import { ConfigurationChildWrapper } from './ConfigurationChildWrapper'; export function Modules() { const protagonist = useDuel((state) => state.protagonist!); + const hasUpgrades = + protagonist.tank.turrets.length > 1 || + protagonist.tank.turrets[0].guns.length > 1 || + protagonist.tank.engines.length > 1 || + protagonist.tank.tracks.length > 1; return ( Modules - - + {hasUpgrades && ( + <> + + + + )}