From 4cdb1ed0c0daa7f1076ceaedfe0396fce8921db8 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sun, 21 Apr 2024 14:38:01 +0100 Subject: [PATCH] tweak location display logic --- src/components/Location/Location.tsx | 55 +++++++++++++++------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/src/components/Location/Location.tsx b/src/components/Location/Location.tsx index 035a949..09cad58 100644 --- a/src/components/Location/Location.tsx +++ b/src/components/Location/Location.tsx @@ -42,33 +42,36 @@ export default function Location() { return (
- {!isPending && location?.now?.city ? ( + {!isPending ? ( - - {location.now.city} Now -
- {location?.next?.city && ( - <> - {isDifferentCountry && ( - - )} - {location.next.city}{' '} - - {relativeTime.from(new Date(location.next.date_start))} - - - )} -
+ {location?.now?.city ? ( + <> + + {location.now.city} Now + + ) : null} + + {location?.next?.city && ( +
+ {isDifferentCountry && ( + + )} + {location.next.city}{' '} + + {relativeTime.from(new Date(location.next.date_start))} + +
+ )}
) : null}