Skip to content

Commit

Permalink
feat: 비로그인 상태일 때 로그인창으로 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
imddoy committed Jul 19, 2024
1 parent 8af88d3 commit 74336cd
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/pages/register/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@ import {
onMinusClick,
onPlusClick,
} from "./utils/handleEvent";
import useLogin from "@hooks/useLogin";
import { useAtom } from "jotai";
import { navigateAtom } from "@stores/navigate";
import { requestKakaoLogin } from "@utils/kakaoLogin";

const Register = () => {
const [registerStep, setRegisterStep] = useState(2); // 등록 step 나누기
const { isLogin } = useLogin();
const [registerStep, setRegisterStep] = useState(1); // 등록 step 나누기
const { openConfirm } = useModal();
// gigInfo 초기화
const [gigInfo, setGigInfo] = useState<GigInfo>({
Expand Down Expand Up @@ -288,6 +293,16 @@ const Register = () => {
});
}, [setHeader, registerStep]);

const [, setNavigateUrl] = useAtom(navigateAtom);
const handleKakaoLogin = (url: string) => {
setNavigateUrl(url);
requestKakaoLogin();
};

if (!isLogin) {
handleKakaoLogin("/main");
}

if (registerStep === 1) {
return (
<>
Expand Down

0 comments on commit 74336cd

Please sign in to comment.