From c70f33ebe24e938d7961cdc497a1866b47bb8028 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 9 Aug 2024 15:35:21 -0500 Subject: [PATCH] Hide reply settings if disabled --- .../dialogs/PostInteractionSettingsDialog.tsx | 93 ++++++++++--------- 1 file changed, 51 insertions(+), 42 deletions(-) diff --git a/src/components/dialogs/PostInteractionSettingsDialog.tsx b/src/components/dialogs/PostInteractionSettingsDialog.tsx index c362960043..162330e7d1 100644 --- a/src/components/dialogs/PostInteractionSettingsDialog.tsx +++ b/src/components/dialogs/PostInteractionSettingsDialog.tsx @@ -86,7 +86,10 @@ function DialogContent({ [postgate, onChangePostgate], ) - const doneLabel = _(msg`Save`) + const noOneCanReply = !!threadgateAllowUISettings.find( + v => v.type === 'nobody', + ) + return ( v.type === 'nobody') - } + isSelected={noOneCanReply} onPress={() => onChangeThreadgateAllowUISettings([{type: 'nobody'}]) } @@ -172,56 +173,64 @@ function DialogContent({ /> - - Or combine these options: - + {!noOneCanReply && ( + <> + + Or combine these options: + - - v.type === 'mention') - } - onPress={() => onPressAudience({type: 'mention'})} - /> - v.type === 'following') - } - onPress={() => onPressAudience({type: 'following'})} - /> - {lists && lists.length > 0 - ? lists.map(list => ( - v.type === 'list' && v.list === list.uri, - ) - } - onPress={() => - onPressAudience({type: 'list', list: list.uri}) - } - /> - )) - : // No loading states to avoid jumps for the common case (no lists) - null} - + + v.type === 'mention', + ) + } + onPress={() => onPressAudience({type: 'mention'})} + /> + v.type === 'following', + ) + } + onPress={() => onPressAudience({type: 'following'})} + /> + {lists && lists.length > 0 + ? lists.map(list => ( + v.type === 'list' && v.list === list.uri, + ) + } + onPress={() => + onPressAudience({type: 'list', list: list.uri}) + } + /> + )) + : // No loading states to avoid jumps for the common case (no lists) + null} + + + )}