dismiss keyboard on touch mute dialog (#3074)

zio/stable
Hailey 2024-03-01 17:15:20 -08:00 committed by GitHub
parent 2962862de2
commit 4fc0b566ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 172 additions and 165 deletions

View File

@ -1,5 +1,5 @@
import React from 'react' import React from 'react'
import {View} from 'react-native' import {Keyboard, View} from 'react-native'
import {msg, Trans} from '@lingui/macro' import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
import {AppBskyActorDefs, sanitizeMutedWordValue} from '@atproto/api' import {AppBskyActorDefs, sanitizeMutedWordValue} from '@atproto/api'
@ -81,6 +81,7 @@ function MutedWordsInner({}: {control: Dialog.DialogOuterProps['control']}) {
return ( return (
<Dialog.ScrollableInner label={_(msg`Manage your muted words and tags`)}> <Dialog.ScrollableInner label={_(msg`Manage your muted words and tags`)}>
<View onTouchStart={Keyboard.dismiss}>
<Text <Text
style={[a.text_md, a.font_bold, a.pb_sm, t.atoms.text_contrast_high]}> style={[a.text_md, a.font_bold, a.pb_sm, t.atoms.text_contrast_high]}>
<Trans>Add muted words and tags</Trans> <Trans>Add muted words and tags</Trans>
@ -201,8 +202,8 @@ function MutedWordsInner({}: {control: Dialog.DialogOuterProps['control']}) {
t.atoms.text_contrast_medium, t.atoms.text_contrast_medium,
]}> ]}>
<Trans> <Trans>
We recommend avoiding common words that appear in many posts, since We recommend avoiding common words that appear in many posts,
it can result in no posts being shown. since it can result in no posts being shown.
</Trans> </Trans>
</Text> </Text>
</View> </View>
@ -211,7 +212,12 @@ function MutedWordsInner({}: {control: Dialog.DialogOuterProps['control']}) {
<View style={[a.pt_2xl]}> <View style={[a.pt_2xl]}>
<Text <Text
style={[a.text_md, a.font_bold, a.pb_md, t.atoms.text_contrast_high]}> style={[
a.text_md,
a.font_bold,
a.pb_md,
t.atoms.text_contrast_high,
]}>
<Trans>Your muted words</Trans> <Trans>Your muted words</Trans>
</Text> </Text>
@ -250,6 +256,7 @@ function MutedWordsInner({}: {control: Dialog.DialogOuterProps['control']}) {
{isNative && <View style={{height: 20}} />} {isNative && <View style={{height: 20}} />}
<Dialog.Close /> <Dialog.Close />
</View>
</Dialog.ScrollableInner> </Dialog.ScrollableInner>
) )
} }