forked from potenday-project/312TEN036-FE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
171 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
"use client"; | ||
|
||
import { Flex, Progress } from "@chakra-ui/react"; | ||
import { useState } from "react"; | ||
import { useFunnel } from "../../utils/hooks/useFunnel"; | ||
import UserAgreementForm from "../form/UserAgreementForm"; | ||
import UserInfoForm from "../form/UserInfoForm"; | ||
import UserPhysicForm from "../form/UserPhysicForm"; | ||
|
||
export interface UserInfoType { | ||
userName: string; | ||
gender: string; | ||
age: number; | ||
height: number; | ||
weight: number; | ||
targetWeight: number; | ||
} | ||
|
||
const SignupTemplate = () => { | ||
const [progress, setProgress] = useState<number>(33.3); | ||
const [userInfo, setUserInfo] = useState<UserInfoType>({ | ||
userName: "", | ||
gender: "", | ||
age: 0, | ||
height: 0, | ||
weight: 0, | ||
targetWeight: 0, | ||
}); | ||
const { funnel, setFunnel } = useFunnel("userAgreement"); | ||
|
||
return ( | ||
<> | ||
<Progress | ||
bgColor={"#D9D9D9"} | ||
// colorScheme="black" | ||
size="xs" | ||
isAnimated={true} | ||
value={progress} | ||
/> | ||
|
||
<Flex | ||
flexDir={"column"} | ||
w={"100%"} | ||
h={"100vh"} | ||
pos={"relative"} | ||
maxW={"390px"} | ||
padding={"60px 22px"} | ||
margin={"0 auto"} | ||
alignItems={"center"} | ||
> | ||
{funnel === "userAgreement" && ( | ||
<UserAgreementForm setFunnel={setFunnel} setProgress={setProgress} /> | ||
)} | ||
{funnel === "userInfo" && ( | ||
<UserInfoForm | ||
setFunnel={setFunnel} | ||
setProgress={setProgress} | ||
setUserInfo={setUserInfo} | ||
/> | ||
)} | ||
{funnel === "userPhysics" && <UserPhysicForm userInfo={userInfo} />} | ||
</Flex> | ||
</> | ||
); | ||
}; | ||
|
||
export default SignupTemplate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,21 @@ | ||
"use client"; | ||
import React, { useState } from "react"; | ||
import UserInfoForm from "../../../component/form/UserInfoForm"; | ||
import { Flex, Progress } from "@chakra-ui/react"; | ||
import { useFunnel } from "../../../utils/hooks/useFunnel"; | ||
import UserPhysicForm from "../../../component/form/UserPhysicForm"; | ||
import UserAgreementForm from "../../../component/form/UserAgreementForm"; | ||
import React from "react"; | ||
|
||
export interface UserInfoType { | ||
userName: string; | ||
gender: string; | ||
age: number; | ||
height: number; | ||
weight: number; | ||
targetWeight: number; | ||
} | ||
import { redirect } from "next/navigation"; | ||
import SignupTemplate from "../../../component/template/SignupTemplate"; | ||
import { postKakaoCode } from "../../../utils/api/AxiosSetting"; | ||
|
||
const Page = () => { | ||
const [progress, setProgress] = useState<number>(33.3); | ||
const [userInfo, setUserInfo] = useState<UserInfoType>({ | ||
userName: "", | ||
gender: "", | ||
age: 0, | ||
height: 0, | ||
weight: 0, | ||
targetWeight: 0, | ||
}); | ||
const { funnel, setFunnel } = useFunnel("userAgreement"); | ||
const Page = ({ | ||
searchParams, | ||
}: { | ||
searchParams: { code: string; error: string }; | ||
}) => { | ||
const kakaoCode = searchParams.code; | ||
|
||
return ( | ||
<> | ||
<Progress | ||
bgColor={"#D9D9D9"} | ||
// colorScheme="black" | ||
size="xs" | ||
isAnimated={true} | ||
value={progress} | ||
/> | ||
const errorCode = searchParams.error; | ||
postKakaoCode(kakaoCode); | ||
if (errorCode) return redirect("/"); | ||
|
||
<Flex | ||
flexDir={"column"} | ||
w={"100%"} | ||
h={"100vh"} | ||
pos={"relative"} | ||
maxW={"390px"} | ||
padding={"60px 22px"} | ||
margin={"0 auto"} | ||
alignItems={"center"} | ||
> | ||
{funnel === "userAgreement" && ( | ||
<UserAgreementForm setFunnel={setFunnel} setProgress={setProgress} /> | ||
)} | ||
{funnel === "userInfo" && ( | ||
<UserInfoForm | ||
setFunnel={setFunnel} | ||
setProgress={setProgress} | ||
setUserInfo={setUserInfo} | ||
/> | ||
)} | ||
{funnel === "userPhysics" && <UserPhysicForm userInfo={userInfo} />} | ||
</Flex> | ||
</> | ||
); | ||
return <SignupTemplate />; | ||
}; | ||
|
||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|