Add note to clarify "allow new messages from" setting (#4166)

zio/stable
Samuel Newman 2024-05-22 15:52:04 +01:00 committed by GitHub
parent 6522ee9bbf
commit 690926dd90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 20 additions and 4 deletions

View File

@ -12,7 +12,7 @@ import {useSession} from '#/state/session'
import * as Toast from '#/view/com/util/Toast' import * as Toast from '#/view/com/util/Toast'
import {ViewHeader} from '#/view/com/util/ViewHeader' import {ViewHeader} from '#/view/com/util/ViewHeader'
import {CenteredView} from '#/view/com/util/Views' import {CenteredView} from '#/view/com/util/Views'
import {atoms as a} from '#/alf' import {atoms as a, useTheme} from '#/alf'
import {Divider} from '#/components/Divider' import {Divider} from '#/components/Divider'
import * as Toggle from '#/components/forms/Toggle' import * as Toggle from '#/components/forms/Toggle'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
@ -23,6 +23,7 @@ type AllowIncoming = 'all' | 'none' | 'following'
type Props = NativeStackScreenProps<CommonNavigatorParams, 'MessagesSettings'> type Props = NativeStackScreenProps<CommonNavigatorParams, 'MessagesSettings'>
export function MessagesSettingsScreen({}: Props) { export function MessagesSettingsScreen({}: Props) {
const {_} = useLingui() const {_} = useLingui()
const t = useTheme()
const {currentAccount} = useSession() const {currentAccount} = useSession()
const {data: profile} = useProfileQuery({ const {data: profile} = useProfileQuery({
did: currentAccount!.did, did: currentAccount!.did,
@ -58,10 +59,10 @@ export function MessagesSettingsScreen({}: Props) {
<ViewHeader title={_(msg`Settings`)} showOnDesktop showBorder /> <ViewHeader title={_(msg`Settings`)} showOnDesktop showBorder />
<View style={[a.p_lg, a.gap_md]}> <View style={[a.p_lg, a.gap_md]}>
<Text style={[a.text_lg, a.font_bold]}> <Text style={[a.text_lg, a.font_bold]}>
<Trans>Allow messages from</Trans> <Trans>Allow new messages from</Trans>
</Text> </Text>
<Toggle.Group <Toggle.Group
label={_(msg`Allow messages from`)} label={_(msg`Allow new messages from`)}
type="radio" type="radio"
values={[ values={[
(profile?.associated?.chat?.allowIncoming as AllowIncoming) ?? (profile?.associated?.chat?.allowIncoming as AllowIncoming) ??
@ -98,9 +99,24 @@ export function MessagesSettingsScreen({}: Props) {
</Toggle.Item> </Toggle.Item>
</View> </View>
</Toggle.Group> </Toggle.Group>
<View
style={[
a.mt_sm,
a.px_xl,
a.py_lg,
a.rounded_md,
t.atoms.bg_contrast_25,
]}>
<Text style={[t.atoms.text_contrast_high]}>
<Trans>
You can continue ongoing conversations regardless of which setting
you choose.
</Trans>
</Text>
</View>
{isNative && ( {isNative && (
<> <>
<Divider /> <Divider style={a.my_md} />
<Text style={[a.text_lg, a.font_bold]}> <Text style={[a.text_lg, a.font_bold]}>
<Trans>Notification Sounds</Trans> <Trans>Notification Sounds</Trans>
</Text> </Text>