Run prettier through everything.
This commit is contained in:
@@ -1,34 +1,34 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { useTheme } from "next-themes";
|
||||
import { Sun, Moon } from "phosphor-react";
|
||||
import { useState, useEffect } from 'react'
|
||||
import { useTheme } from 'next-themes'
|
||||
import { Sun, Moon } from 'phosphor-react'
|
||||
|
||||
import Button from "./Button";
|
||||
import Button from './Button'
|
||||
|
||||
const ThemeChanger = () => {
|
||||
const { theme, setTheme } = useTheme();
|
||||
const [mounted, setMounted] = useState(false);
|
||||
useEffect(() => setMounted(true), []);
|
||||
const { theme, setTheme } = useTheme()
|
||||
const [mounted, setMounted] = useState(false)
|
||||
useEffect(() => setMounted(true), [])
|
||||
|
||||
if (!mounted) return null;
|
||||
if (!mounted) return null
|
||||
|
||||
return (
|
||||
<Button
|
||||
outline
|
||||
onClick={() => {
|
||||
setTheme(theme && theme === "light" ? "dark" : "light");
|
||||
setTheme(theme && theme === 'light' ? 'dark' : 'light')
|
||||
}}
|
||||
css={{
|
||||
display: "flex",
|
||||
marginLeft: "auto",
|
||||
cursor: "pointer",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
color: "$muted",
|
||||
display: 'flex',
|
||||
marginLeft: 'auto',
|
||||
cursor: 'pointer',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
color: '$muted'
|
||||
}}
|
||||
>
|
||||
{theme === "dark" ? <Sun size="15px" /> : <Moon size="15px" />}
|
||||
{theme === 'dark' ? <Sun size="15px" /> : <Moon size="15px" />}
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
)
|
||||
}
|
||||
|
||||
export default ThemeChanger;
|
||||
export default ThemeChanger
|
||||
|
||||
Reference in New Issue
Block a user