-
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.
Merge pull request #187 from YAPP-Github/dev
Release 0.1.8
- Loading branch information
Showing
13 changed files
with
60 additions
and
8 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 React, { useEffect } from 'react'; | ||
import Cookies from 'js-cookie'; | ||
import { Modal } from '@/components/base/index'; | ||
import { useToggle } from '@/hooks/common'; | ||
import { useLocation, useNavigate } from 'react-router-dom'; | ||
|
||
const LoginCheck = () => { | ||
const navigate = useNavigate(); | ||
const location = useLocation(); | ||
const [isErrorModal, onToggleErrorModal] = useToggle(); | ||
|
||
useEffect(() => { | ||
const token = Cookies.get('AccessToken'); | ||
const invalidToken = !token || token === 'undefined'; | ||
invalidToken && onToggleErrorModal(); | ||
}, [location]); | ||
|
||
return ( | ||
<> | ||
{isErrorModal && ( | ||
<Modal | ||
width={200} | ||
height={140} | ||
bottonName="확인" | ||
title="알림" | ||
text="로그인 후에 설문 진행 가능합니다." | ||
onToggleModal={onToggleErrorModal} | ||
onClick={() => navigate('/')} | ||
/> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default LoginCheck; |
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,14 @@ | ||
import React from 'react'; | ||
import { Outlet } from 'react-router-dom'; | ||
import LoginCheck from '@/components/base/LoginCheck'; | ||
|
||
const Template = () => { | ||
return ( | ||
<> | ||
<Outlet /> | ||
<LoginCheck /> | ||
</> | ||
); | ||
}; | ||
|
||
export default Template; |
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