Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
survey
Commits
a1172af8
Commit
a1172af8
authored
Jul 20, 2022
by
Jiwon Yoon
Browse files
로그아웃 후 홈으로
parent
cc4db4af
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/src/commons/Header.tsx
View file @
a1172af8
import
React
from
"
react
"
;
import
{
Link
,
useLocation
}
from
"
react-router-dom
"
;
import
{
Link
,
useLocation
,
useNavigate
}
from
"
react-router-dom
"
;
import
{
useAuth
}
from
"
../auth/auth.context
"
;
export
const
Header
=
()
=>
{
const
{
user
,
logout
}
=
useAuth
();
const
location
=
useLocation
();
const
navigate
=
useNavigate
();
return
(
<
div
className
=
"bg-white border-b-2 border-b-themeColor px-2 sm:px-4 py-2.5"
>
...
...
@@ -16,7 +17,7 @@ export const Header = () => {
{
user
.
isLoggedIn
?
(
<
div
>
<
button
onClick
=
{
()
=>
logout
()
}
onClick
=
{
()
=>
logout
(
()
=>
navigate
(
"
/
"
)
)
}
className
=
"font-bold text-gray-600 hover:text-themeColor mx-1 py-2 px-3 rounded-md"
>
로그아웃
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment