From 4fc0b566ef7b64424a0795f5a2a7a463888e0b70 Mon Sep 17 00:00:00 2001 From: Hailey Date: Fri, 1 Mar 2024 17:15:20 -0800 Subject: [PATCH] dismiss keyboard on touch mute dialog (#3074) --- src/components/dialogs/MutedWords.tsx | 337 +++++++++++++------------- 1 file changed, 172 insertions(+), 165 deletions(-) diff --git a/src/components/dialogs/MutedWords.tsx b/src/components/dialogs/MutedWords.tsx index 453b1351..658ba2aa 100644 --- a/src/components/dialogs/MutedWords.tsx +++ b/src/components/dialogs/MutedWords.tsx @@ -1,5 +1,5 @@ import React from 'react' -import {View} from 'react-native' +import {Keyboard, View} from 'react-native' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {AppBskyActorDefs, sanitizeMutedWordValue} from '@atproto/api' @@ -81,175 +81,182 @@ function MutedWordsInner({}: {control: Dialog.DialogOuterProps['control']}) { return ( - - Add muted words and tags - - - - Posts can be muted based on their text, their tags, or both. - - - - - { - if (error) { - setError('') - } - setField(value) - }} - onSubmitEditing={submit} - /> - - - - - - - - - Mute in text & tags - - - - - - - - - - - - Mute in tags only - - - - - - - - - - - {error && ( - - - {error} - - - )} - + + style={[a.text_md, a.font_bold, a.pb_sm, t.atoms.text_contrast_high]}> + Add muted words and tags + + - We recommend avoiding common words that appear in many posts, since - it can result in no posts being shown. + Posts can be muted based on their text, their tags, or both. + + + { + if (error) { + setError('') + } + setField(value) + }} + onSubmitEditing={submit} + /> + + + + + + + + + Mute in text & tags + + + + + + + + + + + + Mute in tags only + + + + + + + + + + + {error && ( + + + {error} + + + )} + + + + We recommend avoiding common words that appear in many posts, + since it can result in no posts being shown. + + + + + + + + + Your muted words + + + {isPreferencesLoading ? ( + + ) : preferencesError || !preferences ? ( + + + + We're sorry, but we weren't able to load your muted words at + this time. Please try again. + + + + ) : preferences.mutedWords.length ? ( + [...preferences.mutedWords] + .reverse() + .map((word, i) => ( + + )) + ) : ( + + + You haven't muted any words or tags yet + + + )} + + + {isNative && } + + - - - - - - Your muted words - - - {isPreferencesLoading ? ( - - ) : preferencesError || !preferences ? ( - - - - We're sorry, but we weren't able to load your muted words at - this time. Please try again. - - - - ) : preferences.mutedWords.length ? ( - [...preferences.mutedWords] - .reverse() - .map((word, i) => ( - - )) - ) : ( - - - You haven't muted any words or tags yet - - - )} - - - {isNative && } - - ) }