feat: implement theme toggle switch

This commit is contained in:
Stevan Freeborn
2023-04-20 23:36:52 -05:00
parent 8eb224e018
commit 88d4c1c339
10 changed files with 138 additions and 70 deletions
+29
View File
@@ -0,0 +1,29 @@
'use client';
import { themes, useThemeContext } from '../theme';
import { DocSection, DocsStructure } from '../types/types';
import Main from './Main';
import NavBar from './NavBar';
import styles from './Page.module.css';
import SideBar from './SideBar';
export default function Page({
version,
versionSections,
}: {
version: DocsStructure;
versionSections: DocSection[];
}) {
const { theme } = useThemeContext();
const themeStyles = themes[theme];
return (
<div className={styles.wrapper} style={themeStyles}>
<SideBar version={version} />
<div className={styles.container}>
<NavBar version={version} />
<Main versionSections={versionSections} />
</div>
</div>
);
}