From c2f82cd794444428c86c14e80e4f44bcf7fc91c6 Mon Sep 17 00:00:00 2001 From: captain-Akshay Date: Wed, 12 Jun 2024 20:21:06 +0530 Subject: [PATCH] fix: sistent themeprovider to enable branding theme Signed-off-by: captain-Akshay --- src/theme/ThemeProvider.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/theme/ThemeProvider.tsx b/src/theme/ThemeProvider.tsx index 8b369e13..8c7a2e8a 100644 --- a/src/theme/ThemeProvider.tsx +++ b/src/theme/ThemeProvider.tsx @@ -1,5 +1,5 @@ import { EmotionCache } from '@emotion/react'; -import { CssBaseline, PaletteMode, Theme, ThemeProvider } from '@mui/material'; +import { CssBaseline, Interactiveness, PaletteMode, Theme, ThemeProvider } from '@mui/material'; import React from 'react'; import { createCustomTheme } from './theme'; @@ -13,15 +13,19 @@ export interface SistentThemeProviderProps { children: React.ReactNode; emotionCache?: EmotionCache; initialMode?: PaletteMode; + customTheme?: Interactiveness; } function SistentThemeProvider({ children, emotionCache, - initialMode = 'light' + initialMode = 'light', + customTheme }: SistentThemeProviderProps): JSX.Element { const theme = React.useMemo(() => createCustomTheme(initialMode), [initialMode]); - + if (customTheme) { + theme.palette.background.brand = customTheme; + } return ( @@ -38,7 +42,6 @@ export function SistentThemeProviderWithoutBaseLine({ initialMode = 'light' }: SistentThemeProviderProps): JSX.Element { const theme = React.useMemo(() => createCustomTheme(initialMode), [initialMode]); - return ( {children}