Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export interface ThemeProviderProps {
/*
* If true, the Theme Provider will also inject the root node for message toasts.
* Required in case you want to use them.
*/
withToastContainer?: boolean;
children: ReactNode;
/*
* Allows you to inject a custom JSS instance, e.g. if you need another insertionPoint or different plugins.
* If not provided, the default instance from `react-jss` will be used.
*/
jss?: Jss;
}
const generateClassName = createGenerateClassName();
const ThemeProvider: FC = (props) => {
const { withToastContainer, children, jss } = props;
const theme = getTheme();
const isCompactSize = getCompactSize();
const themeContext = useMemo(() => {
return {
theme,
contentDensity: isCompactSize ? ContentDensity.Compact : ContentDensity.Cozy,
parameters: sap_fiori_3
};
}, [theme, isCompactSize]);
return (