From b652d73fa6a21b6d49198742d260f3629db4b939 Mon Sep 17 00:00:00 2001 From: Ou Date: Sat, 5 Oct 2024 01:23:39 +0800 Subject: [PATCH] pref: card extra info ui --- src/components/section/Card.tsx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/components/section/Card.tsx b/src/components/section/Card.tsx index 2a87cbf..8baff18 100644 --- a/src/components/section/Card.tsx +++ b/src/components/section/Card.tsx @@ -119,7 +119,7 @@ export function NewsCard({ id, inView, isOverlay, handleListeners }: NewsCardPro defer className="h-full pl-2 pr-3 mr-1" element="div" - options={{ scrollbars: { autoHide: "scroll" } }} + options={{ scrollbars: { autoHide: "scroll" }, overflow: { x: "hidden" } }} > @@ -156,18 +156,12 @@ function Num({ num }: { num: number }) { function ExtraInfo({ item }: { item: NewsItem }) { if (item?.extra?.date) { - return ( - - {relativeTime(item.extra.date)} - - ) + return relativeTime(item.extra.date) } if (item?.extra?.icon) { return ( - - - + ) } } @@ -180,11 +174,13 @@ function NewsList({ query }: Query) { {items.slice(0, 20).map((item, i) => (
- - + + {item.title} - + + +
))}