From e4ca9f7e9e221a7bb89f78e748cd9a4af7dcd9e1 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Fri, 11 Aug 2023 11:56:51 +0200 Subject: [PATCH] Don't render unecessarily date of birth --- geneit_app/src/widgets/MemberItem.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/geneit_app/src/widgets/MemberItem.tsx b/geneit_app/src/widgets/MemberItem.tsx index acc2fcb..4b4fdaa 100644 --- a/geneit_app/src/widgets/MemberItem.tsx +++ b/geneit_app/src/widgets/MemberItem.tsx @@ -33,9 +33,13 @@ export function MemberItem(p: { {p.member?.dead && } } - secondary={`${fmtDate(p.member?.dateOfBirth)} - ${fmtDate( - p.member?.dateOfDeath - )}`} + secondary={ + p.member?.dead + ? `${fmtDate(p.member?.dateOfBirth)} - ${fmtDate( + p.member?.dateOfDeath + )}` + : fmtDate(p.member?.dateOfBirth) + } /> {p.secondary && ( {p.secondary}