-
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.
Browse files
Browse the repository at this point in the history
* feat: LoginModal을 overlay로 구현 * feat: storybook에 OverlayProvider 적용 * refactor: useModal을 사용한 부분 overlay로 변경 * refactor: useLoginModal 훅 이름 변경
- Loading branch information
1 parent
b2cc79e
commit 4c6a317
Showing
10 changed files
with
118 additions
and
119 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 useLoginModalByError = () => { | ||
const overlay = useOverlay(); | ||
|
||
const openLoginModalByError = (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 { openLoginModalByError }; | ||
}; |
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
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.