From b0a53b7fa1e734481cffe0368c4bc5ef64932140 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 16 May 2024 21:11:51 +0800 Subject: [PATCH] Handle hideCollections --- src/components/account-info.jsx | 7 +++++++ src/components/generic-accounts.jsx | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index 49cb427..c585c45 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -186,6 +186,7 @@ function AccountInfo({ memorial, moved, roles, + hideCollections, } = info || {}; let headerIsAvatar = false; let { header, headerStatic } = info || {}; @@ -677,6 +678,9 @@ function AccountInfo({ excludeRelationshipAttrs: isSelf ? ['followedBy'] : [], + blankCopy: hideCollections + ? 'This user has chosen to not make this information available.' + : undefined, }; }, 0); }} @@ -712,6 +716,9 @@ function AccountInfo({ fetchAccounts: fetchFollowing, instance, excludeRelationshipAttrs: isSelf ? ['following'] : [], + blankCopy: hideCollections + ? 'This user has chosen to not make this information available.' + : undefined, }; }, 0); }} diff --git a/src/components/generic-accounts.jsx b/src/components/generic-accounts.jsx index 478ee40..f400c4a 100644 --- a/src/components/generic-accounts.jsx +++ b/src/components/generic-accounts.jsx @@ -20,6 +20,7 @@ export default function GenericAccounts({ excludeRelationshipAttrs = [], postID, onClose = () => {}, + blankCopy = 'Nothing to show', }) { const { masto, instance: currentInstance } = api(); const isCurrentInstance = instance ? instance === currentInstance : true; @@ -221,7 +222,7 @@ export default function GenericAccounts({ ) : uiState === 'error' ? (

Error loading accounts

) : ( -

Nothing to show

+

{blankCopy}

)}