From c34be61599d1dc617701839f44fb2cf0178e8e22 Mon Sep 17 00:00:00 2001 From: Oliveriver Date: Thu, 17 Oct 2024 23:32:21 +0100 Subject: [PATCH] Cleaner SVGs for unit icons --- client/src/assets/icons/Army.svg | 3 -- client/src/assets/icons/ArmyIcon.svg | 4 ++ client/src/assets/icons/Fleet.svg | 3 -- client/src/assets/icons/FleetIcon.svg | 6 +++ .../src/components/world/boards/UnitIcon.tsx | 44 ++++++++++--------- 5 files changed, 33 insertions(+), 27 deletions(-) delete mode 100644 client/src/assets/icons/Army.svg create mode 100644 client/src/assets/icons/ArmyIcon.svg delete mode 100644 client/src/assets/icons/Fleet.svg create mode 100644 client/src/assets/icons/FleetIcon.svg diff --git a/client/src/assets/icons/Army.svg b/client/src/assets/icons/Army.svg deleted file mode 100644 index 6fa5245..0000000 --- a/client/src/assets/icons/Army.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/client/src/assets/icons/ArmyIcon.svg b/client/src/assets/icons/ArmyIcon.svg new file mode 100644 index 0000000..00a5c4a --- /dev/null +++ b/client/src/assets/icons/ArmyIcon.svg @@ -0,0 +1,4 @@ + + + A + \ No newline at end of file diff --git a/client/src/assets/icons/Fleet.svg b/client/src/assets/icons/Fleet.svg deleted file mode 100644 index 049f844..0000000 --- a/client/src/assets/icons/Fleet.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/client/src/assets/icons/FleetIcon.svg b/client/src/assets/icons/FleetIcon.svg new file mode 100644 index 0000000..c7bd7b9 --- /dev/null +++ b/client/src/assets/icons/FleetIcon.svg @@ -0,0 +1,6 @@ + + + + + F + \ No newline at end of file diff --git a/client/src/components/world/boards/UnitIcon.tsx b/client/src/components/world/boards/UnitIcon.tsx index b5018bf..d2ae46b 100644 --- a/client/src/components/world/boards/UnitIcon.tsx +++ b/client/src/components/world/boards/UnitIcon.tsx @@ -2,9 +2,8 @@ import { getNationColour } from '../../../types/enums/nation'; import Unit from '../../../types/unit'; import UnitType from '../../../types/enums/unitType'; import { unitWidth } from '../../../utils/constants'; - -import ArmyIcon from '../../../assets/icons/Army.svg?react'; -import FleetIcon from '../../../assets/icons/Fleet.svg?react'; +import ArmyIcon from '../../../assets/icons/ArmyIcon.svg?react'; +import FleetIcon from '../../../assets/icons/FleetIcon.svg?react'; type UnitIconProps = { unit: Unit; @@ -14,26 +13,29 @@ type UnitIconProps = { const UnitIcon = ({ unit, scaleFactor = 1, variant = 'world' }: UnitIconProps) => { const isWorldVariant = variant === 'world'; - const shadow = unit.mustRetreat ? '0px 0px 2px red' : '0px 0px 2px black'; - const Svg = (unit.type === UnitType.Army ? ArmyIcon : FleetIcon); + const Svg = unit.type === UnitType.Army ? ArmyIcon : FleetIcon; return ( - - + <> + + {isWorldVariant && unit.mustRetreat && ( +
+ )} + ); -} - +}; export default UnitIcon;