From 4cb54bddb055ef046479762641597022e36a3aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9B=90=EB=8D=94?= Date: Thu, 11 Feb 2021 20:58:00 +0900 Subject: [PATCH] feat: add darkmode button --- components/Footer.tsx | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/components/Footer.tsx b/components/Footer.tsx index 324e0e6..23c42a3 100644 --- a/components/Footer.tsx +++ b/components/Footer.tsx @@ -2,7 +2,12 @@ import Link from 'next/link' import Container from '@components/Container' import Wave from '@components/Wave' -const Footer = ({ color }:FooterProps): JSX.Element => { +import Toggle from './Toggle' +import { useState } from 'react' +import { Theme } from '@types' + +const Footer = ({ color, theme, setTheme }:FooterProps): JSX.Element => { + const [ checked, setCheck ] = useState(true) return (
-
-
+
+

한국 디스코드봇 리스트

  • @@ -41,7 +46,7 @@ const Footer = ({ color }:FooterProps): JSX.Element => {
-
+

커뮤니티

  • @@ -56,7 +61,7 @@ const Footer = ({ color }:FooterProps): JSX.Element => {
-
+

약관

  • @@ -71,6 +76,17 @@ const Footer = ({ color }:FooterProps): JSX.Element => {
+
+

기타

+
+ 다크모드 + { + setCheck(!checked) + setTheme(checked ? 'dark' : 'light') + localStorage.setItem('theme', checked ? 'dark' : 'light') + }} /> +
+
@@ -81,6 +97,8 @@ const Footer = ({ color }:FooterProps): JSX.Element => { interface FooterProps { color?: string + theme: Theme + setTheme(value: Theme): void } export default Footer