1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-22 09:13:19 +01:00

tweak location display logic

This commit is contained in:
Matthias Kretschmann 2024-04-21 14:38:01 +01:00
parent 519e587e5a
commit 4cdb1ed0c0
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -42,8 +42,10 @@ export default function Location() {
return ( return (
<div className={styles.wrapper}> <div className={styles.wrapper}>
{!isPending && location?.now?.city ? ( {!isPending ? (
<Animation> <Animation>
{location?.now?.city ? (
<>
<Flag <Flag
country={{ country={{
code: location.now.country_code, code: location.now.country_code,
@ -51,9 +53,11 @@ export default function Location() {
}} }}
/> />
{location.now.city} <span>Now</span> {location.now.city} <span>Now</span>
<div className={styles.next}> </>
) : null}
{location?.next?.city && ( {location?.next?.city && (
<> <div className={styles.next}>
{isDifferentCountry && ( {isDifferentCountry && (
<Flag <Flag
country={{ country={{
@ -66,9 +70,8 @@ export default function Location() {
<span> <span>
{relativeTime.from(new Date(location.next.date_start))} {relativeTime.from(new Date(location.next.date_start))}
</span> </span>
</>
)}
</div> </div>
)}
</Animation> </Animation>
) : null} ) : null}
</div> </div>