@chakra-ui/react#cookieStorageManager TypeScript Examples

The following examples show how to use @chakra-ui/react#cookieStorageManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Chakra.tsx    From ksana.in with Apache License 2.0 6 votes vote down vote up
export function Chakra({ cookies, children }: any) {
  const colorModeManager =
    typeof cookies === 'string' ? cookieStorageManager(cookies) : localStorageManager

  return (
    <ChakraProvider resetCSS colorModeManager={colorModeManager} theme={theme}>
      {children}
    </ChakraProvider>
  )
}
Example #2
Source File: Chakra.tsx    From coindrop with GNU General Public License v3.0 6 votes vote down vote up
Chakra: FunctionComponent<Props> = ({ cookies, children }) => {
  const colorModeManager = typeof cookies === "string" ? cookieStorageManager(cookies) : localStorageManager;
  return (
      <ChakraProvider
        colorModeManager={colorModeManager}
        theme={theme}
      >
        {children}
      </ChakraProvider>
  );
}