From b382a96d6a921a2e3d9a806ce43f4798a51af433 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 18 Feb 2024 13:34:52 -0600 Subject: [PATCH] NostrSigninModal: make use of Back button --- .../nostr-signin-modal/steps/account-step.tsx | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/features/ui/components/modals/nostr-signin-modal/steps/account-step.tsx b/src/features/ui/components/modals/nostr-signin-modal/steps/account-step.tsx index 320c21aef..a69f6b635 100644 --- a/src/features/ui/components/modals/nostr-signin-modal/steps/account-step.tsx +++ b/src/features/ui/components/modals/nostr-signin-modal/steps/account-step.tsx @@ -3,7 +3,7 @@ import React, { useMemo } from 'react'; import { FormattedMessage } from 'react-intl'; import { useAccount } from 'soapbox/api/hooks'; -import { Avatar, Text, Stack, Emoji, Button, Tooltip, HStack, Modal } from 'soapbox/components/ui'; +import { Avatar, Text, Stack, Emoji, Button, Tooltip, Modal } from 'soapbox/components/ui'; import { useInstance } from 'soapbox/hooks'; interface IAccountStep { @@ -21,14 +21,16 @@ const AccountStep: React.FC = ({ accountId, setStep, onClose }) => [account?.acct], ); - const goBack = () => setStep(1); - if (!account) { return null; } return ( - } onClose={onClose}> + } + onClose={onClose} + onBack={() => setStep(1)} + > @@ -51,10 +53,7 @@ const AccountStep: React.FC = ({ accountId, setStep, onClose }) => {account.ditto.is_registered ? ( - - - - + ) : ( @@ -65,10 +64,7 @@ const AccountStep: React.FC = ({ accountId, setStep, onClose }) => - - - - + )}