From 5c0a5128ac790c956e9f5d6724dd4231c7e1e385 Mon Sep 17 00:00:00 2001 From: Yifei Hu Date: Thu, 11 Jul 2024 11:06:58 +0800 Subject: [PATCH] fix the image of provider, read more button --- ui/components/ContextItem.tsx | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/ui/components/ContextItem.tsx b/ui/components/ContextItem.tsx index 87dfed4..03f25b1 100644 --- a/ui/components/ContextItem.tsx +++ b/ui/components/ContextItem.tsx @@ -7,7 +7,14 @@ interface ContextItemProperties { name: string; url: string; description: string; - provider: { name: string; image?: { thumbnail: { contentUrl: string } } }[]; + provider: { + name: string; + image?: { + thumbnail: { + contentUrl: string; + }; + }; + }[]; datePublished: string; image?: { contentUrl: string; @@ -32,11 +39,30 @@ const ContextItem: React.FC = ({ item }) => {
- + Read more -
- {item.provider[0].name} | {new Date(item.datePublished).toLocaleDateString()} +
+
+ {item.provider[0].image && ( + {`${item.provider[0].name} + )} + {item.provider[0].name} +
+
+ {new Date(item.datePublished).toLocaleDateString()} +
);