From a08ae8505efeefaa5ddd5efd70990afda4a59bbe Mon Sep 17 00:00:00 2001 From: alecdwm Date: Mon, 23 Dec 2024 03:47:31 +0000 Subject: [PATCH] feat: add back button --- .../AccountAddDerivedForm.tsx | 4 +- .../AccountAddJson/ImportJsonAccountsForm.tsx | 32 +++--- .../AccountAddJson/UnlockJsonFileForm.tsx | 4 +- .../AccountAddMnemonic/MnemonicForm.tsx | 103 ++++++++++-------- .../AccountAdd/AccountAddPrivateKeyForm.tsx | 4 +- .../AccountAdd/AccountAddWatchedForm.tsx | 5 +- .../AccountAdd/BackToAddAccountButton.tsx | 16 +++ 7 files changed, 103 insertions(+), 65 deletions(-) create mode 100644 apps/extension/src/ui/domains/Account/AccountAdd/BackToAddAccountButton.tsx diff --git a/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddDerived/AccountAddDerivedForm.tsx b/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddDerived/AccountAddDerivedForm.tsx index df30117ac7..5344c71004 100644 --- a/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddDerived/AccountAddDerivedForm.tsx +++ b/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddDerived/AccountAddDerivedForm.tsx @@ -37,6 +37,7 @@ import { AccountIcon } from "@ui/domains/Account/AccountIcon" import { AccountTypeSelector } from "@ui/domains/Account/AccountTypeSelector" import { useAccounts, useMnemonics } from "@ui/state" +import { BackToAddAccountButton } from "../BackToAddAccountButton" import { AccountAddPageProps } from "../types" import { AccountAddMnemonicDropdown } from "./AccountAddMnemonicDropdown" @@ -311,7 +312,8 @@ const AccountAddDerivedFormInner: FC = ({ onSuccess }) => { -
+
+
-
- - +
+ +
+ + +
) diff --git a/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddJson/UnlockJsonFileForm.tsx b/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddJson/UnlockJsonFileForm.tsx index aff98da654..7c8a8304b0 100644 --- a/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddJson/UnlockJsonFileForm.tsx +++ b/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddJson/UnlockJsonFileForm.tsx @@ -10,6 +10,7 @@ import { log } from "@extension/shared" import { CapsLockWarningIcon } from "@talisman/components/CapsLockWarningIcon" import { FadeIn } from "@talisman/components/FadeIn" +import { BackToAddAccountButton } from "../BackToAddAccountButton" import { useJsonAccountImport } from "./context" type FormData = { @@ -86,7 +87,8 @@ export const UnlockJsonFileForm: FC = () => { after={} /> -
+
+ diff --git a/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddMnemonic/MnemonicForm.tsx b/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddMnemonic/MnemonicForm.tsx index ae4eaec2f1..9c3305d4d9 100644 --- a/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddMnemonic/MnemonicForm.tsx +++ b/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddMnemonic/MnemonicForm.tsx @@ -4,7 +4,7 @@ import { classNames, encodeAnyAddress } from "@talismn/util" import { useCallback, useEffect, useMemo, useState } from "react" import { useForm } from "react-hook-form" import { useTranslation } from "react-i18next" -import { useNavigate } from "react-router-dom" +import { NavLink, useNavigate } from "react-router-dom" import { Button, FormFieldContainer, @@ -222,56 +222,63 @@ export const AccountAddMnemonicForm = () => { -
- - +
+ + + + + + {targetAddress} + + ) : null + } + /> + + - - - - {targetAddress} - - ) : null - } - /> - - -
-
{t("Word count: {{words}}", { words })}
-
{errors.mnemonic?.message}
-
- - - - - - -
+
+
{t("Word count: {{words}}", { words })}
+
+ {errors.mnemonic?.message} +
+
+ + + + + + +
+
+ + +
-
+
+
-
+
+ + + ) +}