Browse Source

Allow to provided fully custom theme

pull/3/head
Vincent Lecrubier 1 year ago
committed by GitHub
parent
commit
f5d999f922
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      landing-blocks/src/LandingProvider.tsx

+ 5
- 3
landing-blocks/src/LandingProvider.tsx View File

@ -46,13 +46,15 @@ export function LandingProvider({
pageWidth = '1200px',
fontFamily = 'Roboto, system-ui, sans-serif',
children,
theme: themeProp,
...rest
}: LandingProviderProps) {
const { colorMode } = useColorMode()
const Mode = dark ? DarkMode : Fragment
dark = dark ?? colorMode === 'dark'
const theme = useMemo(
() =>
() =>
themeProp===undefined || themeProp===null ?
merge(chakraTheme, {
colors: {
primary,
@ -73,8 +75,8 @@ export function LandingProvider({
subheading: '24px',
subtext: '15px',
},
}),
[pageWidth, primary, secondary],
}) : themeProp,
[pageWidth, primary, secondary, themeProp],
)
return (
<PropagatedThemeProvider theme={theme}>

Loading…
Cancel
Save