From e53ee9292105b3e61c71694107ecdb0ae3cfd9c5 Mon Sep 17 00:00:00 2001 From: hyuna Date: Fri, 5 Jul 2024 11:09:56 +0900 Subject: [PATCH 1/2] =?UTF-8?q?add=20:=20=EC=84=A4=EB=AC=B8=EC=A1=B0?= =?UTF-8?q?=EC=82=AC=20=ED=8C=9D=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/main/page.tsx | 16 +++++++++ src/components/survey/index.tsx | 60 +++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 src/components/survey/index.tsx diff --git a/src/app/main/page.tsx b/src/app/main/page.tsx index 623d7b3..2b59bd5 100644 --- a/src/app/main/page.tsx +++ b/src/app/main/page.tsx @@ -10,9 +10,11 @@ import attendanceImg from "@/assets/svg/attendance.svg"; import outingImg from "@/assets/svg/outing.svg"; import moveClassImg from "@/assets/svg/moveClass.svg"; import BugImg from "@/assets/svg/bug.svg"; +import Survey from "@/components/survey"; const Main = () => { const [floor, setFloor] = useState(); + const [surveyModal, setSurveyModal] = useState(false); const { data: getDirector } = GetTodaydirector(); GetName(); @@ -20,6 +22,13 @@ const Main = () => { if (getDirector) setFloor(getDirector); }, [getDirector]); + useEffect(() => { + const check = localStorage.getItem("survey"); + if (check !== "OK") { + setSurveyModal(true); + } + }, []); + return ( <>
@@ -41,6 +50,13 @@ const Main = () => { + {surveyModal && ( + { + setSurveyModal(false); + }} + /> + )} ); diff --git a/src/components/survey/index.tsx b/src/components/survey/index.tsx new file mode 100644 index 0000000..b0a6bb7 --- /dev/null +++ b/src/components/survey/index.tsx @@ -0,0 +1,60 @@ +import { useState } from "react"; + +interface SurveyProp { + onClick: () => void; +} + +const Survey = ({ onClick }: SurveyProp) => { + const [isChecked, setIsChecked] = useState(false); + + const handleCheckboxChange = () => { + setIsChecked(!isChecked); + if (!isChecked) { + localStorage.setItem("survey", "OK"); + } else { + localStorage.removeItem("survey"); + } + }; + return ( +
+
+
+
+ 픽 만족도 조사하기 +
+
+ 좀 더 좋은 PiCK으로 업데이트를 위해 만족도 조사를 하려고 합니다. +
+ 많은 참여 부탁드립니다 +
+
+ + 만족도 조사하기 + +
+
+ + +
+
+ 닫기 +
+
+
+
+ ); +}; + +export default Survey; From c5adc823b78bcdafa78856a965760691b168fb79 Mon Sep 17 00:00:00 2001 From: hyuna Date: Fri, 5 Jul 2024 11:17:21 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore=20:=20=EB=94=94=EC=9E=90=EC=9D=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/survey/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/survey/index.tsx b/src/components/survey/index.tsx index b0a6bb7..bf3018e 100644 --- a/src/components/survey/index.tsx +++ b/src/components/survey/index.tsx @@ -44,7 +44,7 @@ const Survey = ({ onClick }: SurveyProp) => { checked={isChecked} onChange={handleCheckboxChange} /> -