update style
This commit is contained in:
parent
7a386f5c14
commit
7736d5596c
15 changed files with 188 additions and 24 deletions
|
|
@ -1,10 +1,24 @@
|
|||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { useContext } from "react";
|
||||
|
||||
import { ThemeContext } from "@contexts";
|
||||
import { ThemeIcon } from "./icons";
|
||||
|
||||
import styles from "./Header.module.css";
|
||||
|
||||
const Header = () => {
|
||||
const { darkTheme, setDarkTheme } = useContext(ThemeContext);
|
||||
|
||||
const toggleTheme = () => {
|
||||
if (darkTheme) {
|
||||
setDarkTheme(false);
|
||||
} else {
|
||||
setDarkTheme(true);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles.header}>
|
||||
<div>
|
||||
|
|
@ -31,6 +45,9 @@ const Header = () => {
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<button className={styles.button} onClick={toggleTheme}>
|
||||
<ThemeIcon darkTheme={darkTheme} />
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue