52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
"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>
|
|
<div style={{ display: "none" }}>{darkTheme?.toString()}</div>
|
|
<div className={styles.title}>
|
|
<Link href="/">
|
|
<div className={styles.showMobile}>{"ryanchristo"}</div>
|
|
<div className={styles.showDesktop}>{"ryan christoffersen"}</div>
|
|
</Link>
|
|
</div>
|
|
<div className={styles.menu}>
|
|
<ul>
|
|
<li>
|
|
<Link href="/artifacts">{"artifacts"}</Link>
|
|
</li>
|
|
<li>
|
|
<Link href="/feed" target="_blank">{"rss"}</Link>
|
|
</li>
|
|
<li>
|
|
<button className={styles.themeButton} onClick={toggleTheme}>
|
|
<ThemeIcon darkTheme={darkTheme} />
|
|
</button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Header;
|