diff --git a/app/layout.tsx b/app/layout.tsx index dc7c805da..86852a680 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -5,6 +5,7 @@ import { Inter as InterFont } from 'next/font/google'; import type { FC, PropsWithChildren } from 'react'; import '~/app/docs.css'; import '~/app/style.css'; +import { ThemeModeScript } from '~/src'; const interFont = InterFont({ subsets: ['latin'], @@ -56,6 +57,9 @@ export const metadata: Metadata = { const RootLayout: NextPage = ({ children }) => { return ( + + + {children} diff --git a/src/components/ThemeModeScript/ThemeModeScript.tsx b/src/components/ThemeModeScript/ThemeModeScript.tsx new file mode 100644 index 000000000..a314d5af3 --- /dev/null +++ b/src/components/ThemeModeScript/ThemeModeScript.tsx @@ -0,0 +1,42 @@ +import React from 'react'; +import type { ThemeMode } from '../../helpers/use-theme-mode'; + +export interface ThemeModeScriptProps extends React.ComponentPropsWithoutRef<'script'> { + mode?: ThemeMode; +} + +export const ThemeModeScript = ({ mode, ...others }: ThemeModeScriptProps) => { + return ( +