show separate alert if you're on your own profile

This commit is contained in:
vineyardbovines
2026-03-05 08:58:26 -05:00
parent 39c3d0647e
commit 4f6f710e95
4 changed files with 39 additions and 6 deletions
+33 -2
View File
@@ -8,24 +8,29 @@ import {Button, ButtonText} from '#/components/Button'
import * as Dialog from '#/components/Dialog'
import {Robot_Filled_Corner2_Rounded as RobotIcon} from '#/components/icons/Robot'
import {Text} from '#/components/Typography'
import {navigate} from '#/Navigation'
export function BotAccountInfoDialog({
control,
isMe,
}: {
control: Dialog.DialogControlProps
isMe?: boolean
}) {
return (
<Dialog.Outer control={control}>
<Dialog.Handle />
<BotAccountInfoDialogInner control={control} />
<BotAccountInfoDialogInner control={control} isMe={isMe} />
</Dialog.Outer>
)
}
function BotAccountInfoDialogInner({
control,
isMe,
}: {
control: Dialog.DialogControlProps
isMe?: boolean
}) {
const {_} = useLingui()
const t = useTheme()
@@ -37,7 +42,16 @@ function BotAccountInfoDialogInner({
<RobotIcon width={48} fill={t.atoms.text_contrast_medium.color} />
</View>
<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>
<Button
label={_(msg`Okay`)}
@@ -49,6 +63,23 @@ function BotAccountInfoDialogInner({
<Trans>Okay</Trans>
</ButtonText>
</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>
<Dialog.Close />
</Dialog.ScrollableInner>
+4 -2
View File
@@ -3,13 +3,13 @@ import {type ComAtprotoLabelDefs} from '@atproto/api'
import {msg} from '@lingui/core/macro'
import {useLingui} from '@lingui/react'
import {useAnalytics} from '#/analytics'
import {isBotAccount} from '#/lib/bots'
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
import {BotAccountInfoDialog} from '#/components/BotAccountInfoDialog'
import {Button} from '#/components/Button'
import {useDialogControl} from '#/components/Dialog'
import {Robot_Filled_Corner2_Rounded as RobotIcon} from '#/components/icons/Robot'
import {useAnalytics} from '#/analytics'
export function BotBadge({
profile,
@@ -36,9 +36,11 @@ export function BotBadge({
export function BotBadgeButton({
profile,
size,
isMe,
}: {
profile: {did: string; labels?: ComAtprotoLabelDefs.Label[]}
size: 'lg' | 'md' | 'sm'
isMe?: boolean
}) {
const t = useTheme()
const ax = useAnalytics()
@@ -86,7 +88,7 @@ export function BotBadgeButton({
</View>
)}
</Button>
<BotAccountInfoDialog control={control} />
<BotAccountInfoDialog control={control} isMe={isMe} />
</>
)
}
@@ -147,7 +147,7 @@ let ProfileHeaderStandard = ({
<VerificationCheckButton profile={profile} size="lg" />
</View>
<View style={[a.pl_xs, {marginTop: platform({ios: 2})}]}>
<BotBadgeButton profile={profile} size="lg" />
<BotBadgeButton profile={profile} size="lg" isMe={isMe} />
</View>
</Text>
</View>
+1 -1
View File
@@ -381,7 +381,7 @@ function ProfilePreview({
marginTop: platform({web: 8, ios: 8, android: 10}),
},
]}>
<BotBadgeButton profile={shadow} size="lg" />
<BotBadgeButton profile={shadow} size="lg" isMe />
</View>
</View>
<Text style={[a.text_md, a.leading_snug, t.atoms.text_contrast_medium]}>