From b07ed3f6154d116e884f86bb8f033186fa336dc6 Mon Sep 17 00:00:00 2001 From: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> Date: Tue, 12 Mar 2024 20:30:19 +0100 Subject: [PATCH] fix(web): correctly use button and link elements (#7907) --- .../asset-viewer/detail-panel.svelte | 134 ++++++++---------- .../sharedlinks-page/shared-link-card.svelte | 11 +- 2 files changed, 64 insertions(+), 81 deletions(-) diff --git a/web/src/lib/components/asset-viewer/detail-panel.svelte b/web/src/lib/components/asset-viewer/detail-panel.svelte index aa6905a4d6..334b406bb0 100644 --- a/web/src/lib/components/asset-viewer/detail-panel.svelte +++ b/web/src/lib/components/asset-viewer/detail-panel.svelte @@ -258,62 +258,58 @@
{person.name}
- {#if person.birthDate} - {@const personBirthDate = DateTime.fromISO(person.birthDate)} - {@const age = Math.floor(DateTime.fromISO(asset.fileCreatedAt).diff(personBirthDate, 'years').years)} - {@const ageInMonths = Math.floor( - DateTime.fromISO(asset.fileCreatedAt).diff(personBirthDate, 'months').months, - )} - {#if age >= 0} -- {#if ageInMonths <= 11} - Age {ageInMonths} months - {:else} - Age {age} - {/if} -
- {/if} +{person.name}
+ {#if person.birthDate} + {@const personBirthDate = DateTime.fromISO(person.birthDate)} + {@const age = Math.floor(DateTime.fromISO(asset.fileCreatedAt).diff(personBirthDate, 'years').years)} + {@const ageInMonths = Math.floor( + DateTime.fromISO(asset.fileCreatedAt).diff(personBirthDate, 'months').months, + )} + {#if age >= 0} ++ {#if ageInMonths <= 11} + Age {ageInMonths} months + {:else} + Age {age} + {/if} +
{/if} - -