From dd0e773dd2363aa39900f3f638e8a3db704f3a97 Mon Sep 17 00:00:00 2001 From: WithJo Date: Thu, 5 Sep 2024 10:37:31 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=B6=84=EC=95=BC=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=20switch=EB=AC=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/SelectPage.tsx | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/pages/SelectPage.tsx b/src/pages/SelectPage.tsx index b93b59d..3638b52 100644 --- a/src/pages/SelectPage.tsx +++ b/src/pages/SelectPage.tsx @@ -44,6 +44,23 @@ export default function SelectPage() { } } + function chooseSection(value: string) { + switch (value) { + case "전시,공연,연극 분야": + return StageRoot; + case "사회,자원활동 분야": + return SocietyRoot; + case "종교 분야": + return ReligionRoot; + case "체육,민족무예 분야": + return BallGameRoot; + case "학술,취미교양 분야": + return DiscussionRoot; + default: + return null; + } + } + return ( <> @@ -72,19 +89,7 @@ export default function SelectPage() { width="80%" height="7vh" variants="select" - onClick={() => - setRoot( - value === "전시,공연,연극 분야" - ? StageRoot - : value === "사회,자원활동 분야" - ? SocietyRoot - : value === "종교 분야" - ? ReligionRoot - : value === "체육,민족무예 분야" - ? BallGameRoot - : DiscussionRoot, - ) - } + onClick={() => setRoot(chooseSection(value))} > {value}