diff --git a/nym-wallet/src/components/Accounts/MultiAccountHowTo.tsx b/nym-wallet/src/components/Accounts/MultiAccountHowTo.tsx
index fa7ae1659c..a9da0f1ef3 100644
--- a/nym-wallet/src/components/Accounts/MultiAccountHowTo.tsx
+++ b/nym-wallet/src/components/Accounts/MultiAccountHowTo.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import { Alert, Box, Paper, Dialog, DialogContent, DialogTitle, IconButton, Stack, Typography } from '@mui/material';
import { Close } from '@mui/icons-material';
+import { useTheme } from '@mui/material/styles';
const passwordCreationSteps = [
'Log out',
@@ -10,34 +11,46 @@ const passwordCreationSteps = [
'Now you can create multiple accounts',
];
-export const MultiAccountHowTo = ({ show, handleClose }: { show: boolean; handleClose: () => void }) => (
-
-);
+export const MultiAccountHowTo = ({ show, handleClose }: { show: boolean; handleClose: () => void }) => {
+ const theme = useTheme();
+ return (
+
+ );
+};
diff --git a/nym-wallet/src/components/Accounts/modals/AccountsModal.tsx b/nym-wallet/src/components/Accounts/modals/AccountsModal.tsx
index efe5a5428c..91525b8a54 100644
--- a/nym-wallet/src/components/Accounts/modals/AccountsModal.tsx
+++ b/nym-wallet/src/components/Accounts/modals/AccountsModal.tsx
@@ -12,6 +12,7 @@ import {
Divider,
} from '@mui/material';
import { Add, ArrowDownwardSharp, Close } from '@mui/icons-material';
+import { useTheme } from '@mui/material/styles';
import { AccountsContext } from 'src/context';
import { AccountItem } from '../AccountItem';
import { ConfirmPasswordModal } from './ConfirmPasswordModal';
@@ -21,6 +22,8 @@ export const AccountsModal = () => {
useContext(AccountsContext);
const [accountToSwitchTo, setAccountToSwitchTo] = useState();
+ const theme = useTheme();
+
const handleClose = () => {
setDialogToDisplay(undefined);
setError(undefined);
@@ -47,48 +50,51 @@ export const AccountsModal = () => {
open={dialogToDisplay === 'Accounts'}
onClose={handleClose}
fullWidth
- PaperComponent={Paper}
- PaperProps={{ elevation: 0 }}
+ PaperProps={{
+ style: { border: `1px solid ${theme.palette.nym.nymWallet.modal.border}` },
+ }}
>
-
-
- Accounts
-
-
-
-
-
- Switch between accounts
-
-
-
- {accounts?.map(({ id, address }) => (
- {
- if (selectedAccount?.id !== id) {
- setAccountToSwitchTo(id);
- }
- }}
- />
- ))}
-
-
-
- } onClick={() => setDialogToDisplay('Import')}>
- Import account
-
- }
- onClick={() => setDialogToDisplay('Add')}
- >
- Add new account
-
-
+
+
+
+ Accounts
+
+
+
+
+
+ Switch between accounts
+
+
+
+ {accounts?.map(({ id, address }) => (
+ {
+ if (selectedAccount?.id !== id) {
+ setAccountToSwitchTo(id);
+ }
+ }}
+ />
+ ))}
+
+
+
+ } onClick={() => setDialogToDisplay('Import')}>
+ Import account
+
+ }
+ onClick={() => setDialogToDisplay('Add')}
+ >
+ Add new account
+
+
+
);
};
diff --git a/nym-wallet/src/components/Accounts/modals/ConfirmPasswordModal.tsx b/nym-wallet/src/components/Accounts/modals/ConfirmPasswordModal.tsx
index 29694fcda8..07baa9b8d8 100644
--- a/nym-wallet/src/components/Accounts/modals/ConfirmPasswordModal.tsx
+++ b/nym-wallet/src/components/Accounts/modals/ConfirmPasswordModal.tsx
@@ -1,6 +1,6 @@
import React, { useContext } from 'react';
-import { Box, Paper, Dialog, DialogTitle, IconButton, Typography } from '@mui/material';
-import { ArrowBack } from '@mui/icons-material';
+import { Paper, Dialog, DialogTitle, Typography } from '@mui/material';
+import { useTheme } from '@mui/material/styles';
import { ConfirmPassword } from 'src/components/ConfirmPassword';
import { AccountsContext } from 'src/context';
@@ -14,28 +14,32 @@ export const ConfirmPasswordModal = ({
onConfirm: (password: string) => Promise;
}) => {
const { isLoading, error } = useContext(AccountsContext);
+ const theme = useTheme();
return (
);
};
diff --git a/nym-wallet/src/components/Accounts/modals/EditAccountModal.tsx b/nym-wallet/src/components/Accounts/modals/EditAccountModal.tsx
index 91a0a65e9d..8ddbb207b3 100644
--- a/nym-wallet/src/components/Accounts/modals/EditAccountModal.tsx
+++ b/nym-wallet/src/components/Accounts/modals/EditAccountModal.tsx
@@ -12,6 +12,7 @@ import {
Typography,
} from '@mui/material';
import { Close } from '@mui/icons-material';
+import { useTheme } from '@mui/material/styles';
import { AccountsContext } from 'src/context';
export const EditAccountModal = () => {
@@ -19,6 +20,8 @@ export const EditAccountModal = () => {
const { accountToEdit, dialogToDisplay, setDialogToDisplay, handleEditAccount } = useContext(AccountsContext);
+ const theme = useTheme();
+
useEffect(() => {
setAccountName(accountToEdit ? accountToEdit?.id : '');
}, [accountToEdit]);
@@ -28,48 +31,51 @@ export const EditAccountModal = () => {
open={dialogToDisplay === 'Edit'}
onClose={() => setDialogToDisplay('Accounts')}
fullWidth
- PaperComponent={Paper}
- PaperProps={{ elevation: 0 }}
+ PaperProps={{
+ style: { border: `1px solid ${theme.palette.nym.nymWallet.modal.border}` },
+ }}
>
-
-
- Edit account name
- setDialogToDisplay('Accounts')}>
-
-
-
-
- New wallet address
-
-
-
-
-
+
+
+ Edit account name
+ setDialogToDisplay('Accounts')}>
+
+
+
+
+ New wallet address
+
+
+
+
+ setAccountName(e.target.value)}
+ autoFocus
+ />
+
+
+
+
-
-
-
-
+ disableElevation
+ variant="contained"
+ size="large"
+ onClick={() => {
+ if (accountToEdit) {
+ handleEditAccount({ ...accountToEdit, id: accountName });
+ setDialogToDisplay('Accounts');
+ }
+ }}
+ disabled={!accountName?.length}
+ >
+ Edit
+
+
+
);
};
diff --git a/nym-wallet/src/components/Bonding/forms/BondMixnodeForm.tsx b/nym-wallet/src/components/Bonding/forms/BondMixnodeForm.tsx
index a603907e4d..fe74699dcf 100644
--- a/nym-wallet/src/components/Bonding/forms/BondMixnodeForm.tsx
+++ b/nym-wallet/src/components/Bonding/forms/BondMixnodeForm.tsx
@@ -157,7 +157,7 @@ const AmountFormData = ({
return (
-
+
{hasVestingTokens && setValue('tokenPool', pool)} />}
{step === 1 && (
<>
-
+
diff --git a/nym-wallet/src/components/Bonding/modals/BondMixnodeModal.tsx b/nym-wallet/src/components/Bonding/modals/BondMixnodeModal.tsx
index c2bf747d83..3151ffad5d 100644
--- a/nym-wallet/src/components/Bonding/modals/BondMixnodeModal.tsx
+++ b/nym-wallet/src/components/Bonding/modals/BondMixnodeModal.tsx
@@ -152,18 +152,16 @@ export const BondMixnodeModal = ({
subHeader={`Step ${step}/2`}
okLabel="Next"
>
-
-
-
+
);
};
diff --git a/nym-wallet/src/components/Bonding/modals/NodeSettingsModal.tsx b/nym-wallet/src/components/Bonding/modals/NodeSettingsModal.tsx
index 4bdc611f68..ac8cf7fc36 100644
--- a/nym-wallet/src/components/Bonding/modals/NodeSettingsModal.tsx
+++ b/nym-wallet/src/components/Bonding/modals/NodeSettingsModal.tsx
@@ -111,7 +111,7 @@ export const NodeSettings = ({
Set profit margin
- setPm(e.target.value)} fullWidth />
+ setPm(e.target.value)} fullWidth />
{error && (
Profit margin should be a number between 0 and 100
diff --git a/nym-wallet/src/components/ConfirmTX.stories.tsx b/nym-wallet/src/components/ConfirmTX.stories.tsx
index 77bbf4fdcf..2eec07b7e3 100644
--- a/nym-wallet/src/components/ConfirmTX.stories.tsx
+++ b/nym-wallet/src/components/ConfirmTX.stories.tsx
@@ -10,9 +10,9 @@ export default {
const Template: ComponentStory = (args) => (
-
-
-
+
+
+
);
diff --git a/nym-wallet/src/components/Delegation/DelegateModal.tsx b/nym-wallet/src/components/Delegation/DelegateModal.tsx
index 50873055e4..a6c1bb0dbf 100644
--- a/nym-wallet/src/components/Delegation/DelegateModal.tsx
+++ b/nym-wallet/src/components/Delegation/DelegateModal.tsx
@@ -213,8 +213,8 @@ export const DelegateModal: React.FC<{
onPrev={resetFeeState}
onConfirm={handleOk}
>
-
-
+
+
);
}
@@ -267,7 +267,7 @@ export const DelegateModal: React.FC<{
>
{errorIdentityKey}
-
+
{hasVestingContract && setTokenPool(pool)} />}
void;
}> = ({ children, open, title, message, sx, backdropProps, onClose }) => (
-
+ `1px solid ${t.palette.nym.nymWallet.modal.border}`, ...modalStyle, ...sx }}
+ textAlign="center"
+ >
theme.palette.error.main} mb={1}>
{title || 'Oh no! Something went wrong...'}
diff --git a/nym-wallet/src/components/Modals/LoadingModal.tsx b/nym-wallet/src/components/Modals/LoadingModal.tsx
index a50bec77eb..eda3d407a4 100644
--- a/nym-wallet/src/components/Modals/LoadingModal.tsx
+++ b/nym-wallet/src/components/Modals/LoadingModal.tsx
@@ -18,7 +18,10 @@ export const LoadingModal: React.FC<{
backdropProps?: object;
}> = ({ sx, backdropProps }) => (
-
+ `1px solid ${t.palette.nym.nymWallet.modal.border}`, ...modalStyle, ...sx }}
+ textAlign="center"
+ >
Please wait...
diff --git a/nym-wallet/src/components/Modals/ModalFee.tsx b/nym-wallet/src/components/Modals/ModalFee.tsx
index f60f6690ac..752be087a7 100644
--- a/nym-wallet/src/components/Modals/ModalFee.tsx
+++ b/nym-wallet/src/components/Modals/ModalFee.tsx
@@ -5,17 +5,33 @@ import { ModalListItem } from './ModalListItem';
import { ModalDivider } from './ModalDivider';
type TFeeProps = { fee?: FeeDetails; isLoading: boolean; error?: string; divider?: boolean };
+type TTotalAmountProps = { fee?: FeeDetails; amount?: string; isLoading: boolean; error?: string; divider?: boolean };
-const getValue = ({ fee, isLoading, error }: TFeeProps) => {
+const getValue = ({ fee, amount, isLoading, error }: TTotalAmountProps) => {
if (isLoading) return ;
if (error && !isLoading) return 'n/a';
- if (fee) return `${fee.amount?.amount} ${fee.amount?.denom.toUpperCase()}`;
+ if (fee) {
+ const numericFee = Number(fee.amount?.amount);
+ const numericAmountToTransfer = Number(amount);
+ return amount
+ ? `${numericFee + numericAmountToTransfer} ${fee.amount?.denom.toUpperCase()}`
+ : `${fee.amount?.amount} ${fee.amount?.denom.toUpperCase()}`;
+ }
return '-';
};
export const ModalFee = ({ fee, isLoading, error, divider }: TFeeProps) => (
<>
-
+
{divider && }
>
);
+
+export const ModalTotalAmount = ({ fee, amount, isLoading, error, divider }: TTotalAmountProps) => {
+ return (
+ <>
+
+ {divider && }
+ >
+ );
+};
diff --git a/nym-wallet/src/components/Modals/ModalListItem.tsx b/nym-wallet/src/components/Modals/ModalListItem.tsx
index 2c1524dec8..1bf70c2384 100644
--- a/nym-wallet/src/components/Modals/ModalListItem.tsx
+++ b/nym-wallet/src/components/Modals/ModalListItem.tsx
@@ -12,11 +12,11 @@ export const ModalListItem: React.FC<{
}> = ({ label, value, hidden, fontWeight, divider }) => (
-
+
{label}
{value && (
-
+
{value}
)}
diff --git a/nym-wallet/src/components/Modals/SimpleModal.tsx b/nym-wallet/src/components/Modals/SimpleModal.tsx
index 6b043aa7c3..62673b9a63 100644
--- a/nym-wallet/src/components/Modals/SimpleModal.tsx
+++ b/nym-wallet/src/components/Modals/SimpleModal.tsx
@@ -38,7 +38,7 @@ export const SimpleModal: React.FC<{
backdropProps,
}) => (
-
+ `1px solid ${t.palette.nym.nymWallet.modal.border}`, ...modalStyle, ...sx }}>
{displayErrorIcon && }
{typeof header === 'string' ? (
@@ -52,7 +52,7 @@ export const SimpleModal: React.FC<{
theme.palette.text.secondary}
@@ -64,10 +64,10 @@ export const SimpleModal: React.FC<{
{children}
{(onOk || onBack) && (
-
- {onBack && }
+
+ {onBack && }
{onOk && (
-
+
);
};
diff --git a/nym-wallet/src/components/Send/SendDetailsModal.tsx b/nym-wallet/src/components/Send/SendDetailsModal.tsx
index eac87cded3..f2b7d13491 100644
--- a/nym-wallet/src/components/Send/SendDetailsModal.tsx
+++ b/nym-wallet/src/components/Send/SendDetailsModal.tsx
@@ -3,7 +3,7 @@ import { Stack, SxProps } from '@mui/material';
import { FeeDetails, DecCoin, CurrencyDenom } from '@nymproject/types';
import { SimpleModal } from '../Modals/SimpleModal';
import { ModalListItem } from '../Modals/ModalListItem';
-import { ModalFee } from '../Modals/ModalFee';
+import { ModalFee, ModalTotalAmount } from '../Modals/ModalFee';
export const SendDetailsModal = ({
amount,
@@ -38,11 +38,12 @@ export const SendDetailsModal = ({
sx={sx}
backdropProps={backdropProps}
>
-
-
-
-
+
+
+
+
+
);
diff --git a/nym-wallet/src/components/Send/SendInputModal.tsx b/nym-wallet/src/components/Send/SendInputModal.tsx
index cbd735f57b..c27eb58781 100644
--- a/nym-wallet/src/components/Send/SendInputModal.tsx
+++ b/nym-wallet/src/components/Send/SendInputModal.tsx
@@ -55,8 +55,8 @@ export const SendInputModal = ({
sx={sx}
backdropProps={backdropProps}
>
-
-
+
+
-
-
+
+
Est. fee for this transaction will be show on the next page
diff --git a/nym-wallet/src/components/StyledBackButton.tsx b/nym-wallet/src/components/StyledBackButton.tsx
index c934cc7968..319bb84c02 100644
--- a/nym-wallet/src/components/StyledBackButton.tsx
+++ b/nym-wallet/src/components/StyledBackButton.tsx
@@ -1,9 +1,9 @@
import React from 'react';
-import { Button } from '@mui/material';
+import { Button, SxProps } from '@mui/material';
import ArrowBackIosNewIcon from '@mui/icons-material/ArrowBackIosNew';
-export const StyledBackButton = ({ onBack }: { onBack: () => void }) => (
-
+export const StyledBackButton = ({ onBack, sx }: { onBack: () => void; sx?: SxProps }) => (
+
);
diff --git a/nym-wallet/src/pages/balance/components/TransferModal.tsx b/nym-wallet/src/pages/balance/components/TransferModal.tsx
index 451a9899e8..02a8318064 100644
--- a/nym-wallet/src/pages/balance/components/TransferModal.tsx
+++ b/nym-wallet/src/pages/balance/components/TransferModal.tsx
@@ -87,12 +87,12 @@ export const TransferModal = ({ onClose }: { onClose: () => void }) => {
) : (
<>
}
divider
/>
diff --git a/nym-wallet/src/theme/mui-theme.d.ts b/nym-wallet/src/theme/mui-theme.d.ts
index 4015963ec3..2a6cd001a8 100644
--- a/nym-wallet/src/theme/mui-theme.d.ts
+++ b/nym-wallet/src/theme/mui-theme.d.ts
@@ -67,6 +67,9 @@ declare module '@mui/material/styles' {
hover: {
background: string;
};
+ modal: {
+ border: string;
+ };
}
/**
@@ -85,7 +88,7 @@ declare module '@mui/material/styles' {
/**
* Add anything not palette related to the theme here
*/
- interface NymTheme {}
+ interface NymTheme { }
/**
* This augments the definitions of the MUI Theme with the Nym theme, as well as
@@ -93,8 +96,8 @@ declare module '@mui/material/styles' {
*
* IMPORTANT: only add extensions to the interfaces above, do not modify the lines below
*/
- interface Theme extends NymTheme {}
- interface ThemeOptions extends Partial {}
- interface Palette extends NymPaletteAndNymWalletPalette {}
- interface PaletteOptions extends NymPaletteAndNymWalletPaletteOptions {}
+ interface Theme extends NymTheme { }
+ interface ThemeOptions extends Partial { }
+ interface Palette extends NymPaletteAndNymWalletPalette { }
+ interface PaletteOptions extends NymPaletteAndNymWalletPaletteOptions { }
}
diff --git a/nym-wallet/src/theme/theme.tsx b/nym-wallet/src/theme/theme.tsx
index b686c8a833..494ef6408a 100644
--- a/nym-wallet/src/theme/theme.tsx
+++ b/nym-wallet/src/theme/theme.tsx
@@ -59,6 +59,9 @@ const darkMode: NymPaletteVariant = {
hover: {
background: '#36393E',
},
+ modal: {
+ border: '#484d53',
+ },
};
const lightMode: NymPaletteVariant = {
@@ -86,6 +89,9 @@ const lightMode: NymPaletteVariant = {
hover: {
background: '#F9F9F9',
},
+ modal: {
+ border: 'transparent',
+ },
};
/**