forked from safe-global/safe-wallet-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: move theme from safe-react-components (safe-global#3038)
* Refactor: move theme from safe-react-components * Prettier * Lint
- Loading branch information
Showing
20 changed files
with
719 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@font-face { | ||
font-family: 'DM Sans'; | ||
font-display: swap; | ||
font-weight: 400; | ||
src: url('/fonts/DMSansRegular.woff2') format('woff2'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'DM Sans'; | ||
font-display: swap; | ||
font-weight: bold; | ||
src: url('/fonts/DMSans700.woff2') format('woff2'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/components/safe-apps/SafeAppsInfoModal/UnknownAppWarning.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { useMemo, type FC } from 'react' | ||
import { type PaletteMode, type Theme, ThemeProvider } from '@mui/material' | ||
import createSafeTheme from './safeTheme' | ||
|
||
// This component is necessary to make the theme available in the library components | ||
// Is not enough wrapping the client app with the regular ThemeProvider as the library components | ||
// are not aware of the theme context: | ||
// https://github.com/mui/material-ui/issues/32806 | ||
// https://stackoverflow.com/questions/69072004/material-ui-theme-not-working-in-shared-component | ||
type SafeThemeProviderProps = { | ||
children: (theme: Theme) => React.ReactNode | ||
mode: PaletteMode | ||
} | ||
|
||
const SafeThemeProvider: FC<SafeThemeProviderProps> = ({ children, mode }) => { | ||
const theme = useMemo(() => createSafeTheme(mode), [mode]) | ||
|
||
return <ThemeProvider theme={theme}>{children(theme)}</ThemeProvider> | ||
} | ||
|
||
export default SafeThemeProvider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
const darkPalette = { | ||
text: { | ||
primary: '#FFFFFF', | ||
secondary: '#636669', | ||
disabled: '#636669', | ||
}, | ||
primary: { | ||
dark: '#0cb259', | ||
main: '#12FF80', | ||
light: '#A1A3A7', | ||
}, | ||
secondary: { | ||
dark: '#636669', | ||
main: '#FFFFFF', | ||
light: '#12FF80', | ||
background: '#303033', | ||
}, | ||
border: { | ||
main: '#636669', | ||
light: '#303033', | ||
background: '#121312', | ||
}, | ||
error: { | ||
dark: '#AC2C3B', | ||
main: '#FF5F72', | ||
light: '#FFB4BD', | ||
background: '#2F2527', | ||
}, | ||
success: { | ||
dark: '#028D4C', | ||
main: '#00B460', | ||
light: '#81C784', | ||
background: '#1F2920', | ||
}, | ||
info: { | ||
dark: '#52BFDC', | ||
main: '#5FDDFF', | ||
light: '#B7F0FF', | ||
background: '#19252C', | ||
}, | ||
warning: { | ||
dark: '#CD674E', | ||
main: '#FF8061', | ||
light: '#FFB7A6', | ||
background: '#2F2318', | ||
}, | ||
background: { | ||
default: '#121312', | ||
main: '#121312', | ||
paper: '#1C1C1C', | ||
light: '#1B2A22', | ||
}, | ||
backdrop: { | ||
main: '#636669', | ||
}, | ||
logo: { | ||
main: '#FFFFFF', | ||
background: '#303033', | ||
}, | ||
static: { | ||
main: '#121312', | ||
}, | ||
} | ||
|
||
export default darkPalette |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
const lightPalette = { | ||
text: { | ||
primary: '#121312', | ||
secondary: '#A1A3A7', | ||
disabled: '#DDDEE0', | ||
}, | ||
primary: { | ||
dark: '#3c3c3c', | ||
main: '#121312', | ||
light: '#636669', | ||
}, | ||
secondary: { | ||
dark: '#0FDA6D', | ||
main: '#12FF80', | ||
light: '#B0FFC9', | ||
background: '#EFFFF4', | ||
}, | ||
border: { | ||
main: '#A1A3A7', | ||
light: '#DCDEE0', | ||
background: '#F4F4F4', | ||
}, | ||
error: { | ||
dark: '#AC2C3B', | ||
main: '#FF5F72', | ||
light: '#FFB4BD', | ||
background: '#FFE6EA', | ||
}, | ||
success: { | ||
dark: '#028D4C', | ||
main: '#00B460', | ||
light: '#72F5B8', | ||
background: '#F2FFF9', | ||
}, | ||
info: { | ||
dark: '#52BFDC', | ||
main: '#5FDDFF', | ||
light: '#B7F0FF', | ||
background: '#EFFCFF', | ||
}, | ||
warning: { | ||
dark: '#CD674E', | ||
main: '#FF8061', | ||
light: '#FFB7A6', | ||
background: '#FFF0ED', | ||
}, | ||
background: { | ||
default: '#F4F4F4', | ||
main: '#F4F4F4', | ||
paper: '#FFFFFF', | ||
light: '#EFFFF4', | ||
}, | ||
backdrop: { | ||
main: '#636669', | ||
}, | ||
logo: { | ||
main: '#121312', | ||
background: '#EEEFF0', | ||
}, | ||
static: { | ||
main: '#121312', | ||
}, | ||
} | ||
|
||
export default lightPalette |
Oops, something went wrong.