-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: login, signup modal을 auth modal로 통합
- Loading branch information
Showing
11 changed files
with
66 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import ModalView from "@components/shared/ModalView"; | ||
import SwitchCase from "@components/shared/SwitchCase"; | ||
import React, { useState } from "react"; | ||
import LoginForm from "./LoginForm"; | ||
import SignUpForm from "./SignUpForm"; | ||
import { SocialLoginArea } from "@components/shared/SocialLoginArea"; | ||
|
||
interface Props { | ||
type: "LOGIN" | "SIGN_UP"; | ||
onExit: (time: number) => void; | ||
} | ||
|
||
const AuthModal = ({ type, onExit }: Props) => { | ||
const [mode, setMode] = useState(type); | ||
const [isClose, setIsClose] = useState(false); | ||
|
||
const closeWithAnimation = () => { | ||
setIsClose(true); | ||
onExit(500); | ||
}; | ||
return ( | ||
<ModalView | ||
title={mode === "LOGIN" ? "로그인" : "회원가입"} | ||
onClose={closeWithAnimation} | ||
isClose={isClose} | ||
> | ||
<SwitchCase | ||
value={mode} | ||
caseBy={{ | ||
LOGIN: ( | ||
<LoginForm | ||
onClose={closeWithAnimation} | ||
openSignUpModal={() => setMode("SIGN_UP")} | ||
/> | ||
), | ||
SIGN_UP: <SignUpForm onClose={closeWithAnimation} />, | ||
}} | ||
/> | ||
<SocialLoginArea /> | ||
</ModalView> | ||
); | ||
}; | ||
|
||
export default AuthModal; |
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
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 @@ | ||
export { default } from "./AuthModal"; |
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 was deleted.
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
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 was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
client/components/shared/Overlays/SignUpModal/styles.module.scss
This file was deleted.
Oops, something went wrong.