feat: begin working on being able to immplement dark mode and light mode

This commit is contained in:
Stevan Freeborn
2023-04-20 22:39:47 -05:00
parent ec87b67385
commit 8eb224e018
8 changed files with 91 additions and 39 deletions
+22 -6
View File
@@ -2,6 +2,7 @@
import Link from 'next/link.js';
import { useState } from 'react';
import { useThemeContext } from '../theme';
import { Doc, DocsStructure } from '../types/types.js';
import styles from './SideBar.module.css';
@@ -92,14 +93,29 @@ export default function SideBar({
}: {
version: DocsStructure;
}) {
const { theme, setTheme } = useThemeContext();
return (
<div className={styles.container}>
<Link href="/" className={styles.link}>
<h1 className={styles.title}>
<span className={styles.onspring}>Onspring</span>{' '}
<span className={styles.api}>API</span>
</h1>
</Link>
<div>
<Link href="/" className={styles.link}>
<h1 className={styles.title}>
<span className={styles.onspring}>
Onspring
</span>{' '}
<span className={styles.api}>API</span>
</h1>
</Link>
<label className="switch">
<input
onChange={() =>
setTheme(theme === 'light' ? 'dark' : 'light')
}
type="checkbox"
/>
<span className="slider round"></span>
</label>
</div>
<ListTree docs={version.docs} />
</div>
);