Use admonitions in settings screens (#5741)
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {View} from 'react-native'
|
import {StyleProp, View, ViewStyle} from 'react-native'
|
||||||
|
|
||||||
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
|
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
|
||||||
import {CircleInfo_Stroke2_Corner0_Rounded as ErrorIcon} from '#/components/icons/CircleInfo'
|
import {CircleInfo_Stroke2_Corner0_Rounded as ErrorIcon} from '#/components/icons/CircleInfo'
|
||||||
@@ -70,9 +70,11 @@ export function Row({children}: {children: React.ReactNode}) {
|
|||||||
export function Outer({
|
export function Outer({
|
||||||
children,
|
children,
|
||||||
type = 'info',
|
type = 'info',
|
||||||
|
style,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
type?: Context['type']
|
type?: Context['type']
|
||||||
|
style?: StyleProp<ViewStyle>
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {gtMobile} = useBreakpoints()
|
const {gtMobile} = useBreakpoints()
|
||||||
@@ -90,9 +92,8 @@ export function Outer({
|
|||||||
a.rounded_sm,
|
a.rounded_sm,
|
||||||
a.border,
|
a.border,
|
||||||
t.atoms.bg_contrast_25,
|
t.atoms.bg_contrast_25,
|
||||||
{
|
{borderColor},
|
||||||
borderColor,
|
style,
|
||||||
},
|
|
||||||
]}>
|
]}>
|
||||||
{children}
|
{children}
|
||||||
</View>
|
</View>
|
||||||
@@ -103,12 +104,14 @@ export function Outer({
|
|||||||
export function Admonition({
|
export function Admonition({
|
||||||
children,
|
children,
|
||||||
type,
|
type,
|
||||||
|
style,
|
||||||
}: {
|
}: {
|
||||||
children: TextProps['children']
|
children: TextProps['children']
|
||||||
type?: Context['type']
|
type?: Context['type']
|
||||||
|
style?: StyleProp<ViewStyle>
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<Outer type={type}>
|
<Outer type={type} style={style}>
|
||||||
<Row>
|
<Row>
|
||||||
<Icon />
|
<Icon />
|
||||||
<Text>{children}</Text>
|
<Text>{children}</Text>
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ 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 {ScrollView} from '#/view/com/util/Views'
|
import {ScrollView} from '#/view/com/util/Views'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a} from '#/alf'
|
||||||
|
import {Admonition} from '#/components/Admonition'
|
||||||
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,7 +24,6 @@ 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,
|
||||||
@@ -99,21 +99,12 @@ export function MessagesSettingsScreen({}: Props) {
|
|||||||
</Toggle.Item>
|
</Toggle.Item>
|
||||||
</View>
|
</View>
|
||||||
</Toggle.Group>
|
</Toggle.Group>
|
||||||
<View
|
<Admonition type="tip">
|
||||||
style={[
|
<Trans>
|
||||||
a.mt_sm,
|
You can continue ongoing conversations regardless of which setting
|
||||||
a.px_xl,
|
you choose.
|
||||||
a.py_lg,
|
</Trans>
|
||||||
a.rounded_md,
|
</Admonition>
|
||||||
t.atoms.bg_contrast_25,
|
|
||||||
]}>
|
|
||||||
<Text style={[t.atoms.text_contrast_high, a.leading_snug]}>
|
|
||||||
<Trans>
|
|
||||||
You can continue ongoing conversations regardless of which setting
|
|
||||||
you choose.
|
|
||||||
</Trans>
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
{isNative && (
|
{isNative && (
|
||||||
<>
|
<>
|
||||||
<Divider style={a.my_md} />
|
<Divider style={a.my_md} />
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {useNotificationsSettingsMutation} from '#/state/queries/notifications/se
|
|||||||
import {ViewHeader} from '#/view/com/util/ViewHeader'
|
import {ViewHeader} from '#/view/com/util/ViewHeader'
|
||||||
import {ScrollView} from '#/view/com/util/Views'
|
import {ScrollView} from '#/view/com/util/Views'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
|
import {Admonition} from '#/components/Admonition'
|
||||||
import {Error} from '#/components/Error'
|
import {Error} from '#/components/Error'
|
||||||
import * as Toggle from '#/components/forms/Toggle'
|
import * as Toggle from '#/components/forms/Toggle'
|
||||||
import {Loader} from '#/components/Loader'
|
import {Loader} from '#/components/Loader'
|
||||||
@@ -71,22 +72,13 @@ export function NotificationsSettingsScreen({}: Props) {
|
|||||||
</Toggle.Item>
|
</Toggle.Item>
|
||||||
</View>
|
</View>
|
||||||
</Toggle.Group>
|
</Toggle.Group>
|
||||||
<View
|
<Admonition type="warning" style={[a.mt_sm]}>
|
||||||
style={[
|
<Trans>
|
||||||
a.mt_sm,
|
Experimental: When this preference is enabled, you'll only receive
|
||||||
a.px_xl,
|
reply and quote notifications from users you follow. We'll
|
||||||
a.py_lg,
|
continue to add more controls here over time.
|
||||||
a.rounded_md,
|
</Trans>
|
||||||
t.atoms.bg_contrast_25,
|
</Admonition>
|
||||||
]}>
|
|
||||||
<Text style={[t.atoms.text_contrast_high, a.leading_snug]}>
|
|
||||||
<Trans>
|
|
||||||
Experimental: When this preference is enabled, you'll only
|
|
||||||
receive reply and quote notifications from users you follow.
|
|
||||||
We'll continue to add more controls here over time.
|
|
||||||
</Trans>
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|||||||
Reference in New Issue
Block a user