From f1bde962ccee3bb0536a274e22fb0bf98c7e3305 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Thu, 29 Jun 2023 19:37:52 -0700 Subject: [PATCH] feat(admin): auto-expand news item if there is only one --- web/components/admin/NewsFeed.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/components/admin/NewsFeed.tsx b/web/components/admin/NewsFeed.tsx index 2d3114b9e..02202b44f 100644 --- a/web/components/admin/NewsFeed.tsx +++ b/web/components/admin/NewsFeed.tsx @@ -17,6 +17,7 @@ export type ArticleProps = { url: string; content_html: string; date_published: string; + defaultOpen?: boolean; }; const ArticleItem: FC = ({ @@ -24,12 +25,13 @@ const ArticleItem: FC = ({ url, content_html: content, date_published: date, + defaultOpen = false, }) => { const dateObject = new Date(date); const dateString = format(dateObject, 'MMM dd, yyyy, HH:mm'); return (
- +

{dateString} ( @@ -74,7 +76,7 @@ export const NewsFeed = () => { News & Updates from Owncast {loadingSpinner} {feed.map(item => ( - + ))} {noNews}