-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix RWD problem - adjust rem unit - standardization most units from vh, vw and px... into rem - make login block full screen when is mobile devices
- Loading branch information
Showing
8 changed files
with
71 additions
and
32 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
|
||
import { useSelector } from 'react-redux'; | ||
import UserAPI from '../utils/UserAPI'; | ||
import { useNavigate } from 'react-router'; | ||
import { useEffect } from 'react'; | ||
|
||
const Logout = () => { | ||
const navigate = useNavigate(); | ||
const {loginStatus} = useSelector((state) => state.userState); | ||
useEffect(()=>{ | ||
async function logout() { | ||
if (!loginStatus) { | ||
navigate('/'); | ||
} | ||
else { | ||
await UserAPI.logout(); | ||
navigate('/'); | ||
window.location.reload(); | ||
} | ||
} | ||
logout(); | ||
}, [loginStatus]); | ||
|
||
return ( | ||
<> | ||
</> | ||
); | ||
}; | ||
|
||
export default Logout; |
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