From 818f74ecfd20365bf41b3414430e4b328f5d4582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAnar=20Vestmann?= <43557895+RunarVestmann@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:12:51 +0000 Subject: [PATCH] feat(web): Generic List - Stop date from taking up space if it is not present (#17188) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../components/GenericList/GenericList.tsx | 67 +++++++++++++------ 1 file changed, 47 insertions(+), 20 deletions(-) diff --git a/apps/web/components/GenericList/GenericList.tsx b/apps/web/components/GenericList/GenericList.tsx index bbc7592e5172..3bc8dfc8ba48 100644 --- a/apps/web/components/GenericList/GenericList.tsx +++ b/apps/web/components/GenericList/GenericList.tsx @@ -15,6 +15,7 @@ import { GridColumn, GridContainer, GridRow, + Hyphen, Icon, type IconProps, Inline, @@ -85,9 +86,11 @@ export const NonClickableItem = ({ item }: ItemProps) => { - - {item.date && format(new Date(item.date), 'dd.MM.yyyy')} - + {item.date && ( + + {format(new Date(item.date), 'dd.MM.yyyy')} + + )} {item.title} @@ -153,24 +156,48 @@ export const ClickableItem = ({ item, baseUrl }: ClickableItemProps) => { - - - - {item.date && format(new Date(item.date), 'dd.MM.yyyy')} + {item.date && ( + + + + {format(new Date(item.date), 'dd.MM.yyyy')} + + {icon && ( + + )} + + + )} + + + + {item.title} - {icon && ( - - )} - - - - {item.title} - + + {!item.date && icon && ( + + + + + + )} + {item.cardIntro?.length > 0 && ( {webRichText(item.cardIntro ?? [])}