Skip to content

Commit

Permalink
feat: 분야 선택 switch문 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
WithJo committed Sep 5, 2024
1 parent 724eafc commit dd0e773
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions src/pages/SelectPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<>
<SelectPageWrapper style={root === null ? { marginTop: "5vh" } : {}}>
Expand Down Expand Up @@ -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))}
>
<Text size="m">{value}</Text>
</Button>
Expand Down

0 comments on commit dd0e773

Please sign in to comment.