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..bf3018e --- /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;