From 1e3e05e7edc64a6e46e4322078a3f2cc095499b4 Mon Sep 17 00:00:00 2001 From: Pouria Delfanazari Date: Wed, 27 Nov 2024 18:29:58 -0800 Subject: [PATCH 1/2] Clean up JSX --- .../contentDisplay/feedHeader/FeedHeader.tsx | 129 ++++++++---------- .../contentDisplay/listHeader/ListHeader.tsx | 71 +++++----- 2 files changed, 92 insertions(+), 108 deletions(-) diff --git a/src/components/contentDisplay/feedHeader/FeedHeader.tsx b/src/components/contentDisplay/feedHeader/FeedHeader.tsx index 2b1ac13b..85a8466f 100644 --- a/src/components/contentDisplay/feedHeader/FeedHeader.tsx +++ b/src/components/contentDisplay/feedHeader/FeedHeader.tsx @@ -106,78 +106,67 @@ export default function FeedHeader(props: Props) { } }; + if (isFetchingFeedInfo || !feedInfo) return ; + return ( - <> - {isFetchingFeedInfo && } - {!isFetchingFeedInfo && feedInfo && ( - <> -
-
-
- {feedInfo.view.displayName} -
-

- {feedInfo.view.displayName} -

-

- By{" "} - - @{feedInfo.view.creator.handle} - -

-
-
- {isSaved !== null && isPinned !== null && ( -
- - - -
+
+
+
+ {feedInfo.view.displayName} +
+

+ {feedInfo.view.displayName} +

+

+ By{" "} + + @{feedInfo.view.creator.handle} + +

+
+
+ {isSaved !== null && isPinned !== null && ( +
+ + +
- {feedInfo.view.description && ( -

- {feedInfo.view.description} -

- )} - - - {feedInfo.view.likeCount} - -
- + {!likeUri && } + +
+ )} + + {feedInfo.view.description && ( +

+ {feedInfo.view.description} +

)} - + + + {feedInfo.view.likeCount} + +
); } diff --git a/src/components/contentDisplay/listHeader/ListHeader.tsx b/src/components/contentDisplay/listHeader/ListHeader.tsx index 903adae7..893b9827 100644 --- a/src/components/contentDisplay/listHeader/ListHeader.tsx +++ b/src/components/contentDisplay/listHeader/ListHeader.tsx @@ -20,45 +20,40 @@ export default function FeedHeader(props: Props) { listInfoError, } = useListInfo(list); + if (isFetchingListInfo || !listInfo) return ; + return ( - <> - {isFetchingListInfo && } - {!isFetchingListInfo && listInfo && ( - <> -
-
-
- {listInfo.list.name} -
-

- {listInfo.list.name} -

-

- By{" "} - - @{listInfo.list.creator.handle} - -

-
-
-
- {listInfo.list.description && ( -

- {listInfo.list.description} -

- )} -
- +
+
+
+ {listInfo.list.name} +
+

+ {listInfo.list.name} +

+

+ By{" "} + + @{listInfo.list.creator.handle} + +

+
+
+
+ {listInfo.list.description && ( +

+ {listInfo.list.description} +

)} - +
); } From e378f23f0d78d03aa5f06afdbfc978b5fbc1931c Mon Sep 17 00:00:00 2001 From: Pouria Delfanazari Date: Wed, 27 Nov 2024 18:36:51 -0800 Subject: [PATCH 2/2] Expand atmosphere button toggles to full width --- src/containers/atmosphere/AtmosphereContainer.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/containers/atmosphere/AtmosphereContainer.tsx b/src/containers/atmosphere/AtmosphereContainer.tsx index 09b0cae3..59f5fd90 100644 --- a/src/containers/atmosphere/AtmosphereContainer.tsx +++ b/src/containers/atmosphere/AtmosphereContainer.tsx @@ -39,13 +39,13 @@ export default function AtmosphereContainer(props: Props) { const frontpageRecords = await getATRecords( did, "fyi.unravel.frontpage.post", - agent + agent, ); const linkatRecords = await getATRecords(did, "blue.linkat.board", agent); const whtwndRecords = await getATRecords( did, "com.whtwnd.blog.entry", - agent + agent, ); return [ @@ -87,7 +87,7 @@ export default function AtmosphereContainer(props: Props) { } return acc; }, - {} as Record + {} as Record, ); const renderContainer = () => { @@ -123,10 +123,10 @@ export default function AtmosphereContainer(props: Props) { return (
-
+
{hasCollection && ( -
+
{collections.map((c) => ( <> {c.records.length !== 0 && (