From 2f07ec1b74f956d02b8425c390191a061122891e Mon Sep 17 00:00:00 2001 From: guarzo Date: Wed, 5 Feb 2025 10:22:10 -0700 Subject: [PATCH] fix: color and formatting fixes for local character (#150) --- .../ui-kit/CharacterCard/CharacterCard.tsx | 61 +++++++------------ 1 file changed, 23 insertions(+), 38 deletions(-) diff --git a/assets/js/hooks/Mapper/components/ui-kit/CharacterCard/CharacterCard.tsx b/assets/js/hooks/Mapper/components/ui-kit/CharacterCard/CharacterCard.tsx index f6c60481..0b52b235 100644 --- a/assets/js/hooks/Mapper/components/ui-kit/CharacterCard/CharacterCard.tsx +++ b/assets/js/hooks/Mapper/components/ui-kit/CharacterCard/CharacterCard.tsx @@ -26,12 +26,6 @@ export const getShipName = (name: string) => { ); }; -const Divider = () => ( - -); - export const CharacterCard = ({ compact = false, isOwn, @@ -50,6 +44,7 @@ export const CharacterCard = ({ const shipNameText = char.ship?.ship_name ? getShipName(char.ship.ship_name) : ''; const tickerText = char.alliance_id ? char.alliance_ticker : char.corporation_ticker; const shipType = char.ship?.ship_type_info?.name; + const locationShown = showSystem && char.location?.solar_system_id; if (compact) { return ( @@ -71,18 +66,19 @@ export const CharacterCard = ({ />
- {char.name} - - {showShipName && shipNameText ? ( - {shipNameText} - ) : ( - [{tickerText}] - )} + + {char.name} + {" "} + + {(!locationShown && showShipName && shipNameText) + ? `- ${shipNameText}` + : `[${tickerText}]`} +
{shipType && (
@@ -93,8 +89,6 @@ export const CharacterCard = ({
); } else { - const locationShown = showSystem && char.location?.solar_system_id; - return (
- {char.name} - - [{tickerText}] + + {char.name} + {" "} + [{tickerText}]
{locationShown ? (
@@ -132,25 +127,15 @@ export const CharacterCard = ({ ) )}
- {((shipType) || (locationShown && shipNameText)) && ( + {shipType && (
- {shipType && ( -
- {shipType} -
- )} - {locationShown && shipNameText && ( -
- {shipNameText} -
- )} +
+ {shipType} +
)}