forked from reactplay/react-play
-
Notifications
You must be signed in to change notification settings - Fork 0
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
3c066fd
commit c8b1557
Showing
3 changed files
with
27 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { IoLogOutSharp } from "react-icons/io5"; | ||
import { useAuthenticated, useSignOut } from "@nhost/react"; | ||
|
||
const LogOut = () => { | ||
const isAuthenticated = useAuthenticated(); | ||
const { signOut } = useSignOut(); | ||
|
||
if (!isAuthenticated && process.env.NODE_ENV !== "development") { | ||
return null; | ||
} | ||
return ( | ||
<li> | ||
<button | ||
className='app-header-btn app-header-btn--default' | ||
onClick={() => signOut()} | ||
> | ||
<IoLogOutSharp className='icon' /> | ||
<span className='btn-label'>Logout</span> | ||
</button> | ||
</li> | ||
); | ||
}; | ||
|
||
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