From d38061adb45509e21eabc29f01e8a7cf021a71fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=84=EC=9A=B0?= Date: Mon, 11 Dec 2023 21:56:08 +0900 Subject: [PATCH] =?UTF-8?q?feat(form)=20:=20form=20layout=20=EA=B5=AC?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs:[#4,#5] --- component/Funnel/LoginFunnel.tsx | 8 +- component/Funnel/MainFunnel.tsx | 5 +- component/button/MainButton.tsx | 3 +- component/form/UserAgreementForm.tsx | 11 +-- component/form/UserInfoForm.tsx | 126 +++++++++++++-------------- component/form/UserPhysicForm.tsx | 43 ++++++--- src/app/page.tsx | 5 +- src/app/signup/page.tsx | 16 ++-- 8 files changed, 121 insertions(+), 96 deletions(-) diff --git a/component/Funnel/LoginFunnel.tsx b/component/Funnel/LoginFunnel.tsx index cfa4d77..e23a926 100644 --- a/component/Funnel/LoginFunnel.tsx +++ b/component/Funnel/LoginFunnel.tsx @@ -16,13 +16,13 @@ const LoginFunnel = () => { /> {}}> diff --git a/component/Funnel/MainFunnel.tsx b/component/Funnel/MainFunnel.tsx index d1b92eb..cd97bc5 100644 --- a/component/Funnel/MainFunnel.tsx +++ b/component/Funnel/MainFunnel.tsx @@ -10,8 +10,6 @@ interface MainFunnelPropsType { } const MainFunnel = ({ setFunnel }: MainFunnelPropsType) => { - const router = useRouter(); - return ( <> { { +const MainButton = ({ children, w, h, onClick, alignSelf }: ButtonProps) => { return ( diff --git a/component/form/UserAgreementForm.tsx b/component/form/UserAgreementForm.tsx index cd3ddeb..f83c8ea 100644 --- a/component/form/UserAgreementForm.tsx +++ b/component/form/UserAgreementForm.tsx @@ -19,8 +19,8 @@ const UserAgreementForm = ({ setFunnel }: UserAgreementFormPropsType) => { const isIndeterminate = checkedItems.some(Boolean) && !allChecked; return ( - - + <> + { 동의하고 시작하기 - + ); }; diff --git a/component/form/UserInfoForm.tsx b/component/form/UserInfoForm.tsx index d2c50df..74dd30b 100644 --- a/component/form/UserInfoForm.tsx +++ b/component/form/UserInfoForm.tsx @@ -1,7 +1,7 @@ "use client"; -import { useForm } from "react-hook-form"; import { Box, + Button, ButtonGroup, Flex, FormControl, @@ -12,7 +12,6 @@ import { useRadio, useRadioGroup, } from "@chakra-ui/react"; -import { useParams } from "next/navigation"; import MainInput from "../input/MainInput"; import MainButton from "../button/MainButton"; @@ -28,11 +27,11 @@ function RadioCard(props: any) { { return ( <> - - - - 반가워요! - - - 기본정보를 입력해주세요 - - - - - - 이름 - - - - - - 성별 - - - {options.map((value) => { - const radio = getRadioProps({ value }); - return ( - - {value} - - ); - })} - - - - + - { - setFunnel("userPhysics"); - setProgress((oldState) => oldState + 33.3); - }} - > - 다음으로 - - - + 기본정보를 입력해주세요 + + + 성별에 맞는 대사량기준으로 알려드려요 + + + + + + 이름 + + + + + + 성별 + + + {options.map((value) => { + const radio = getRadioProps({ value }); + return ( + + {value} + + ); + })} + + + + + { + setFunnel("userPhysics"); + setProgress((oldState) => oldState + 33.3); + }} + > + 다음으로 + + ); }; diff --git a/component/form/UserPhysicForm.tsx b/component/form/UserPhysicForm.tsx index cd3a6e5..8ea3514 100644 --- a/component/form/UserPhysicForm.tsx +++ b/component/form/UserPhysicForm.tsx @@ -3,7 +3,6 @@ import MainButton from "../button/MainButton"; import { Box, ButtonGroup, - Flex, FormControl, FormLabel, HStack, @@ -25,11 +24,8 @@ const UserPhysicForm = ({ setProgress, }: UserPhysicsFormPropsType) => { return ( - - - - 거의 다 왔어요! - + <> + 신체정보를 입력해주세요 + + 개인 맞춤으로 알려드려요 + - - + + 나이 @@ -55,7 +60,7 @@ const UserPhysicForm = ({ - + @@ -66,7 +71,7 @@ const UserPhysicForm = ({ - + 체중 @@ -77,12 +82,24 @@ const UserPhysicForm = ({ + + + 목표 체중 + + + + + kg + + + - + ); }; diff --git a/src/app/page.tsx b/src/app/page.tsx index dcd5c3a..d45a21c 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -10,8 +10,11 @@ export default function Home() { { isAnimated={true} value={progress} /> - {funnel === "userInfo" && ( @@ -34,7 +38,7 @@ const Page = () => { {funnel === "userAgreement" && ( )} - + ); };