markdown editor
This commit is contained in:
44
src/components/Navigations/MainNavigation.js
Normal file
44
src/components/Navigations/MainNavigation.js
Normal file
@@ -0,0 +1,44 @@
|
||||
//src/components/MainNavigation.js
|
||||
|
||||
import React, {useContext} from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import "./MainNavigation.css";
|
||||
import {AuthContext} from "../../AuthProvider";
|
||||
|
||||
const MainNavigation = () => {
|
||||
const { user, login, logout } = useContext(AuthContext);
|
||||
return (
|
||||
<nav className="main-navigation">
|
||||
<ul>
|
||||
<li>
|
||||
<Link to="/">Home</Link>
|
||||
</li>
|
||||
{ user && user.profile ? (
|
||||
<div>
|
||||
<h1>{user.profile.name}</h1>
|
||||
<button onClick={logout}>logout</button>
|
||||
</div>
|
||||
) : (
|
||||
<li>
|
||||
<button onClick={login}>Login</button>
|
||||
</li>
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
<li>
|
||||
<a href="https://mail.hangman-lab.top" target="_blank" rel="noopener noreferrer">
|
||||
MailBox
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://git.hangman-lab.top" target="_blank" rel="noopener noreferrer">
|
||||
Git
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
);
|
||||
};
|
||||
|
||||
export default MainNavigation;
|
||||
Reference in New Issue
Block a user