diff --git a/src/components/BotAccountInfoDialog.tsx b/src/components/BotAccountInfoDialog.tsx index 36dde27e38..88db5574a1 100644 --- a/src/components/BotAccountInfoDialog.tsx +++ b/src/components/BotAccountInfoDialog.tsx @@ -1,12 +1,13 @@ -import {Modal, Pressable, View} from 'react-native' +import {View} from 'react-native' import {msg} from '@lingui/core/macro' import {useLingui} from '@lingui/react' import {Trans} from '@lingui/react/macro' -import {atoms as a, useTheme, web} from '#/alf' +import {atoms as a, useTheme} from '#/alf' import {Button, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' 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' @@ -24,88 +25,6 @@ export function BotAccountInfoDialog({ } export function BotAccountOwnAlert({ - visible, - onClose, -}: { - visible: boolean - onClose: (cb?: () => void) => void -}) { - const {_} = useLingui() - const t = useTheme() - - return ( - onClose()} - accessibilityLabel={_(msg`Automated account`)} - accessibilityViewIsModal> - onClose()} - style={[ - a.flex_1, - a.justify_center, - a.align_center, - a.px_xl, - {backgroundColor: 'rgba(0,0,0,0.5)'}, - ]}> - e.stopPropagation()} - style={[ - t.atoms.bg, - a.w_full, - {borderRadius: 48}, - a.p_2xl, - {maxWidth: 280}, - ]}> - - - - - - - - You have marked this account as automated. You can remove it at - any time from your account settings. - - - - - - - - - - ) -} - -export function BotAccountOwnAlertWeb({ control, }: { control: Dialog.DialogControlProps @@ -114,49 +33,35 @@ export function BotAccountOwnAlertWeb({ const t = useTheme() return ( - - - - - - - - - You have marked this account as automated. You can remove it at - any time from your account settings. - - - - + + + + - - - + + + You have marked this account as automated. You can remove it at any + time from your account settings. + + + + + {}} color="primary" /> + + + ) } diff --git a/src/components/BotBadge.tsx b/src/components/BotBadge.tsx index 0b9e3b4b2a..552ab149c3 100644 --- a/src/components/BotBadge.tsx +++ b/src/components/BotBadge.tsx @@ -1,21 +1,18 @@ -import {useState} from 'react' import {View} from 'react-native' import {type ComAtprotoLabelDefs} from '@atproto/api' import {msg} from '@lingui/core/macro' import {useLingui} from '@lingui/react' -import {useAnalytics} from '#/analytics' -import {IS_NATIVE} from '#/env' import {isBotAccount} from '#/lib/bots' import {atoms as a, useBreakpoints, useTheme} from '#/alf' import { BotAccountInfoDialog, BotAccountOwnAlert, - BotAccountOwnAlertWeb, } 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, @@ -53,7 +50,6 @@ export function BotBadgeButton({ const {_} = useLingui() const {gtPhone} = useBreakpoints() const control = useDialogControl() - const [alertVisible, setAlertVisible] = useState(false) if (!isBotAccount(profile)) { return null @@ -66,8 +62,6 @@ export function BotBadgeButton({ dimensions = 14 } - const useNativeAlert = isMe && IS_NATIVE - return ( <> - {useNativeAlert ? ( - { - setAlertVisible(false) - cb?.() - }} - /> - ) : isMe ? ( - + {isMe ? ( + ) : ( )}