Use Prompt.Action for delete account buttons (#9889)
This commit is contained in:
@@ -10,7 +10,6 @@ import {logger} from '#/logger'
|
|||||||
import {useAgent, useSession, useSessionApi} from '#/state/session'
|
import {useAgent, useSession, useSessionApi} from '#/state/session'
|
||||||
import {atoms as a, useTheme, web} from '#/alf'
|
import {atoms as a, useTheme, web} from '#/alf'
|
||||||
import {Admonition} from '#/components/Admonition'
|
import {Admonition} from '#/components/Admonition'
|
||||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
|
||||||
import {type DialogOuterProps} from '#/components/Dialog'
|
import {type DialogOuterProps} from '#/components/Dialog'
|
||||||
import {
|
import {
|
||||||
isValidCode,
|
isValidCode,
|
||||||
@@ -197,16 +196,12 @@ function DeleteAccountDialogInner({
|
|||||||
</Prompt.DescriptionText>
|
</Prompt.DescriptionText>
|
||||||
</Prompt.Content>
|
</Prompt.Content>
|
||||||
<Prompt.Actions>
|
<Prompt.Actions>
|
||||||
<Button
|
<Prompt.Action
|
||||||
color="primary"
|
icon={emailState === EmailState.PENDING ? Loader : Envelope}
|
||||||
label={_(msg`Send email`)}
|
cta={_(msg`Send email`)}
|
||||||
size="large"
|
shouldCloseOnPress={false}
|
||||||
onPress={handleSendEmail}>
|
onPress={handleSendEmail}
|
||||||
<ButtonText>{_(msg`Send email`)}</ButtonText>
|
/>
|
||||||
<ButtonIcon
|
|
||||||
icon={emailState === EmailState.PENDING ? Loader : Envelope}
|
|
||||||
/>
|
|
||||||
</Button>
|
|
||||||
<Prompt.Cancel />
|
<Prompt.Cancel />
|
||||||
</Prompt.Actions>
|
</Prompt.Actions>
|
||||||
{error && (
|
{error && (
|
||||||
@@ -314,14 +309,13 @@ function DeleteAccountDialogInner({
|
|||||||
</TextField.Root>
|
</TextField.Root>
|
||||||
</View>
|
</View>
|
||||||
<Prompt.Actions>
|
<Prompt.Actions>
|
||||||
<Button
|
<Prompt.Action
|
||||||
color="negative"
|
color="negative"
|
||||||
disabled={!isValidCode(confirmCode) || !isPasswordValid(password)}
|
disabled={!isValidCode(confirmCode) || !isPasswordValid(password)}
|
||||||
size="large"
|
cta={_(msg`Delete my account`)}
|
||||||
label={_(msg`Delete My Account`)}
|
shouldCloseOnPress={false}
|
||||||
onPress={handleDeleteAccount}>
|
onPress={handleDeleteAccount}
|
||||||
<ButtonText>{_(msg`Delete My Account`)}</ButtonText>
|
/>
|
||||||
</Button>
|
|
||||||
<Prompt.Cancel />
|
<Prompt.Cancel />
|
||||||
</Prompt.Actions>
|
</Prompt.Actions>
|
||||||
{error && (
|
{error && (
|
||||||
@@ -340,7 +334,7 @@ function DeleteAccountDialogInner({
|
|||||||
</Prompt.TitleText>
|
</Prompt.TitleText>
|
||||||
<Prompt.DescriptionText>
|
<Prompt.DescriptionText>
|
||||||
<Trans>
|
<Trans>
|
||||||
This will irreversably delete your Bluesky account{' '}
|
This will irreversibly delete your Bluesky account{' '}
|
||||||
<Span style={[a.font_semi_bold, t.atoms.text]}>
|
<Span style={[a.font_semi_bold, t.atoms.text]}>
|
||||||
{currentHandle}
|
{currentHandle}
|
||||||
</Span>{' '}
|
</Span>{' '}
|
||||||
@@ -356,13 +350,12 @@ function DeleteAccountDialogInner({
|
|||||||
</Prompt.DescriptionText>
|
</Prompt.DescriptionText>
|
||||||
</Prompt.Content>
|
</Prompt.Content>
|
||||||
<Prompt.Actions>
|
<Prompt.Actions>
|
||||||
<Button
|
<Prompt.Action
|
||||||
color="negative"
|
color="negative"
|
||||||
size="large"
|
cta={_(msg`Yes, delete my account`)}
|
||||||
label={_(msg`Yes, delete my account`)}
|
shouldCloseOnPress={false}
|
||||||
onPress={handleConfirmDeletion}>
|
onPress={handleConfirmDeletion}
|
||||||
<ButtonText>{_(msg`Yes, delete my account`)}</ButtonText>
|
/>
|
||||||
</Button>
|
|
||||||
<Prompt.Cancel />
|
<Prompt.Cancel />
|
||||||
</Prompt.Actions>
|
</Prompt.Actions>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user