mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
21 lines
500 B
TypeScript
21 lines
500 B
TypeScript
import { ChakraProvider } from '@chakra-ui/react';
|
|
import type { ColorMode } from '@chakra-ui/react';
|
|
import React from 'react';
|
|
|
|
import theme from '../theme';
|
|
|
|
type Props = {
|
|
children: React.ReactNode;
|
|
colorMode?: ColorMode;
|
|
}
|
|
|
|
const RenderWithChakra = ({ children, colorMode = 'light' }: Props) => {
|
|
return (
|
|
<ChakraProvider theme={{ ...theme, config: { ...theme.config, initialColorMode: colorMode } }}>
|
|
{ children }
|
|
</ChakraProvider>
|
|
);
|
|
};
|
|
|
|
export default RenderWithChakra;
|