From a7f2c3e324157f3067026645889634f101031542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Sat, 4 May 2024 16:37:36 -0500 Subject: [PATCH] feat: responsive tech tree --- .../[id]/components/Model/TechTreeSection.tsx | 55 ++++++++++--------- src/components/Navbar/index.tsx | 2 +- src/components/PageWrapper.tsx | 2 +- 3 files changed, 32 insertions(+), 27 deletions(-) diff --git a/src/app/tools/tankopedia/[id]/components/Model/TechTreeSection.tsx b/src/app/tools/tankopedia/[id]/components/Model/TechTreeSection.tsx index efc575ed3..830576853 100644 --- a/src/app/tools/tankopedia/[id]/components/Model/TechTreeSection.tsx +++ b/src/app/tools/tankopedia/[id]/components/Model/TechTreeSection.tsx @@ -6,6 +6,7 @@ import PageWrapper from '../../../../../../components/PageWrapper'; import { asset } from '../../../../../../core/blitzkit/asset'; import { tankDefinitions } from '../../../../../../core/blitzkit/tankDefinitions'; import { TIER_ROMAN_NUMERALS } from '../../../../../../core/blitzkit/tankDefinitions/constants'; +import { useWideFormat } from '../../../../../../hooks/useWideFormat'; import { useDuel } from '../../../../../../stores/duel'; export function TreeArrow({ @@ -50,6 +51,7 @@ export function TreeArrow({ } export function TechTreeSection() { + const wideFormat = useWideFormat(720); const awaitedTankDefinitions = use(tankDefinitions); const tank = useDuel((state) => state.protagonist!.tank); @@ -65,6 +67,7 @@ export function TechTreeSection() { style={{ textDecoration: 'none', color: 'inherit', + position: 'relative', }} > @@ -125,9 +128,6 @@ export function TechTreeSection() { return ( - {tank.nation} - {/* Tech tree */} @@ -159,15 +145,14 @@ export function TechTreeSection() { {tank.ancestors && ( <> - + )} - + + {tank.nation} + {tank.successors && ( <> - +