Skip to content

Commit

Permalink
some refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
gala1234 committed Aug 4, 2022
1 parent da60606 commit a575455
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
8 changes: 4 additions & 4 deletions nym-wallet/src/components/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ export const Nav = () => {
onClick={onClick}
sx={{
cursor: 'pointer',
py: '16px',
paddingLeft: '32px',
borderRadius: '8px',
'&:hover': { backgroundColor: (theme) => (theme.palette.mode === 'light' ? '#F9F9F9' : '#36393E') },
py: 2,
paddingLeft: 3.5,
borderRadius: 1,
'&:hover': { backgroundColor: (theme) => theme.palette.nym.nymWallet.hover.background },
}}
>
<ListItemIcon
Expand Down
1 change: 0 additions & 1 deletion nym-wallet/src/layouts/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const ApplicationLayout: React.FC = ({ children }) => {
background: (t) => t.palette.nym.nymWallet.nav.background,
overflow: 'auto',
py: 5,
px: 0,
}}
display="flex"
flexDirection="column"
Expand Down
13 changes: 8 additions & 5 deletions nym-wallet/src/theme/mui-theme.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ declare module '@mui/material/styles' {
nav: {
background: string;
};
hover: {
background: string;
};
}

/**
Expand All @@ -82,16 +85,16 @@ 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
* a partial `ThemeOptions` type used by `createTheme`
*
* IMPORTANT: only add extensions to the interfaces above, do not modify the lines below
*/
interface Theme extends NymTheme {}
interface ThemeOptions extends Partial<NymTheme> {}
interface Palette extends NymPaletteAndNymWalletPalette {}
interface PaletteOptions extends NymPaletteAndNymWalletPaletteOptions {}
interface Theme extends NymTheme { }
interface ThemeOptions extends Partial<NymTheme> { }
interface Palette extends NymPaletteAndNymWalletPalette { }
interface PaletteOptions extends NymPaletteAndNymWalletPaletteOptions { }
}
6 changes: 6 additions & 0 deletions nym-wallet/src/theme/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ const darkMode: NymPaletteVariant = {
nav: {
background: '#292E34',
},
hover: {
background: '#36393E',
},
};

const lightMode: NymPaletteVariant = {
Expand All @@ -80,6 +83,9 @@ const lightMode: NymPaletteVariant = {
nav: {
background: '#FFFFFF',
},
hover: {
background: '#F9F9F9',
},
};

/**
Expand Down

0 comments on commit a575455

Please sign in to comment.