From 15a14c63b6e0fcdcd83dd7da750e8b00c784b9c4 Mon Sep 17 00:00:00 2001 From: Innei Date: Wed, 15 Jan 2025 16:59:08 +0800 Subject: [PATCH] fix: conditionally render feed preview and items based on entries availability - Updated the rendering logic in the share list component to display the feed preview and items only when there are entries available. This change enhances the user experience by preventing empty states and ensuring that the UI reflects the current data accurately. Signed-off-by: Innei --- .../client/pages/(main)/share/lists/[id]/index.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/server/client/pages/(main)/share/lists/[id]/index.tsx b/apps/server/client/pages/(main)/share/lists/[id]/index.tsx index b8ec3c1ce..7b6d14e1f 100644 --- a/apps/server/client/pages/(main)/share/lists/[id]/index.tsx +++ b/apps/server/client/pages/(main)/share/lists/[id]/index.tsx @@ -113,10 +113,14 @@ export function Component() { )} -
{t("feed.preview")}
-
- -
+ {!!list.data.entries?.length && ( + <> +
{t("feed.preview")}
+
+ +
+ + )} ) )}