Skip to content

Commit

Permalink
feat(agreement) : 약관동의 checkbox
Browse files Browse the repository at this point in the history
Refs:[#4,#5]
  • Loading branch information
최현우 committed Dec 11, 2023
1 parent 024bcf6 commit 93dda4f
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 5 deletions.
1 change: 1 addition & 0 deletions component/button/MainButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const MainButton = ({ children, w, h, onClick }: ButtonProps) => {
borderRadius={"12px"}
w={w}
h={h}
maxW={"390px"}
onClick={onClick}
>
{children}
Expand Down
88 changes: 85 additions & 3 deletions component/form/UserAgreementForm.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import { Box, ButtonGroup, Flex, Heading, RadioGroup } from "@chakra-ui/react";
import React from "react";
import {
Box,
ButtonGroup,
Checkbox,
Flex,
Heading,
VStack,
} from "@chakra-ui/react";
import React, { useState } from "react";
import MainButton from "../button/MainButton";

interface UserAgreementFormPropsType {
setFunnel: React.Dispatch<React.SetStateAction<string>>;
}

const UserAgreementForm = ({ setFunnel }: UserAgreementFormPropsType) => {
const [checkedItems, setCheckedItems] = useState([false, false, false]);
const allChecked = checkedItems.every(Boolean);
const isIndeterminate = checkedItems.some(Boolean) && !allChecked;

return (
<Flex flexDir={"column"} w={"90%"} margin={"0 auto"}>
<Box as="section">
Expand All @@ -15,13 +26,84 @@ const UserAgreementForm = ({ setFunnel }: UserAgreementFormPropsType) => {
color={"#000000"}
fontSize={"24px"}
fontWeight={"semibold"}
lineHeight={"35px"}
>
서비스를 이용하시려면
식선생을 이용하시려면
<br />
약관 동의가 필요해요.
</Heading>
</Box>

<VStack alignItems={"flex-start"} spacing={5} padding={"30px 0"}>
<Flex
w={"346px"}
h={"48px"}
border={"1px solid #BCBCBC"}
borderRadius={"12px"}
>
<Checkbox
isChecked={allChecked}
isIndeterminate={isIndeterminate}
margin={"auto 20px"}
color={"#BCBCBC"}
onChange={(e) =>
setCheckedItems([
e.target.checked,
e.target.checked,
e.target.checked,
])
}
>
모두 동의합니다.
</Checkbox>
</Flex>
<Checkbox
color={"#838383"}
isChecked={checkedItems[0]}
textDecor={"underline"}
margin={"auto 20px"}
onChange={(e) =>
setCheckedItems([
e.target.checked,
checkedItems[1],
checkedItems[2],
])
}
>
(필수) 서비스 이용 약관 동의
</Checkbox>
<Checkbox
color={"#838383"}
margin={"auto 20px"}
textDecor={"underline"}
isChecked={checkedItems[1]}
onChange={(e) =>
setCheckedItems([
checkedItems[0],
e.target.checked,
checkedItems[2],
])
}
>
(필수) 개인 정보 수집 및 이용 동의
</Checkbox>
<Checkbox
color={"#838383"}
textDecor={"underline"}
margin={"auto 20px"}
isChecked={checkedItems[2]}
onChange={(e) =>
setCheckedItems([
checkedItems[0],
checkedItems[1],
e.target.checked,
])
}
>
(필수) 만 14세 이상입니다
</Checkbox>
</VStack>

<ButtonGroup
width={"90%"}
pos={"fixed"}
Expand Down
10 changes: 8 additions & 2 deletions src/app/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ const Page = () => {
<Progress
bgColor={"#D9D9D9"}
// colorScheme="black"
size="sm"
size="xs"
isAnimated={true}
value={progress}
/>
<Box width={"100%"} h={"100%"}>
<Box
width={"100%"}
h={"100%"}
maxW={"390px"}
padding={"70px 0px"}
margin={"0 auto"}
>
{funnel === "userInfo" && (
<UserInfoForm setFunnel={setFunnel} setProgress={setProgress} />
)}
Expand Down

0 comments on commit 93dda4f

Please sign in to comment.