From ceac117cc8ea868728799f08bf4309c81bd51ce0 Mon Sep 17 00:00:00 2001 From: jinoosss Date: Thu, 26 Sep 2024 10:43:17 +0900 Subject: [PATCH 1/4] feat: shows the account address without omitting any characters --- .../molecules/select-account-box/select-account-box-item.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/adena-extension/src/components/molecules/select-account-box/select-account-box-item.tsx b/packages/adena-extension/src/components/molecules/select-account-box/select-account-box-item.tsx index 9ee57dfc..12808bdb 100644 --- a/packages/adena-extension/src/components/molecules/select-account-box/select-account-box-item.tsx +++ b/packages/adena-extension/src/components/molecules/select-account-box/select-account-box-item.tsx @@ -1,4 +1,3 @@ -import { formatAddress } from '@common/utils/client-utils'; import { Row, WebCheckBox, WebText } from '@components/atoms'; import React from 'react'; import { useTheme } from 'styled-components'; @@ -15,7 +14,7 @@ const SelectAccountBoxItem: React.FC<{ return ( - {formatAddress(address)} + {address} {`m/44'/118'/0'/0/${hdPath}`} {stored ? ( From 37f7358ddbf105ddf6bc59a26fde8d829f21b6ff Mon Sep 17 00:00:00 2001 From: jinoosss Date: Thu, 26 Sep 2024 10:45:44 +0900 Subject: [PATCH 2/4] feat: when adding an account to an existing mnemonic, skip the prompts --- .../src/hooks/web/use-account-add-screen.ts | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/packages/adena-extension/src/hooks/web/use-account-add-screen.ts b/packages/adena-extension/src/hooks/web/use-account-add-screen.ts index 5572bf31..117e8a85 100644 --- a/packages/adena-extension/src/hooks/web/use-account-add-screen.ts +++ b/packages/adena-extension/src/hooks/web/use-account-add-screen.ts @@ -30,7 +30,7 @@ export type UseAccountAddScreenReturn = { export type AccountAddStateType = 'INIT' | 'SELECT_SEED_PHRASE' | 'CREATE_ACCOUNT'; const useAccountAddScreen = (): UseAccountAddScreenReturn => { - const { navigate, params } = useAppNavigate(); + const { navigate } = useAppNavigate(); const { ableToSkipQuestionnaire } = useQuestionnaire(); const { wallet, updateWallet } = useWalletContext(); const { changeCurrentAccount } = useCurrentAccount(); @@ -42,13 +42,19 @@ const useAccountAddScreen = (): UseAccountAddScreenReturn => { return wallet.keyrings.filter(isHDWalletKeyring).length > 1; }, [wallet]); - const [step, setStep] = useState( - params?.doneQuestionnaire - ? hasMultiSeedPhrase - ? 'CREATE_ACCOUNT' - : 'SELECT_SEED_PHRASE' - : 'INIT', - ); + const getInitializeStep = (): AccountAddStateType => { + if (!wallet) { + return 'INIT'; + } + + if (hasMultiSeedPhrase) { + return 'SELECT_SEED_PHRASE'; + } + + return 'CREATE_ACCOUNT'; + }; + + const [step, setStep] = useState(getInitializeStep()); const accountAddStepNo = hasMultiSeedPhrase ? { @@ -87,6 +93,10 @@ const useAccountAddScreen = (): UseAccountAddScreenReturn => { break; case 'SELECT_SEED_PHRASE': case 'CREATE_ACCOUNT': + if (wallet) { + navigate(RoutePath.WebAdvancedOption); + break; + } setStep('INIT'); break; default: From 23f0d809fd0da129731bcfb428fb44dca1cbc2b4 Mon Sep 17 00:00:00 2001 From: jinoosss Date: Thu, 26 Sep 2024 10:46:40 +0900 Subject: [PATCH 3/4] fix: fix the UI to be centred during the account selection process --- .../src/pages/web/account-add-screen/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/adena-extension/src/pages/web/account-add-screen/index.tsx b/packages/adena-extension/src/pages/web/account-add-screen/index.tsx index dd1df31c..ef0acc51 100644 --- a/packages/adena-extension/src/pages/web/account-add-screen/index.tsx +++ b/packages/adena-extension/src/pages/web/account-add-screen/index.tsx @@ -5,7 +5,7 @@ import { WebMainHeader } from '@components/pages/web/main-header'; import useAccountAddScreen from '@hooks/web/use-account-add-screen'; import { ADENA_DOCS_PAGE } from '@common/constants/resource.constant'; -import { WEB_TOP_SPACING, WEB_TOP_SPACING_RESPONSIVE } from '@common/constants/ui.constant'; +import { WEB_TOP_SPACING } from '@common/constants/ui.constant'; import SensitiveInfoStep from '@components/pages/web/sensitive-info-step'; import CreateAccountStep from './create-account-step'; import SelectSeedPhraseStep from './select-seed-phrase-step'; @@ -20,7 +20,7 @@ const AccountAddScreen = (): ReactElement => { if (step === 'INIT') { return { default: WEB_TOP_SPACING, - responsive: WEB_TOP_SPACING_RESPONSIVE, + responsive: WEB_TOP_SPACING, }; } return null; From 3f11ef68e39248ab55adc2d1dc231e24169e695e Mon Sep 17 00:00:00 2001 From: jinoosss Date: Thu, 26 Sep 2024 10:48:46 +0900 Subject: [PATCH 4/4] fix: Fixes a bug that prevented updating accounts by mnemonic when selecting an account --- .../adena-extension/src/hooks/web/use-account-import-screen.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/adena-extension/src/hooks/web/use-account-import-screen.ts b/packages/adena-extension/src/hooks/web/use-account-import-screen.ts index 9a959f81..54783e3a 100644 --- a/packages/adena-extension/src/hooks/web/use-account-import-screen.ts +++ b/packages/adena-extension/src/hooks/web/use-account-import-screen.ts @@ -221,9 +221,11 @@ const useAccountImportScreen = ({ wallet }: { wallet: Wallet }): UseAccountImpor } }, [ step, + wallet, inputType, inputValue, selectedAddresses, + loadedAccounts, ableToSkipQuestionnaire, makePrivateKeyAccountAndKeyring, ]);