29 lines
593 B
TypeScript
29 lines
593 B
TypeScript
import Image from "next/image";
|
|
import styles from "styles/Title.module.sass";
|
|
import { useTheme } from 'next-themes'
|
|
function the(t) {
|
|
switch (t) {
|
|
case "light":
|
|
return "dark";
|
|
case "dark":
|
|
return "light";
|
|
}
|
|
}
|
|
|
|
const Title = () => {
|
|
const { resolvedTheme: theme, setTheme: set } = useTheme();
|
|
const logo_size = 150;
|
|
|
|
return (
|
|
<>
|
|
<Image onClick={() => set(the(theme))}
|
|
src={`/logos/${theme || "dark"}.svg`}
|
|
width={logo_size}
|
|
height={logo_size / 4}
|
|
className={styles.title}
|
|
/>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default Title;
|