forked from StudyBadge-TenTen/StudyBadge_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.
Merge pull request StudyBadge-TenTen#55 from StudyBadge-TenTen/develop
[StudyBadge_FE StudyBadge-TenTen#50 ]: 디버깅 + 추가 기능 구현
- Loading branch information
Showing
35 changed files
with
995 additions
and
746 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import { useNavigate } from "react-router-dom"; | |
import NaverLogin from "./NaverLogin"; | ||
import KakaoLogin from "./KakaoLogin"; | ||
import { useAuthStore } from "../../store/auth-store"; | ||
import PageScrollTop from "../common/PageScrollTop"; | ||
|
||
const LoginUser: React.FC = () => { | ||
const navigate = useNavigate(); | ||
|
@@ -36,53 +37,56 @@ const LoginUser: React.FC = () => { | |
}; | ||
|
||
return ( | ||
<div className="flex flex-col justify-center items-center mt-24 mb-20 w-4/5"> | ||
<h1 className="text-3xl text-Blue-2 font-bold mb-12">LOGIN</h1> | ||
<form className="w-full flex flex-col justify-center items-center mb-10" onSubmit={submitLogin}> | ||
<div className="sm:w-96 flex justify-between items-center my-2"> | ||
<label className="w-16 text-Blue-2">이메일</label> | ||
<input | ||
type="email" | ||
name="email" | ||
className="input w-40 sm:w-56 sm:ml-12 placeholder:text-slate-400 placeholder:text-xs" | ||
placeholder="[email protected]" | ||
value={email} | ||
onChange={handleChange} | ||
/> | ||
<> | ||
<PageScrollTop /> | ||
<div className="flex flex-col justify-center items-center mt-24 mb-20 w-4/5"> | ||
<h1 className="text-3xl text-Blue-2 font-bold mb-12">LOGIN</h1> | ||
<form className="w-full flex flex-col justify-center items-center mb-10" onSubmit={submitLogin}> | ||
<div className="sm:w-96 flex justify-between items-center my-2"> | ||
<label className="w-16 text-Blue-2">이메일</label> | ||
<input | ||
type="email" | ||
name="email" | ||
className="input w-40 sm:w-56 sm:ml-12 placeholder:text-slate-400 placeholder:text-xs" | ||
placeholder="[email protected]" | ||
value={email} | ||
onChange={handleChange} | ||
/> | ||
</div> | ||
<div className="sm:w-96 flex justify-between items-center mb-2"> | ||
<label className="w-16 text-Blue-2">비밀번호</label> | ||
<input | ||
type="password" | ||
name="password" | ||
className="input w-40 sm:w-56 sm:ml-12 placeholder:text-xs" | ||
placeholder="비밀번호를 입력해주세요" | ||
value={password} | ||
onChange={handleChange} | ||
/> | ||
</div> | ||
<button | ||
type="submit" | ||
className="w-[183px] md:w-[300px] btn-blue text-white py-2 mt-6 hover:bg-blue-600 transition-all" | ||
> | ||
LOGIN | ||
</button> | ||
</form> | ||
<NaverLogin /> | ||
<KakaoLogin /> | ||
<div className="flex justify-between items-center w-full max-w-80 mb-12"> | ||
<button type="button" className="btn-blue w-24 mt-12 transition-all" onClick={moveSignUpPage}> | ||
회원가입 | ||
</button> | ||
<button | ||
type="button" | ||
className="btn-blue w-24 mt-12 transition-all" | ||
onClick={() => navigate("/sendEmail_PasswordReset")} | ||
> | ||
비밀번호 재설정 | ||
</button> | ||
</div> | ||
<div className="sm:w-96 flex justify-between items-center mb-2"> | ||
<label className="w-16 text-Blue-2">비밀번호</label> | ||
<input | ||
type="password" | ||
name="password" | ||
className="input w-40 sm:w-56 sm:ml-12 placeholder:text-xs" | ||
placeholder="비밀번호를 입력해주세요" | ||
value={password} | ||
onChange={handleChange} | ||
/> | ||
</div> | ||
<button | ||
type="submit" | ||
className="w-[183px] md:w-[300px] btn-blue text-white py-2 mt-6 hover:bg-blue-600 transition-all" | ||
> | ||
LOGIN | ||
</button> | ||
</form> | ||
<NaverLogin /> | ||
<KakaoLogin /> | ||
<div className="flex justify-between items-center w-full max-w-80 mb-12"> | ||
<button type="button" className="btn-blue w-24 mt-12 transition-all" onClick={moveSignUpPage}> | ||
회원가입 | ||
</button> | ||
<button | ||
type="button" | ||
className="btn-blue w-24 mt-12 transition-all" | ||
onClick={() => navigate("/sendEmail_PasswordReset")} | ||
> | ||
비밀번호 재설정 | ||
</button> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
|
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,35 @@ | ||
import { useNavigate, useSearchParams } from "react-router-dom"; | ||
import Modal from "../common/Modal"; | ||
import { getAuthEmail } from "@/services/auth-api"; | ||
|
||
const MailAuth = (): JSX.Element => { | ||
const navigate = useNavigate(); | ||
const [searchParams] = useSearchParams(); | ||
const email = searchParams.get("email"); | ||
const code = searchParams.get("code"); | ||
|
||
const handleClick = async () => { | ||
if (email && code) { | ||
try { | ||
await getAuthEmail(email, code); | ||
navigate("/login"); | ||
} catch (error) { | ||
alert("이메일 인증에 실패하였습니다."); | ||
navigate("/"); | ||
} | ||
} | ||
}; | ||
|
||
return ( | ||
<Modal> | ||
<div className="flex flex-col justify-center items-center"> | ||
이메일 인증을 위해 확인 버튼을 눌러주세요 | ||
<button onClick={() => handleClick()} className="btn-blue mt-4 w-10"> | ||
확인 | ||
</button> | ||
</div> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default MailAuth; |
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
Oops, something went wrong.