From 2befee55f2241269e1141b3aa8197e54e1c55e94 Mon Sep 17 00:00:00 2001 From: Felicitas Pojtinger Date: Fri, 10 Feb 2023 22:02:55 +0100 Subject: [PATCH] refactor: Render current days in headers/footers --- components/home.tsx | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/components/home.tsx b/components/home.tsx index a6a0c40..d69e575 100644 --- a/components/home.tsx +++ b/components/home.tsx @@ -193,15 +193,7 @@ const EntryCard: React.FC = ({ } {...otherProps} > - - {entry.title} - {showDay && ( - <> - {" "} - · Day {entry.day} - - )} - + {entry.title} {entry.text} = ({ default: "alignItemsCenter", }} > - {showDate && ( - - {entry.date.toLocaleTimeString("default", { - weekday: "long", - hour: "2-digit", - minute: "2-digit", - })} - - )} + + {showDate + ? entry.date.toLocaleTimeString("default", { + weekday: "long", + hour: "2-digit", + minute: "2-digit", + }) + : entry.date.toLocaleTimeString("default", { + hour: "2-digit", + minute: "2-digit", + })} + + {showDay && ( + <> + {" "} + · Day {entry.day} + + )} +