0
0
mirror of https://github.com/yude-jp/yude.jp synced 2024-12-23 04:30:11 +09:00

Compare commits

..

6 Commits

Author SHA1 Message Date
d1f0180c13
Remove console logging 2021-05-22 10:28:32 +09:00
3f205d95f5
Cleanup old code 2021-05-22 10:25:10 +09:00
5e068b05ca
Switch button text by theme condition 2021-05-22 10:23:46 +09:00
efaf3180f6
Revert "Using "tailwind-darkmode-toggle" instead of "next-themes""
This reverts commit 37e1a5fca7.
2021-05-22 10:12:17 +09:00
ca2886afd0
Fix typo 2021-05-22 10:08:39 +09:00
37e1a5fca7
Using "tailwind-darkmode-toggle" instead of "next-themes" 2021-05-22 10:07:04 +09:00
2 changed files with 12 additions and 6 deletions

View File

@ -13,17 +13,23 @@ const Layout = (props) => {
const { locale, locales, defaultLocale, pathname } = router const { locale, locales, defaultLocale, pathname } = router
const [isMounted, setIsMounted] = useState(false); const [isMounted, setIsMounted] = useState(false);
const { theme, setTheme } = useTheme(); const { theme, setTheme, getTheme } = useTheme();
useEffect(() => { useEffect(() => {
setIsMounted(true); setIsMounted(true);
}, []); }, []);
const switchTheme = () => { const switchTheme = () => {
if (isMounted) { if (isMounted) {
setTheme(theme === "light" ? "dark" : "light"); setTheme(theme === "light" ? "dark" : "light");
} }
}; };
return ( return (
<button className="my-4 mx-3 text-2xl" onClick={switchTheme}>🌙</button> <button className="my-4 mx-3 text-2xl" onClick={switchTheme}>
{theme === 'light' ? (
<span>🌙</span>
) : (
<span>🌄</span>
)}
</button>
) )
} }
export default Layout export default Layout

View File

@ -40,7 +40,7 @@ export default function About(props) {
<div className="flex-1"><p className="font-bold">OS </p>Arch Linux</div> <div className="flex-1"><p className="font-bold">OS </p>Arch Linux</div>
<div className="flex-1"><p className="font-bold">{location} </p>{hiroshima}</div> <div className="flex-1"><p className="font-bold">{location} </p>{hiroshima}</div>
</div> </div>
<iframe src="https://mackerel.io/embed/public/embed/heHnGhDanoIDlf7jjxUe9yPVrsG3deeH5ptD8suErrq5w46crWEIYdLfzLoukzfF?period=24h" height="400" className="w-2/3" frameborder="0"></iframe> <iframe src="https://mackerel.io/embed/public/embed/heHnGhDanoIDlf7jjxUe9yPVrsG3deeH5ptD8suErrq5w46crWEIYdLfzLoukzfF?period=24h" height="400" className="w-2/3" frameBorder="0"></iframe>
{ {
// raspberry Datadog // raspberry Datadog
@ -52,7 +52,7 @@ export default function About(props) {
<div className="flex-1"><p className="font-bold">OS </p>Raspbian GNU/Linux 10 (buster)</div> <div className="flex-1"><p className="font-bold">OS </p>Raspbian GNU/Linux 10 (buster)</div>
<div className="flex-1"><p className="font-bold">{location} </p>{tottori}</div> <div className="flex-1"><p className="font-bold">{location} </p>{tottori}</div>
</div> </div>
<iframe src="https://mackerel.io/embed/public/embed/5HVbQiwuxrMithyrGjmmQCCOVgJ6Ptf94SDA2qWSTsh2rtz7pjePihYzaW5QEml4?period=24h" height="400" className="w-2/3" frameborder="0"></iframe> <iframe src="https://mackerel.io/embed/public/embed/5HVbQiwuxrMithyrGjmmQCCOVgJ6Ptf94SDA2qWSTsh2rtz7pjePihYzaW5QEml4?period=24h" height="400" className="w-2/3" frameBorder="0"></iframe>
</div> </div>