diff --git a/nym-wallet/src/components/Accounts/Accounts.tsx b/nym-wallet/src/components/Accounts/Accounts.tsx
index 2dd50102d4..9845ec1269 100644
--- a/nym-wallet/src/components/Accounts/Accounts.tsx
+++ b/nym-wallet/src/components/Accounts/Accounts.tsx
@@ -4,7 +4,6 @@ import { AccountsContext } from 'src/context';
import { EditAccountModal } from './EditAccountModal';
import { AddAccountModal } from './AddAccountModal';
import { AccountsModal } from './AccountsModal';
-import { ImportAccountModal } from './ImportAccountModal';
import { AccountAvatar } from './AccountAvatar';
export const Accounts = () => {
@@ -23,7 +22,6 @@ export const Accounts = () => {
-
>
) : null;
};
diff --git a/nym-wallet/src/components/Accounts/AddAccountModal.tsx b/nym-wallet/src/components/Accounts/AddAccountModal.tsx
index 4bac2e5660..b21327a7df 100644
--- a/nym-wallet/src/components/Accounts/AddAccountModal.tsx
+++ b/nym-wallet/src/components/Accounts/AddAccountModal.tsx
@@ -19,6 +19,11 @@ import { createMnemonic } from 'src/requests';
import { AccountsContext } from 'src/context';
const createAccountSteps = ['Save and copy mnemonic for your new account', 'Name your new account', 'Confirm password'];
+const importAccountSteps = [
+ 'Provide mnemonic of account you want to import',
+ 'Name your new account',
+ 'Confirm password',
+];
const passwordCreationSteps = [
'Log out',
@@ -91,6 +96,36 @@ const MnemonicStep = ({ mnemonic, onNext }: { mnemonic: string; onNext: () => vo
);
};
+const ImportMnemonic = ({
+ value,
+ onChange,
+ onNext,
+}: {
+ value: string;
+ onChange: (value: string) => void;
+ onNext: () => void;
+}) => (
+
+
+
+ onChange(e.target.value)} fullWidth />
+
+
+
+
+
+
+);
+
const NameAccount = ({ onNext }: { onNext: (value: string) => void }) => {
const [value, setValue] = useState('');
return (
@@ -142,9 +177,9 @@ const ConfirmPassword = ({ onConfirm }: { onConfirm: (password: string) => void
export const AddAccountModal = ({ withoutPassword }: { withoutPassword?: boolean }) => {
const [step, setStep] = useState(0);
- const [data, setData] = useState<{ mnemonic?: string; accountName?: string }>({
- mnemonic: undefined,
- accountName: undefined,
+ const [data, setData] = useState({
+ mnemonic: '',
+ accountName: '',
});
const { dialogToDisplay, setDialogToDisplay, handleAddAccount } = useContext(AccountsContext);
@@ -156,19 +191,25 @@ export const AddAccountModal = ({ withoutPassword }: { withoutPassword?: boolean
const handleClose = () => {
setDialogToDisplay('Accounts');
- setData({ mnemonic: undefined, accountName: undefined });
+ setData({ mnemonic: '', accountName: '' });
setStep(0);
};
useEffect(() => {
- if (dialogToDisplay === 'Accounts') generateMnemonic();
+ if (dialogToDisplay === 'Add') generateMnemonic();
+ else setData({ mnemonic: '', accountName: '' });
}, [dialogToDisplay]);
return (
-