diff --git a/src/apis/auth/checkSignUp.ts b/src/apis/auth/checkSignUp.ts index cf900a5..7a97547 100644 --- a/src/apis/auth/checkSignUp.ts +++ b/src/apis/auth/checkSignUp.ts @@ -7,14 +7,19 @@ export async function checkSignUp(request: NextRequest) { const url = request.nextUrl.clone(); if (user.name && user.schoolType) { - url.pathname = "/"; - return NextResponse.redirect(url); + return NextResponse.next(); } else if (user.name) { - if (url.pathname !== "/auth/organization") { + if ( + url.pathname !== "/auth/organization" && + url.pathname !== "/auth/default" + ) { url.pathname = "/auth/organization"; return NextResponse.redirect(url); } else return NextResponse.next(); } else { - return NextResponse.next(); + if (url.pathname !== "/auth/default") { + url.pathname = "/auth/default"; + return NextResponse.redirect(url); + } else return NextResponse.next(); } } diff --git a/src/apis/school/index.ts b/src/apis/school/index.ts new file mode 100644 index 0000000..ffbfae4 --- /dev/null +++ b/src/apis/school/index.ts @@ -0,0 +1,54 @@ +import axios from "axios"; + +const schoolAPI = { + async getSchoolName(word: string) { + const response = await axios.get( + "https://open.neis.go.kr/hub/schoolInfo", + { + params: { + KEY: process.env.NEXT_PUBLIC_SCHOOL_API_KEY, + Type: "json", + pIndex: 1, + pSize: 20, + SCHUL_NM: word + } + } + ); + return response.data; + }, + async getUnivName(word: string) { + const response = await axios.get( + "https://www.career.go.kr/cnet/openapi/getOpenApi", + { + params: { + apiKey: process.env.NEXT_PUBLIC_UNIV_API_KEY, + svcType: "api", + svcCode: "SCHOOL", + contentType: "json", + gubun: "univ_list", + searchSchulNm: word + } + } + ); + return response.data; + }, + async getMajorName(word: string) { + const response = await axios.get( + "https://www.career.go.kr/cnet/openapi/getOpenApi", + { + params: { + apiKey: process.env.NEXT_PUBLIC_UNIV_API_KEY, + svcType: "api", + svcCode: "MAJOR", + contentType: "json", + gubun: "univ_list", + univSe: "univ", + searchTitle: word + } + } + ); + return response.data; + } +}; + +export default schoolAPI; diff --git a/src/components/Icon/icons/images/CheckImage.tsx b/src/components/Icon/icons/images/CheckImage.tsx new file mode 100644 index 0000000..ced93af --- /dev/null +++ b/src/components/Icon/icons/images/CheckImage.tsx @@ -0,0 +1,27 @@ +const CheckImage = () => { + return ( + + + + + ); +}; + +export default CheckImage; diff --git a/src/components/Icon/icons/index.ts b/src/components/Icon/icons/index.ts index acfa96a..5ef45b3 100644 --- a/src/components/Icon/icons/index.ts +++ b/src/components/Icon/icons/index.ts @@ -31,6 +31,7 @@ export { default as QFeedImage } from "./images/QFeedImage"; export { default as QFeedImage2 } from "./images/QFeedImage2"; export { default as WaveImage } from "./images/WaveImage"; export { default as FriendImage } from "./images/FriendImage"; +export { default as CheckImage } from "./images/CheckImage"; // bottom navigation export { default as BHome } from "./bottomNavigation/Home"; diff --git a/src/components/inputs/input-fill.tsx b/src/components/inputs/input-fill.tsx index 59101a9..e2636c4 100644 --- a/src/components/inputs/input-fill.tsx +++ b/src/components/inputs/input-fill.tsx @@ -44,7 +44,7 @@ const Input = styled.input` width: 80vw; color: ${colors.light_qwhite}; - transform: scale(0.75); + transform: scale(0.85); transform-origin: left; `; diff --git a/src/components/inputs/input-line.tsx b/src/components/inputs/input-line.tsx index 2c34cb1..47efa0c 100644 --- a/src/components/inputs/input-line.tsx +++ b/src/components/inputs/input-line.tsx @@ -43,7 +43,7 @@ const InputLine = ({ ...props }: InputProps) => { const InputWrapper = styled.div` width: 100%; - padding: 1rem 0; + padding: 1rem 0 0.5rem; margin-bottom: 0.5rem; display: flex; @@ -57,7 +57,7 @@ const Input = styled.input` width: 80vw; color: ${colors.light_qwhite}; - transform: scale(0.75); + transform: scale(0.85); transform-origin: left; `; diff --git a/src/components/selectbox/Options.tsx b/src/components/selectbox/Options.tsx new file mode 100644 index 0000000..1058672 --- /dev/null +++ b/src/components/selectbox/Options.tsx @@ -0,0 +1,56 @@ +"use client"; + +import styled from "styled-components"; +import { useState } from "react"; +import Flex from "../common/Flex"; +import Text from "../common/Text"; +import { colors } from "styles/theme"; +import { motion } from "framer-motion"; +import { dropdown } from "src/constants/animation"; + +export interface OptionProps { + options: any; + value?: string; + setState?: any; + defaultValue?: string; +} + +const Option = (props: OptionProps) => { + const [open, setOpen] = useState(true); + return ( + + + {props.options.map((option: any) => ( + { + props.setState(option.name); + setOpen(!open); + }} + > + {option.name} + + ))} + + + ); +}; + +const Options = styled(motion.ul)` + width: 100%; + max-height: 212px; + border-radius: 0 0 10px 10px; + overflow: scroll; +`; + +const OptionItem = styled.li` + width: 100%; + padding: 1rem; + background: ${colors.light_gray3}; +`; + +export default Option; diff --git a/src/components/sign-up/elementary-school.tsx b/src/components/sign-up/elementary-school.tsx deleted file mode 100644 index 9628afa..0000000 --- a/src/components/sign-up/elementary-school.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { useRouter } from "next/navigation"; -import { useInput } from "src/hooks/common/useInput"; - -import InputLine from "../inputs/input-line"; -import ButtonFillLarge from "../buttons/button-fill-large"; -import { Route } from "src/constants/Route"; - -import { useUserMutation } from "src/hooks/account/useUserMutation"; -import { useAppSelector } from "src/hooks/useReduxHooks"; - -const ElementarySchool = () => { - const router = useRouter(); - const school = useInput(); - const selected = useAppSelector((state) => state.organization.selected); - - const { userMutation } = useUserMutation(); - - const handleClickNext = () => { - userMutation.mutate({ - schoolType: selected, - schoolName: school.value - }); - router.push(Route.COMPLETE); - }; - - return ( - <> - - - - ); -}; - -export default ElementarySchool; diff --git a/src/components/sign-up/middle-high-school.tsx b/src/components/sign-up/middle-high-school.tsx deleted file mode 100644 index 8a64a1b..0000000 --- a/src/components/sign-up/middle-high-school.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { useRouter } from "next/navigation"; -import { useInput } from "src/hooks/common/useInput"; -import { useAppSelector } from "src/hooks/useReduxHooks"; -import { useUserMutation } from "src/hooks/account/useUserMutation"; - -import InputLine from "../inputs/input-line"; -import ButtonFillLarge from "../buttons/button-fill-large"; - -import { Route } from "src/constants/Route"; - -const MidHighSchool = () => { - const router = useRouter(); - const school = useInput(); - const selected = useAppSelector((state) => state.organization.selected); - - const { userMutation } = useUserMutation(); - - const handleClickNext = () => { - userMutation.mutate({ - schoolType: selected, - schoolName: school.value - }); - router.push(selected === "졸업생" ? Route.COMPLETE : Route.MIDHIGH); - }; - - return ( - <> - - - - ); -}; - -export default MidHighSchool; diff --git a/src/components/sign-up/university.tsx b/src/components/sign-up/university.tsx deleted file mode 100644 index c1530d1..0000000 --- a/src/components/sign-up/university.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import { useRouter } from "next/navigation"; -import { useInput } from "src/hooks/common/useInput"; -import { useSelect } from "src/hooks/common/useSelect"; -import { useAppSelector } from "src/hooks/useReduxHooks"; -import { useUserMutation } from "src/hooks/account/useUserMutation"; - -import InputLine from "../inputs/input-line"; -import SelectBox from "../selectbox/selectbox"; -import ButtonFillLarge from "../buttons/button-fill-large"; - -import { SCHOOL_YEAR_OPTIONS } from "src/constants/options"; -import { Route } from "src/constants/Route"; - -const University = () => { - const router = useRouter(); - const school = useInput(); - const department = useInput(); - const grade = useSelect("23학번"); - const selected = useAppSelector((state) => state.organization.selected); - - const { userMutation } = useUserMutation(); - - const handleClickNext = () => { - userMutation.mutate({ - schoolType: selected, - schoolName: school.value, - class: department.value, - grade: grade.value - }); - router.push(selected === "졸업생" ? Route.COMPLETE : Route.UNIVERSITY); - }; - - return ( - <> - - - - - - ); -}; - -export default University; diff --git a/src/hooks/common/useInput.ts b/src/hooks/common/useInput.ts index ea32e34..0f4509f 100644 --- a/src/hooks/common/useInput.ts +++ b/src/hooks/common/useInput.ts @@ -16,5 +16,5 @@ export const useInput = (initialState?: string) => { setValue(event.target.value); } }; - return { value, handleChangeInput, reset }; + return { value, handleChangeInput, setValue, reset }; }; diff --git a/src/hooks/school/useGetMajorQuery.ts b/src/hooks/school/useGetMajorQuery.ts new file mode 100644 index 0000000..00bd898 --- /dev/null +++ b/src/hooks/school/useGetMajorQuery.ts @@ -0,0 +1,31 @@ +import { useInfiniteQuery, useQuery } from "@tanstack/react-query"; +import schoolAPI from "src/apis/school"; + +const useGetMajorQuery = (word: string) => { + // const { data, fetchNextPage, hasNextPage, isFetched } = useInfiniteQuery( + // ["school"], + // ({ pageParam = 0 }) => getUserQuestions(id, qtype, pageParam, 10), + // { + // getNextPageParam: (lastPage) => { + // return lastPage.data.count > lastPage.idx + 10 + // ? lastPage.idx + 10 + // : undefined; + // } + // } + // ); + + // return { data, fetchNextPage, hasNextPage, isFetched }; + const { data, isLoading, refetch } = useQuery( + ["major"], + () => schoolAPI.getMajorName(word), + { + onError: (error: any) => { + alert(error); + } + } + ); + + return { data, isLoading, refetch }; +}; + +export default useGetMajorQuery; diff --git a/src/hooks/school/useGetSchoolQuery.ts b/src/hooks/school/useGetSchoolQuery.ts new file mode 100644 index 0000000..b96474c --- /dev/null +++ b/src/hooks/school/useGetSchoolQuery.ts @@ -0,0 +1,31 @@ +import { useInfiniteQuery, useQuery } from "@tanstack/react-query"; +import schoolAPI from "src/apis/school"; + +const useGetSchoolQuery = (word: string) => { + // const { data, fetchNextPage, hasNextPage, isFetched } = useInfiniteQuery( + // ["school"], + // ({ pageParam = 0 }) => getUserQuestions(id, qtype, pageParam, 10), + // { + // getNextPageParam: (lastPage) => { + // return lastPage.data.count > lastPage.idx + 10 + // ? lastPage.idx + 10 + // : undefined; + // } + // } + // ); + + // return { data, fetchNextPage, hasNextPage, isFetched }; + const { data, isLoading, refetch } = useQuery( + ["school"], + () => schoolAPI.getSchoolName(word), + { + onError: (error: any) => { + alert(error); + } + } + ); + + return { data, isLoading, refetch }; +}; + +export default useGetSchoolQuery; diff --git a/src/hooks/school/useGetUnivQuery.ts b/src/hooks/school/useGetUnivQuery.ts new file mode 100644 index 0000000..59378ea --- /dev/null +++ b/src/hooks/school/useGetUnivQuery.ts @@ -0,0 +1,31 @@ +import { useInfiniteQuery, useQuery } from "@tanstack/react-query"; +import schoolAPI from "src/apis/school"; + +const useGetUnivQuery = (word: string) => { + // const { data, fetchNextPage, hasNextPage, isFetched } = useInfiniteQuery( + // ["school"], + // ({ pageParam = 0 }) => getUserQuestions(id, qtype, pageParam, 10), + // { + // getNextPageParam: (lastPage) => { + // return lastPage.data.count > lastPage.idx + 10 + // ? lastPage.idx + 10 + // : undefined; + // } + // } + // ); + + // return { data, fetchNextPage, hasNextPage, isFetched }; + const { data, isLoading, refetch } = useQuery( + ["univ"], + () => schoolAPI.getUnivName(word), + { + onError: (error: any) => { + alert(error); + } + } + ); + + return { data, isLoading, refetch }; +}; + +export default useGetUnivQuery; diff --git a/src/middleware.ts b/src/middleware.ts index 4bb8f38..ad01756 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -11,10 +11,10 @@ export async function middleware(request: NextRequest) { const requestHeaders = new Headers(request.headers); requestHeaders.set("Authorization", `Bearer ${token}`); - if (pathname.match("/(auth.*)")) { - return await checkSignUp(request); - } else if (pathname.match("/((?!account|auth).*)")) { + if (pathname.match("/((?!account|auth).*)")) { return await checkSignIn(request); + } else if (pathname.match("/((?!account).*)")) { + return await checkSignUp(request); } return NextResponse.next(); diff --git a/src/pages-edit/sign-up/complete.tsx b/src/pages-edit/sign-up/complete.tsx index ad7b08a..70a7468 100644 --- a/src/pages-edit/sign-up/complete.tsx +++ b/src/pages-edit/sign-up/complete.tsx @@ -1,4 +1,5 @@ "use client"; +import styled from "styled-components"; import { useRouter } from "next/navigation"; import ButtonFillLarge from "src/components/buttons/button-fill-large"; import NavigationTop from "src/components/navigations/NavigationTopBack"; @@ -6,18 +7,17 @@ import NavigationTop from "src/components/navigations/NavigationTopBack"; import Text from "src/components/common/Text"; import Flex from "src/components/common/Flex"; import Icon from "src/components/Icon/Icon"; +import { useUserQuery } from "src/hooks/account/useUserQuery"; +import Loading from "src/components/common/Loading"; const Complete = () => { const router = useRouter(); + const user = useUserQuery(); - return ( - + return user.isLoading ? ( + + ) : ( + } title="회원 가입" @@ -28,11 +28,22 @@ const Complete = () => { justify="space-between" align="start" > - - 채린님의 회원가입이 - 완료되었습니다. - 나만의 큐피드를 만들어보세요! - + + + + + {user.user?.name}님의 회원가입이 + + 완료되었습니다. + + 나만의 큐피드를 만들어보세요! + + + { ); }; +const ContentWrapper = styled(Flex)` + padding-top: 66px; +`; + export default Complete; diff --git a/src/components/sign-up/button-gender-select.tsx b/src/pages-edit/sign-up/components/button-gender-select.tsx similarity index 94% rename from src/components/sign-up/button-gender-select.tsx rename to src/pages-edit/sign-up/components/button-gender-select.tsx index cf1bde9..ef49e4a 100644 --- a/src/components/sign-up/button-gender-select.tsx +++ b/src/pages-edit/sign-up/components/button-gender-select.tsx @@ -1,8 +1,8 @@ "use client"; import styled from "styled-components"; -import Text from "../common/Text"; -import Flex from "../common/Flex"; +import Text from "../../../components/common/Text"; +import Flex from "../../../components/common/Flex"; import { colors, theme } from "styles/theme"; export type ButtonState = "active" | "disabled"; diff --git a/src/pages-edit/sign-up/components/elementary-school.tsx b/src/pages-edit/sign-up/components/elementary-school.tsx new file mode 100644 index 0000000..089f688 --- /dev/null +++ b/src/pages-edit/sign-up/components/elementary-school.tsx @@ -0,0 +1,80 @@ +import { useRouter } from "next/navigation"; +import { useEffect, useState, useCallback } from "react"; +import { useInput } from "src/hooks/common/useInput"; + +import InputLine from "src/components/inputs/input-line"; +import ButtonFillLarge from "src/components/buttons/button-fill-large"; +import Option from "src/components/selectbox/Options"; +import Flex from "src/components/common/Flex"; + +import { useUserMutation } from "src/hooks/account/useUserMutation"; +import { useAppSelector } from "src/hooks/useReduxHooks"; +import useGetSchoolQuery from "src/hooks/school/useGetSchoolQuery"; + +import { Route } from "src/constants/Route"; + +const ElementarySchool = () => { + const router = useRouter(); + const school = useInput(); + const filteredSchool = useGetSchoolQuery(school.value); + const selected = useAppSelector((state) => state.organization.selected); + + const { userMutation } = useUserMutation(); + + useEffect(() => { + filteredSchool.refetch(); + }, [school.value]); + + const searchSchool = useCallback(() => { + const filteredSchoolInfo = + filteredSchool.data?.schoolInfo && school.value + ? filteredSchool.data?.schoolInfo[1].row + .filter( + (schoolInfo: any) => + schoolInfo.SCHUL_KND_SC_NM === "초등학교" + ) + .map((schoolInfo: any) => { + return { + name: schoolInfo.SCHUL_NM, + value: schoolInfo.SD_SCHUL_CODE + }; + }) + : null; + + return filteredSchoolInfo; + }, [filteredSchool]); + + const handleClickNext = () => { + userMutation.mutate({ + schoolType: selected, + schoolName: school.value + }); + router.push(Route.COMPLETE); + }; + + return ( + <> + + + {filteredSchool.data?.schoolInfo && searchSchool() && ( + + + + ); +}; + +export default ElementarySchool; diff --git a/src/components/sign-up/graduate.tsx b/src/pages-edit/sign-up/components/graduate.tsx similarity index 71% rename from src/components/sign-up/graduate.tsx rename to src/pages-edit/sign-up/components/graduate.tsx index c92ca28..0298c81 100644 --- a/src/components/sign-up/graduate.tsx +++ b/src/pages-edit/sign-up/components/graduate.tsx @@ -1,4 +1,4 @@ -import SelectBox from "../selectbox/selectbox"; +import SelectBox from "src/components/selectbox/selectbox"; import { GRADUATE_OPTIONS } from "src/constants/options"; import University from "./university"; import MidHighSchool from "./middle-high-school"; @@ -14,7 +14,11 @@ const Graduate = () => { options={GRADUATE_OPTIONS} value={selected} /> - {selected === "대학교" ? : } + {selected === "대학교" ? ( + + ) : ( + + )} ); }; diff --git a/src/pages-edit/sign-up/components/middle-high-school.tsx b/src/pages-edit/sign-up/components/middle-high-school.tsx new file mode 100644 index 0000000..4945df2 --- /dev/null +++ b/src/pages-edit/sign-up/components/middle-high-school.tsx @@ -0,0 +1,84 @@ +"use client"; + +import { useRouter } from "next/navigation"; +import { useEffect, useState, useCallback } from "react"; +import { useInput } from "src/hooks/common/useInput"; +import { useAppSelector } from "src/hooks/useReduxHooks"; +import { useUserMutation } from "src/hooks/account/useUserMutation"; +import useGetSchoolQuery from "src/hooks/school/useGetSchoolQuery"; + +import InputLine from "src/components/inputs/input-line"; +import ButtonFillLarge from "src/components/buttons/button-fill-large"; +import Option from "src/components/selectbox/Options"; +import Flex from "src/components/common/Flex"; + +import { Route } from "src/constants/Route"; + +const MidHighSchool = ({ isGraduate = false }: { isGraduate?: boolean }) => { + const router = useRouter(); + const school = useInput(); + const filteredSchool = useGetSchoolQuery(school.value); + const selected = useAppSelector((state) => state.organization.selected); + const { userMutation } = useUserMutation(); + + useEffect(() => { + filteredSchool.refetch(); + }, [school.value]); + + const searchSchool = useCallback(() => { + const filteredSchoolInfo = + filteredSchool.data?.schoolInfo && school.value + ? filteredSchool.data?.schoolInfo[1].row + .filter( + (schoolInfo: any) => + (isGraduate && + schoolInfo.SCHUL_KND_SC_NM === "초등학교") || + schoolInfo.SCHUL_KND_SC_NM === "고등학교" || + schoolInfo.SCHUL_KND_SC_NM === "중학교" + ) + .map((schoolInfo: any) => { + return { + name: schoolInfo.SCHUL_NM, + value: schoolInfo.SD_SCHUL_CODE + }; + }) + : null; + + return filteredSchoolInfo; + }, [filteredSchool]); + + const handleClickNext = () => { + userMutation.mutate({ + schoolType: selected, + schoolName: school.value + }); + // router.push(selected === "졸업생" ? Route.COMPLETE : Route.MIDHIGH); + router.push(Route.COMPLETE); + }; + + return ( + <> + + + {filteredSchool.data?.schoolInfo && searchSchool() && ( + + + + ); +}; + +export default MidHighSchool; diff --git a/src/pages-edit/sign-up/components/university.tsx b/src/pages-edit/sign-up/components/university.tsx new file mode 100644 index 0000000..efe6a40 --- /dev/null +++ b/src/pages-edit/sign-up/components/university.tsx @@ -0,0 +1,133 @@ +import { useEffect, useCallback } from "react"; +import { useRouter } from "next/navigation"; +import { useInput } from "src/hooks/common/useInput"; +import { useSelect } from "src/hooks/common/useSelect"; +import { useAppSelector } from "src/hooks/useReduxHooks"; +import { useUserMutation } from "src/hooks/account/useUserMutation"; +import useGetUnivQuery from "src/hooks/school/useGetUnivQuery"; +import useGetMajorQuery from "src/hooks/school/useGetMajorQuery"; + +import Flex from "src/components/common/Flex"; +import InputLine from "src/components/inputs/input-line"; +import SelectBox from "src/components/selectbox/selectbox"; +import ButtonFillLarge from "src/components/buttons/button-fill-large"; +import Option from "src/components/selectbox/Options"; + +import { SCHOOL_YEAR_OPTIONS } from "src/constants/options"; +import { Route } from "src/constants/Route"; + +const University = () => { + const router = useRouter(); + const school = useInput(); + const department = useInput(); + const grade = useSelect("23학번"); + const selected = useAppSelector((state) => state.organization.selected); + + const { userMutation } = useUserMutation(); + const filteredSchool = useGetUnivQuery(school.value); + const filteredMajor = useGetMajorQuery(department.value); + + useEffect(() => { + filteredSchool.refetch(); + }, [school.value]); + + useEffect(() => { + filteredMajor.refetch(); + }, [department.value]); + + const searchSchool = useCallback(() => { + const filteredSchoolInfo = + filteredSchool.data?.dataSearch.content && school.value + ? filteredSchool.data?.dataSearch.content.map( + (schoolInfo: any) => { + return { + name: schoolInfo.schoolName, + value: + schoolInfo.schoolName + schoolInfo.campusName + }; + } + ) + : null; + + return filteredSchoolInfo; + }, [filteredSchool]); + + const searchMajor = useCallback(() => { + const filteredMajorInfo = + filteredMajor.data?.dataSearch.content && department.value + ? filteredMajor.data?.dataSearch.content.map( + (schoolInfo: any) => { + return { + name: schoolInfo.mClass, + value: schoolInfo.majorSeq + }; + } + ) + : null; + + return filteredMajorInfo; + }, [filteredMajor]); + + const handleClickNext = () => { + userMutation.mutate({ + schoolType: selected, + schoolName: school.value, + class: department.value, + grade: grade.value + }); + // router.push(selected === "졸업생" ? Route.COMPLETE : Route.UNIVERSITY); + router.push(Route.COMPLETE); + }; + + return ( + <> + + + {filteredSchool.data?.dataSearch.content && searchSchool() && ( + + + + {filteredMajor.data?.dataSearch.content && searchMajor() && ( + + + + + + + ); +}; + +export default University; diff --git a/src/pages-edit/sign-up/default.tsx b/src/pages-edit/sign-up/default.tsx index 974dd7e..c48f1be 100644 --- a/src/pages-edit/sign-up/default.tsx +++ b/src/pages-edit/sign-up/default.tsx @@ -5,7 +5,7 @@ import ButtonFillLarge from "src/components/buttons/button-fill-large"; import Flex from "src/components/common/Flex"; import InputLine from "src/components/inputs/input-line"; import NavigationTop from "src/components/navigations/NavigationTop"; -import ButtonGenderSelect from "src/components/sign-up/button-gender-select"; +import ButtonGenderSelect from "src/pages-edit/sign-up/components/button-gender-select"; import { birthMsg, emailMsg, nameMsg, phoneMsg } from "src/constants/messages"; import { useCheckNicknameQuery } from "src/hooks/account/useCheckNicknameQuery"; import { useInput } from "src/hooks/common/useInput"; @@ -73,19 +73,18 @@ const SignIn = () => { /> { : birthMsg.WRONG } isError={!validBirth(birthday.value)} - readonly={Boolean(user?.birthday)} /> { : phoneMsg.WRONG } isError={!validPhone(phone.value)} - readonly={Boolean(user?.phone)} /> { : emailMsg.WRONG } isError={!validEmail(email.value)} - readonly={Boolean(user?.email)} /> { : isDupNickname.data?.message } isError={!isDupNickname.data?.available} - readonly={Boolean(user?.nickname)} /> { return ( } + leftIcon={ + router.push("/auth/default")} + /> + } title="회원 가입" />