revert to dialog sheet for now
This commit is contained in:
@@ -5,9 +5,9 @@ import {Trans} from '@lingui/react/macro'
|
|||||||
|
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {Button, ButtonText} from '#/components/Button'
|
import {Button, ButtonText} from '#/components/Button'
|
||||||
import type * as Dialog from '#/components/Dialog'
|
import * as Dialog from '#/components/Dialog'
|
||||||
import {Robot_Filled_Corner2_Rounded as RobotIcon} from '#/components/icons/Robot'
|
import {Robot_Filled_Corner2_Rounded as RobotIcon} from '#/components/icons/Robot'
|
||||||
import * as Prompt from '#/components/Prompt'
|
import {Text} from '#/components/Typography'
|
||||||
import {navigate} from '#/Navigation'
|
import {navigate} from '#/Navigation'
|
||||||
|
|
||||||
export function BotAccountAlert({
|
export function BotAccountAlert({
|
||||||
@@ -25,33 +25,49 @@ export function BotAccountAlert({
|
|||||||
: 'This account has been marked as automated by its owner'
|
: 'This account has been marked as automated by its owner'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Prompt.Outer control={control} type="alert">
|
<Dialog.Outer control={control} nativeOptions={{preventExpansion: true}}>
|
||||||
<Prompt.Content>
|
<Dialog.ScrollableInner label={_(msg`Automated account`)}>
|
||||||
<View style={[a.align_center, a.pb_sm]}>
|
<View style={[a.align_center, a.pb_md, a.shadow_sm]}>
|
||||||
<RobotIcon width={48} fill={t.atoms.text_contrast_medium.color} />
|
<RobotIcon width={48} fill={t.atoms.text_contrast_medium.color} />
|
||||||
</View>
|
</View>
|
||||||
<Prompt.DescriptionText>
|
<Text
|
||||||
|
style={[
|
||||||
|
a.leading_snug,
|
||||||
|
a.text_center,
|
||||||
|
a.pb_xl,
|
||||||
|
t.atoms.text_contrast_high,
|
||||||
|
...(isOwn ? [a.text_md] : [a.text_lg]),
|
||||||
|
...(!isOwn ? [a.font_semi_bold] : []),
|
||||||
|
]}>
|
||||||
<Trans>{description}</Trans>
|
<Trans>{description}</Trans>
|
||||||
</Prompt.DescriptionText>
|
</Text>
|
||||||
</Prompt.Content>
|
<View style={[a.w_full, a.gap_sm]}>
|
||||||
<Prompt.Actions>
|
|
||||||
<Prompt.Action cta={_(msg`Okay`)} onPress={() => {}} color="primary" />
|
|
||||||
{isOwn ? (
|
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Open settings`)}
|
label={_(msg`Okay`)}
|
||||||
onPress={() => {
|
onPress={() => control.close()}
|
||||||
control.close(() => {
|
color="primary"
|
||||||
navigate('AutomationLabelSettings')
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
color="secondary"
|
|
||||||
size="large">
|
size="large">
|
||||||
<ButtonText>
|
<ButtonText>
|
||||||
<Trans>Open settings</Trans>
|
<Trans>Okay</Trans>
|
||||||
</ButtonText>
|
</ButtonText>
|
||||||
</Button>
|
</Button>
|
||||||
) : null}
|
{isOwn ? (
|
||||||
</Prompt.Actions>
|
<Button
|
||||||
</Prompt.Outer>
|
label={_(msg`Open settings`)}
|
||||||
|
onPress={() => {
|
||||||
|
control.close(() => {
|
||||||
|
navigate('AutomationLabelSettings')
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
color="secondary"
|
||||||
|
size="large">
|
||||||
|
<ButtonText>
|
||||||
|
<Trans>Open settings</Trans>
|
||||||
|
</ButtonText>
|
||||||
|
</Button>
|
||||||
|
) : null}
|
||||||
|
</View>
|
||||||
|
</Dialog.ScrollableInner>
|
||||||
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,7 +125,9 @@ function OuterAlert({
|
|||||||
a.overflow_hidden,
|
a.overflow_hidden,
|
||||||
]}>
|
]}>
|
||||||
<Context.Provider value={context}>
|
<Context.Provider value={context}>
|
||||||
<View testID={testID}>{children}</View>
|
<View testID={testID} style={[a.flex_1]}>
|
||||||
|
{children}
|
||||||
|
</View>
|
||||||
</Context.Provider>
|
</Context.Provider>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
|
|||||||
@@ -111,7 +111,6 @@ export function TitleText({
|
|||||||
style,
|
style,
|
||||||
}: React.PropsWithChildren<ViewStyleProp>) {
|
}: React.PropsWithChildren<ViewStyleProp>) {
|
||||||
const {titleId} = useContext(Context)
|
const {titleId} = useContext(Context)
|
||||||
const {type} = Dialog.useDialogContext()
|
|
||||||
return (
|
return (
|
||||||
<Text
|
<Text
|
||||||
nativeID={titleId}
|
nativeID={titleId}
|
||||||
@@ -121,7 +120,6 @@ export function TitleText({
|
|||||||
a.font_semi_bold,
|
a.font_semi_bold,
|
||||||
a.pb_xs,
|
a.pb_xs,
|
||||||
a.leading_snug,
|
a.leading_snug,
|
||||||
type === 'alert' && a.text_center,
|
|
||||||
style,
|
style,
|
||||||
]}>
|
]}>
|
||||||
{children}
|
{children}
|
||||||
@@ -135,18 +133,11 @@ export function DescriptionText({
|
|||||||
}: React.PropsWithChildren<{selectable?: boolean}>) {
|
}: React.PropsWithChildren<{selectable?: boolean}>) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {descriptionId} = useContext(Context)
|
const {descriptionId} = useContext(Context)
|
||||||
const {type} = Dialog.useDialogContext()
|
|
||||||
return (
|
return (
|
||||||
<Text
|
<Text
|
||||||
nativeID={descriptionId}
|
nativeID={descriptionId}
|
||||||
selectable={selectable}
|
selectable={selectable}
|
||||||
style={[
|
style={[a.text_md, a.leading_snug, t.atoms.text_contrast_high, a.pb_lg]}>
|
||||||
a.text_md,
|
|
||||||
a.leading_snug,
|
|
||||||
t.atoms.text_contrast_high,
|
|
||||||
a.pb_lg,
|
|
||||||
type === 'alert' && a.text_center,
|
|
||||||
]}>
|
|
||||||
{children}
|
{children}
|
||||||
</Text>
|
</Text>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user