show separate alert if you're on your own profile
This commit is contained in:
@@ -8,24 +8,29 @@ import {Button, ButtonText} from '#/components/Button'
|
|||||||
import * 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 {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
|
import {navigate} from '#/Navigation'
|
||||||
|
|
||||||
export function BotAccountInfoDialog({
|
export function BotAccountInfoDialog({
|
||||||
control,
|
control,
|
||||||
|
isMe,
|
||||||
}: {
|
}: {
|
||||||
control: Dialog.DialogControlProps
|
control: Dialog.DialogControlProps
|
||||||
|
isMe?: boolean
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
<Dialog.Handle />
|
||||||
<BotAccountInfoDialogInner control={control} />
|
<BotAccountInfoDialogInner control={control} isMe={isMe} />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function BotAccountInfoDialogInner({
|
function BotAccountInfoDialogInner({
|
||||||
control,
|
control,
|
||||||
|
isMe,
|
||||||
}: {
|
}: {
|
||||||
control: Dialog.DialogControlProps
|
control: Dialog.DialogControlProps
|
||||||
|
isMe?: boolean
|
||||||
}) {
|
}) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
@@ -37,7 +42,16 @@ function BotAccountInfoDialogInner({
|
|||||||
<RobotIcon width={48} fill={t.atoms.text_contrast_medium.color} />
|
<RobotIcon width={48} fill={t.atoms.text_contrast_medium.color} />
|
||||||
</View>
|
</View>
|
||||||
<Text style={[a.text_lg, a.text_center, a.font_semi_bold]}>
|
<Text style={[a.text_lg, a.text_center, a.font_semi_bold]}>
|
||||||
<Trans>This account has been marked as automated by its owner</Trans>
|
{isMe ? (
|
||||||
|
<Trans>
|
||||||
|
You have marked this account as automated. You can remove it at
|
||||||
|
any time from your account settings.
|
||||||
|
</Trans>
|
||||||
|
) : (
|
||||||
|
<Trans>
|
||||||
|
This account has been marked as automated by its owner
|
||||||
|
</Trans>
|
||||||
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Okay`)}
|
label={_(msg`Okay`)}
|
||||||
@@ -49,6 +63,23 @@ function BotAccountInfoDialogInner({
|
|||||||
<Trans>Okay</Trans>
|
<Trans>Okay</Trans>
|
||||||
</ButtonText>
|
</ButtonText>
|
||||||
</Button>
|
</Button>
|
||||||
|
{isMe && (
|
||||||
|
<Button
|
||||||
|
label={_(msg`Open settings`)}
|
||||||
|
onPress={() => {
|
||||||
|
control.close(() => {
|
||||||
|
navigate('AutomationLabelSettings')
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
color="secondary"
|
||||||
|
size="large"
|
||||||
|
variant="ghost"
|
||||||
|
style={[a.w_full]}>
|
||||||
|
<ButtonText>
|
||||||
|
<Trans>Open settings</Trans>
|
||||||
|
</ButtonText>
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
<Dialog.Close />
|
<Dialog.Close />
|
||||||
</Dialog.ScrollableInner>
|
</Dialog.ScrollableInner>
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ import {type ComAtprotoLabelDefs} from '@atproto/api'
|
|||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
import {useAnalytics} from '#/analytics'
|
|
||||||
import {isBotAccount} from '#/lib/bots'
|
import {isBotAccount} from '#/lib/bots'
|
||||||
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
|
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
|
||||||
import {BotAccountInfoDialog} from '#/components/BotAccountInfoDialog'
|
import {BotAccountInfoDialog} from '#/components/BotAccountInfoDialog'
|
||||||
import {Button} from '#/components/Button'
|
import {Button} from '#/components/Button'
|
||||||
import {useDialogControl} from '#/components/Dialog'
|
import {useDialogControl} 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 {useAnalytics} from '#/analytics'
|
||||||
|
|
||||||
export function BotBadge({
|
export function BotBadge({
|
||||||
profile,
|
profile,
|
||||||
@@ -36,9 +36,11 @@ export function BotBadge({
|
|||||||
export function BotBadgeButton({
|
export function BotBadgeButton({
|
||||||
profile,
|
profile,
|
||||||
size,
|
size,
|
||||||
|
isMe,
|
||||||
}: {
|
}: {
|
||||||
profile: {did: string; labels?: ComAtprotoLabelDefs.Label[]}
|
profile: {did: string; labels?: ComAtprotoLabelDefs.Label[]}
|
||||||
size: 'lg' | 'md' | 'sm'
|
size: 'lg' | 'md' | 'sm'
|
||||||
|
isMe?: boolean
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
@@ -86,7 +88,7 @@ export function BotBadgeButton({
|
|||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
<BotAccountInfoDialog control={control} />
|
<BotAccountInfoDialog control={control} isMe={isMe} />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ let ProfileHeaderStandard = ({
|
|||||||
<VerificationCheckButton profile={profile} size="lg" />
|
<VerificationCheckButton profile={profile} size="lg" />
|
||||||
</View>
|
</View>
|
||||||
<View style={[a.pl_xs, {marginTop: platform({ios: 2})}]}>
|
<View style={[a.pl_xs, {marginTop: platform({ios: 2})}]}>
|
||||||
<BotBadgeButton profile={profile} size="lg" />
|
<BotBadgeButton profile={profile} size="lg" isMe={isMe} />
|
||||||
</View>
|
</View>
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ function ProfilePreview({
|
|||||||
marginTop: platform({web: 8, ios: 8, android: 10}),
|
marginTop: platform({web: 8, ios: 8, android: 10}),
|
||||||
},
|
},
|
||||||
]}>
|
]}>
|
||||||
<BotBadgeButton profile={shadow} size="lg" />
|
<BotBadgeButton profile={shadow} size="lg" isMe />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<Text style={[a.text_md, a.leading_snug, t.atoms.text_contrast_medium]}>
|
<Text style={[a.text_md, a.leading_snug, t.atoms.text_contrast_medium]}>
|
||||||
|
|||||||
Reference in New Issue
Block a user