-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2cc79e
commit 0e6b601
Showing
6 changed files
with
37 additions
and
65 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { useOverlay } from '@/shared/hooks/useOverlay'; | ||
import LoginModal from '../components/LoginModal'; | ||
|
||
export const useLoginModal = () => { | ||
const overlay = useOverlay(); | ||
|
||
const openLoginModal = (errorCode: number) => { | ||
overlay.open(({ isOpen, close }) => ( | ||
<LoginModal | ||
isOpen={isOpen} | ||
closeModal={close} | ||
message={ | ||
[1000, 1003, 1004].includes(errorCode) | ||
? '로그인 정보가 부정확하여 재로그인이 필요합니다.\n다시 로그인하시겠습니까?' | ||
: [1011, 1012, 1007].includes(errorCode) | ||
? '로그인 정보가 만료되었습니다.\n다시 로그인하시겠습니까?' | ||
: '로그인 하시겠습니까?' | ||
} | ||
/> | ||
)); | ||
}; | ||
|
||
return { openLoginModal }; | ||
}; |
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