From a8a50ac948ccec441a743a96944d2becd9c5d321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Fri, 9 Feb 2024 23:44:38 -0600 Subject: [PATCH] feat: move fire to first --- .../[id]/components/Characteristics/index.tsx | 144 +++++++++--------- .../components/TankSearch/index.tsx | 132 ++++++++-------- 2 files changed, 138 insertions(+), 138 deletions(-) diff --git a/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx b/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx index 4abe8dcf4..344751a96 100644 --- a/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx +++ b/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx @@ -69,78 +69,6 @@ export function Characteristics() { return ( - - Survivability - - {(tank.health + turret.health) * (hasImprovedAssembly ? 1.06 : 1)} - - - {Math.round(engine.fireChance * 100)} - - - {turret.viewRange * - (hasImprovedOptics - ? tank.type === 'tankDestroyer' - ? 1.05 - : tank.type === 'heavy' - ? 1.07 - : 1.1 - : 1)} - - - - {tank.camouflage.still * - 100 * - (hasCamouflageNet - ? tank.type === 'heavy' - ? 1.03 - : tank.type === 'tankDestroyer' - ? 1.07 - : 1.05 - : 1)} - - - {tank.camouflage.moving * 100} - - - {tank.camouflage.still * gun.camouflageLoss * 100} - - - {tank.camouflage.moving * gun.camouflageLoss * 100} - - - {tank.camouflage.onFire * tank.camouflage.still * 100} - - - {size[0].toFixed(2)} x {size[2].toFixed(2)} x {size[1].toFixed(2)} - - - Fire {GUN_TYPE_NAMES[gun.type]} @@ -481,6 +409,78 @@ export function Characteristics() { (hasImprovedControl ? 1.1 : 1)} + + + Survivability + + {(tank.health + turret.health) * (hasImprovedAssembly ? 1.06 : 1)} + + + {Math.round(engine.fireChance * 100)} + + + {turret.viewRange * + (hasImprovedOptics + ? tank.type === 'tankDestroyer' + ? 1.05 + : tank.type === 'heavy' + ? 1.07 + : 1.1 + : 1)} + + + + {tank.camouflage.still * + 100 * + (hasCamouflageNet + ? tank.type === 'heavy' + ? 1.03 + : tank.type === 'tankDestroyer' + ? 1.07 + : 1.05 + : 1)} + + + {tank.camouflage.moving * 100} + + + {tank.camouflage.still * gun.camouflageLoss * 100} + + + {tank.camouflage.moving * gun.camouflageLoss * 100} + + + {tank.camouflage.onFire * tank.camouflage.still * 100} + + + {size[0].toFixed(2)} x {size[2].toFixed(2)} x {size[1].toFixed(2)} + + ); } diff --git a/src/app/tools/tankopedia/components/TankSearch/index.tsx b/src/app/tools/tankopedia/components/TankSearch/index.tsx index 833c1f942..bc2c89c3b 100644 --- a/src/app/tools/tankopedia/components/TankSearch/index.tsx +++ b/src/app/tools/tankopedia/components/TankSearch/index.tsx @@ -448,72 +448,6 @@ export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) { - - Survivability - - { - mutateTankopediaPersistent((draft) => { - draft.sort.by = 'survivability.health'; - }); - }} - > - Health - - { - mutateTankopediaPersistent((draft) => { - draft.sort.by = 'survivability.viewRange'; - }); - }} - > - View range - - { - mutateTankopediaPersistent((draft) => { - draft.sort.by = 'survivability.camouflageStill'; - }); - }} - > - Camouflage - - { - mutateTankopediaPersistent((draft) => { - draft.sort.by = 'survivability.camouflageMoving'; - }); - }} - > - Camouflage moving - - { - mutateTankopediaPersistent((draft) => { - draft.sort.by = 'survivability.camouflageShooting'; - }); - }} - > - Camouflage shooting - - { - mutateTankopediaPersistent((draft) => { - draft.sort.by = 'survivability.size'; - }); - }} - > - Size - - - - Fire @@ -708,6 +642,72 @@ export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) { + + Survivability + + { + mutateTankopediaPersistent((draft) => { + draft.sort.by = 'survivability.health'; + }); + }} + > + Health + + { + mutateTankopediaPersistent((draft) => { + draft.sort.by = 'survivability.viewRange'; + }); + }} + > + View range + + { + mutateTankopediaPersistent((draft) => { + draft.sort.by = 'survivability.camouflageStill'; + }); + }} + > + Camouflage + + { + mutateTankopediaPersistent((draft) => { + draft.sort.by = 'survivability.camouflageMoving'; + }); + }} + > + Camouflage moving + + { + mutateTankopediaPersistent((draft) => { + draft.sort.by = 'survivability.camouflageShooting'; + }); + }} + > + Camouflage shooting + + { + mutateTankopediaPersistent((draft) => { + draft.sort.by = 'survivability.size'; + }); + }} + > + Size + + + + Direction