Browse Source

Merge theme Prop instead of replacing

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

+ 28
- 24
landing-blocks/src/LandingProvider.tsx View File

@ -52,30 +52,34 @@ export function LandingProvider({
const { colorMode } = useColorMode()
const Mode = dark ? DarkMode : Fragment
dark = dark ?? colorMode === 'dark'
const theme = useMemo(
() =>
themeProp===undefined || themeProp===null ?
merge(chakraTheme, {
colors: {
primary,
secondary,
black,
white,
},
sizes: {
pageContainer: pageWidth,
},
fonts: {
body: fontFamily,
heading: fontFamily,
},
fontSizes: {
text: '18px',
heading: '42px',
subheading: '24px',
subtext: '15px',
},
}) : themeProp,
const theme = useMemo(() =>
merge(
chakraTheme,
merge(
{
colors: {
primary,
secondary,
black,
white,
},
sizes: {
pageContainer: pageWidth,
},
fonts: {
body: fontFamily,
heading: fontFamily,
},
fontSizes: {
text: '18px',
heading: '42px',
subheading: '24px',
subtext: '15px',
},
},
themeProp || {}
)
),
[pageWidth, primary, secondary, themeProp],
)
return (

Loading…
Cancel
Save