diff --git a/nym-wallet/src/components/Accounts/MultiAccountHowTo.tsx b/nym-wallet/src/components/Accounts/MultiAccountHowTo.tsx index aca5552b2e..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,36 +11,46 @@ const passwordCreationSteps = [ 'Now you can create multiple accounts', ]; -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}`} - ))} - - - - -); +export const MultiAccountHowTo = ({ show, handleClose }: { show: boolean; handleClose: () => void }) => { + const theme = useTheme(); + return ( + + + + + 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..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); @@ -43,7 +46,14 @@ export const AccountsModal = () => { ); return ( - + diff --git a/nym-wallet/src/components/Accounts/modals/ConfirmPasswordModal.tsx b/nym-wallet/src/components/Accounts/modals/ConfirmPasswordModal.tsx index 5f9307bcdf..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,9 +14,17 @@ export const ConfirmPasswordModal = ({ onConfirm: (password: string) => Promise; }) => { const { isLoading, error } = useContext(AccountsContext); + const theme = useTheme(); return ( - + Switch account diff --git a/nym-wallet/src/components/Accounts/modals/EditAccountModal.tsx b/nym-wallet/src/components/Accounts/modals/EditAccountModal.tsx index c9d495a329..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,12 +20,21 @@ export const EditAccountModal = () => { const { accountToEdit, dialogToDisplay, setDialogToDisplay, handleEditAccount } = useContext(AccountsContext); + const theme = useTheme(); + useEffect(() => { setAccountName(accountToEdit ? accountToEdit?.id : ''); }, [accountToEdit]); return ( - setDialogToDisplay('Accounts')} fullWidth> + setDialogToDisplay('Accounts')} + fullWidth + PaperProps={{ + style: { border: `1px solid ${theme.palette.nym.nymWallet.modal.border}` }, + }} + > diff --git a/nym-wallet/src/components/Modals/ErrorModal.tsx b/nym-wallet/src/components/Modals/ErrorModal.tsx index 3ea54368d2..42d66c634a 100644 --- a/nym-wallet/src/components/Modals/ErrorModal.tsx +++ b/nym-wallet/src/components/Modals/ErrorModal.tsx @@ -11,7 +11,10 @@ export const ErrorModal: React.FC<{ onClose: () => 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/SimpleModal.tsx b/nym-wallet/src/components/Modals/SimpleModal.tsx index ac2c54d875..9cdbde21f7 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' ? ( diff --git a/nym-wallet/src/components/Receive/ReceiveModal.tsx b/nym-wallet/src/components/Receive/ReceiveModal.tsx index 8f56fc3279..eb9d48bbbf 100644 --- a/nym-wallet/src/components/Receive/ReceiveModal.tsx +++ b/nym-wallet/src/components/Receive/ReceiveModal.tsx @@ -4,30 +4,57 @@ import { Box, Stack, Typography, SxProps, Dialog, DialogTitle, DialogContent } f import QRCode from 'qrcode.react'; import { ClientAddress } from '../ClientAddress'; import { ModalListItem } from '../Modals/ModalListItem'; -import { Close as CloseIcon } from '@mui/icons-material'; +import { SimpleModal } from '../Modals/SimpleModal'; -export const ReceiveModal = ({ onClose }: { onClose: () => void; sx?: SxProps; backdropProps?: object }) => { +export const ReceiveModal = ({ + onClose, + sx, + backdropProps, +}: { + onClose: () => void; + sx?: SxProps; + backdropProps?: object; +}) => { const { clientDetails } = useContext(AppContext); return ( - - - - - Receive - - - - - - - } /> - - - `1px solid ${t.palette.nym.highlight}`, bgcolor: 'white', borderRadius: 2, p: 3 }}> + + + } /> + (t.palette.mode === 'dark' ? t.palette.background.default : 'rgba(251, 110, 78, 5%)'), + borderRadius: '0px 0px 16px 16px', + }} + > + + t.palette.mode === 'dark' + ? `1px solid ${t.palette.nym.nymWallet.modal.border}` + : `1px solid ${t.palette.nym.highlight}`, + bgcolor: (t) => (t.palette.mode === 'dark' ? 'transparent' : 'white'), + borderRadius: 2, + p: 3, + }} + > {clientDetails && } - - + + ); }; 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', + }, }; /**