diff --git a/nym-wallet/src/components/Accounts/MultiAccountHowTo.tsx b/nym-wallet/src/components/Accounts/MultiAccountHowTo.tsx index aca5552b2e..fa7ae1659c 100644 --- a/nym-wallet/src/components/Accounts/MultiAccountHowTo.tsx +++ b/nym-wallet/src/components/Accounts/MultiAccountHowTo.tsx @@ -11,35 +11,33 @@ const passwordCreationSteps = [ ]; export const MultiAccountHowTo = ({ show, handleClose }: { show: boolean; handleClose: () => void }) => ( - - - - - Multi accounts - - - - - theme.palette.nym.text.muted }}> - How to set up multiple accounts - - - - - (t.palette.mode === 'dark' ? { bgcolor: (theme) => theme.palette.background.paper } : {})} - > - In order to create multiple accounts your wallet needs a password. - Follow steps below to create password. - - How to create a password for your account - {passwordCreationSteps.map((step, index) => ( - {`${index + 1}. ${step}`} - ))} - - - + + + + Multi accounts + + + + + theme.palette.nym.text.muted }}> + How to set up multiple accounts + + + + + (t.palette.mode === 'dark' ? { bgcolor: (theme) => theme.palette.background.paper } : {})} + > + In order to create multiple accounts your wallet needs a password. + Follow steps below to create password. + + How to create a password for your account + {passwordCreationSteps.map((step, index) => ( + {`${index + 1}. ${step}`} + ))} + + ); diff --git a/nym-wallet/src/components/Accounts/modals/AccountsModal.tsx b/nym-wallet/src/components/Accounts/modals/AccountsModal.tsx index cb1fe51c1d..efe5a5428c 100644 --- a/nym-wallet/src/components/Accounts/modals/AccountsModal.tsx +++ b/nym-wallet/src/components/Accounts/modals/AccountsModal.tsx @@ -43,48 +43,52 @@ export const AccountsModal = () => { ); return ( - - - - - Accounts - - - - - - Switch between accounts - - - - {accounts?.map(({ id, address }) => ( - { - if (selectedAccount?.id !== id) { - setAccountToSwitchTo(id); - } - }} - /> - ))} - - - - - - - + + + + Accounts + + + + + + Switch between accounts + + + + {accounts?.map(({ id, address }) => ( + { + if (selectedAccount?.id !== id) { + setAccountToSwitchTo(id); + } + }} + /> + ))} + + + + + + ); }; diff --git a/nym-wallet/src/components/Accounts/modals/AddAccountModal.tsx b/nym-wallet/src/components/Accounts/modals/AddAccountModal.tsx index 097f6d7ad0..9c03cb164a 100644 --- a/nym-wallet/src/components/Accounts/modals/AddAccountModal.tsx +++ b/nym-wallet/src/components/Accounts/modals/AddAccountModal.tsx @@ -177,68 +177,72 @@ export const AddAccountModal = () => { }, [step]); return ( - - - - - {`${dialogToDisplay} new account`} - - - {dialogToDisplay === 'Add' ? createAccountSteps[step] : importAccountSteps[step]} - - - {(() => { - switch (step) { - case 0: - return dialogToDisplay === 'Add' ? ( - setStep((s) => s + 1)} - onBack={() => (step === 0 ? handleClose() : setStep((s) => s - 1))} - /> - ) : ( - setData((d) => ({ ...d, mnemonic: value }))} - onNext={() => setStep((s) => s + 1)} - onBack={() => (step === 0 ? handleClose() : setStep((s) => s - 1))} - /> - ); - case 1: - return ( - { - setData((d) => ({ ...d, accountName })); - setStep((s) => s + 1); - }} - onBack={() => setStep((s) => s - 1)} - /> - ); - case 2: - return ( - { - if (data.accountName && data.mnemonic) { - try { - await handleAddAccount({ accountName: data.accountName, mnemonic: data.mnemonic, password }); - setStep(0); - setDialogToDisplay('Accounts'); - } catch (e) { - Console.error(e as string); - } + + + + {`${dialogToDisplay} new account`} + + + {dialogToDisplay === 'Add' ? createAccountSteps[step] : importAccountSteps[step]} + + + {(() => { + switch (step) { + case 0: + return dialogToDisplay === 'Add' ? ( + setStep((s) => s + 1)} + onBack={() => (step === 0 ? handleClose() : setStep((s) => s - 1))} + /> + ) : ( + setData((d) => ({ ...d, mnemonic: value }))} + onNext={() => setStep((s) => s + 1)} + onBack={() => (step === 0 ? handleClose() : setStep((s) => s - 1))} + /> + ); + case 1: + return ( + { + setData((d) => ({ ...d, accountName })); + setStep((s) => s + 1); + }} + onBack={() => setStep((s) => s - 1)} + /> + ); + case 2: + return ( + { + if (data.accountName && data.mnemonic) { + try { + await handleAddAccount({ accountName: data.accountName, mnemonic: data.mnemonic, password }); + setStep(0); + setDialogToDisplay('Accounts'); + } catch (e) { + Console.error(e as string); } - }} - onCancel={() => setStep((s) => s - 1)} - isLoading={isLoading} - error={error} - /> - ); - default: - return null; - } - })()} - + } + }} + onCancel={() => setStep((s) => s - 1)} + isLoading={isLoading} + error={error} + /> + ); + default: + return null; + } + })()} ); }; diff --git a/nym-wallet/src/components/Accounts/modals/ConfirmPasswordModal.tsx b/nym-wallet/src/components/Accounts/modals/ConfirmPasswordModal.tsx index 5f9307bcdf..29694fcda8 100644 --- a/nym-wallet/src/components/Accounts/modals/ConfirmPasswordModal.tsx +++ b/nym-wallet/src/components/Accounts/modals/ConfirmPasswordModal.tsx @@ -16,22 +16,26 @@ export const ConfirmPasswordModal = ({ const { isLoading, error } = useContext(AccountsContext); return ( - - - - Switch account - - Confirm password - - - - + + + Switch account + + Confirm password + + + ); }; diff --git a/nym-wallet/src/components/Accounts/modals/EditAccountModal.tsx b/nym-wallet/src/components/Accounts/modals/EditAccountModal.tsx index c9d495a329..91a0a65e9d 100644 --- a/nym-wallet/src/components/Accounts/modals/EditAccountModal.tsx +++ b/nym-wallet/src/components/Accounts/modals/EditAccountModal.tsx @@ -24,48 +24,52 @@ export const EditAccountModal = () => { }, [accountToEdit]); return ( - setDialogToDisplay('Accounts')} fullWidth> - - - - Edit account name - setDialogToDisplay('Accounts')}> - - - - - New wallet address - - - - - setAccountName(e.target.value)} - autoFocus - /> - - - - - - + value={accountName} + onChange={(e) => setAccountName(e.target.value)} + autoFocus + /> + + + + + ); }; diff --git a/nym-wallet/src/components/Accounts/modals/MnemonicModal.tsx b/nym-wallet/src/components/Accounts/modals/MnemonicModal.tsx index 713a321f25..cffdeea213 100644 --- a/nym-wallet/src/components/Accounts/modals/MnemonicModal.tsx +++ b/nym-wallet/src/components/Accounts/modals/MnemonicModal.tsx @@ -40,63 +40,67 @@ export const MnemonicModal = () => { }; return ( - - - - - Display mnemonic - - - - - theme.palette.text.disabled }}> - {`Display mnemonic for: ${accountMnemonic?.accountName}`} - - - - - {error && ( - - {error} - - )} - {!accountMnemonic.value ? ( - <> - Enter the password used to login to your wallet - setPassword(pswrd)} - autoFocus - /> - - ) : ( - - )} - - - - {!accountMnemonic.value && ( - + + + + Display mnemonic + + + + + theme.palette.text.disabled }}> + {`Display mnemonic for: ${accountMnemonic?.accountName}`} + + + + + {error && ( + + {error} + )} - - + {!accountMnemonic.value ? ( + <> + Enter the password used to login to your wallet + setPassword(pswrd)} + autoFocus + /> + + ) : ( + + )} + + + + {!accountMnemonic.value && ( + + )} + ); }; diff --git a/nym-wallet/src/components/Modals/ConfirmationModal.tsx b/nym-wallet/src/components/Modals/ConfirmationModal.tsx index f02202afd6..cc7107ae66 100644 --- a/nym-wallet/src/components/Modals/ConfirmationModal.tsx +++ b/nym-wallet/src/components/Modals/ConfirmationModal.tsx @@ -72,12 +72,12 @@ export const ConfirmationModal = ({ sx={{ textAlign: 'center', ...sx }} fullWidth={fullWidth} BackdropProps={backdropProps} + PaperComponent={Paper} + PaperProps={{ elevation: 0 }} > - - {Title} - {children} - {ConfirmButton} - + {Title} + {children} + {ConfirmButton} ); }; diff --git a/nym-wallet/src/components/Receive/ReceiveModal.tsx b/nym-wallet/src/components/Receive/ReceiveModal.tsx index 0b13cf87dd..181e93c0c7 100644 --- a/nym-wallet/src/components/Receive/ReceiveModal.tsx +++ b/nym-wallet/src/components/Receive/ReceiveModal.tsx @@ -1,15 +1,15 @@ import React, { useContext } from 'react'; import { AppContext } from 'src/context'; -import { Box, Stack, Typography, SxProps, Dialog, DialogTitle, DialogContent } from '@mui/material'; +import { Box, Stack, Typography, SxProps, Dialog, DialogTitle, DialogContent, Paper } from '@mui/material'; import QRCode from 'qrcode.react'; import { ClientAddress } from '../ClientAddress'; import { ModalListItem } from '../Modals/ModalListItem'; import { Close as CloseIcon } from '@mui/icons-material'; export const ReceiveModal = ({ onClose }: { onClose: () => void; sx?: SxProps; backdropProps?: object }) => { - const { clientDetails } = useContext(AppContext); + const { clientDetails, mode } = useContext(AppContext); return ( - + @@ -22,8 +22,18 @@ export const ReceiveModal = ({ onClose }: { onClose: () => void; sx?: SxProps; b } /> - - `1px solid ${t.palette.nym.highlight}`, bgcolor: 'white', borderRadius: 2, p: 3 }}> + + `1px solid ${mode === 'light' ? t.palette.nym.highlight : t.palette.nym.text.grey} `, + bgcolor: mode === 'light' ? 'white' : 'nym.background.main', + borderRadius: 2, + p: 3, + }} + > {clientDetails && } diff --git a/nym-wallet/src/pages/terminal/index.tsx b/nym-wallet/src/pages/terminal/index.tsx index 13e3cc2dce..a5dce4167d 100644 --- a/nym-wallet/src/pages/terminal/index.tsx +++ b/nym-wallet/src/pages/terminal/index.tsx @@ -92,98 +92,103 @@ const TerminalInner: React.FC = () => { }, [network]); return ( - - - - - - Terminal - {!isBusy && } - - + + + + + Terminal + {!isBusy && } + + + } + dataTestid="terminal-page" + > +

State Viewer

+ + {error && {error}} + + {status ? ( + } sx={{ mb: 2 }}> + {status} + + ) : ( + + Data loading complete + + )} + + +
{JSON.stringify(appEnv, null, 2)}
+
+ + +
{JSON.stringify(clientDetails, null, 2)}
+
+ + +
{JSON.stringify(userBalance, null, 2)}
+
+ + + useGetBalance Balance + } - dataTestid="terminal-page" > -

State Viewer

+
{JSON.stringify(userBalance.balance, null, 2)}
+
- {error && {error}} + + useGetBalance Vesting Account Info + + } + > +
{JSON.stringify(userBalance.vestingAccountInfo, null, 2)}
+
- {status ? ( - } sx={{ mb: 2 }}> - {status} - - ) : ( - - Data loading complete - - )} + + useGetBalance Current Vest Period + + } + > +
{JSON.stringify(userBalance.currentVestingPeriod, null, 2)}
+
- -
{JSON.stringify(appEnv, null, 2)}
-
+ +
{JSON.stringify(userBalance.originalVesting, null, 2)}
+
- -
{JSON.stringify(clientDetails, null, 2)}
-
+ +
{JSON.stringify(mixnodeDelegations, null, 2)}
+
- -
{JSON.stringify(userBalance, null, 2)}
-
+ +
{JSON.stringify(pendingEvents, null, 2)}
+
- - useGetBalance Balance - - } - > -
{JSON.stringify(userBalance.balance, null, 2)}
-
+ +
{JSON.stringify(pendingVestingEvents, null, 2)}
+
- - useGetBalance Vesting Account Info - - } - > -
{JSON.stringify(userBalance.vestingAccountInfo, null, 2)}
-
- - - useGetBalance Current Vest Period - - } - > -
{JSON.stringify(userBalance.currentVestingPeriod, null, 2)}
-
- - -
{JSON.stringify(userBalance.originalVesting, null, 2)}
-
- - -
{JSON.stringify(mixnodeDelegations, null, 2)}
-
- - -
{JSON.stringify(pendingEvents, null, 2)}
-
- - -
{JSON.stringify(pendingVestingEvents, null, 2)}
-
- - -
{JSON.stringify(epoch, null, 2)}
-
- - + +
{JSON.stringify(epoch, null, 2)}
+
+
); };