How to use the @ui5/webcomponents-react-base/lib/createGenerateClassName.createGenerateClassName function in @ui5/webcomponents-react-base

To help you get started, we’ve selected a few @ui5/webcomponents-react-base examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SAP / ui5-webcomponents-react / packages / main / src / components / ThemeProvider / index.tsx View on Github external
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 (