-
Notifications
You must be signed in to change notification settings - Fork 0
/
Navbar.js
37 lines (27 loc) · 1.21 KB
/
Navbar.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import './Navbar.css';
import SearchIcon from '@mui/icons-material/Search';
import NotificationsActiveIcon from '@mui/icons-material/NotificationsActive';
import FaceIcon from '@mui/icons-material/Face';
import { useMoralis } from "react-moralis";
import {Link} from 'react-router-dom'
// components for showing the navbar
const Navbar = () => {
// The useMoralis hook provides all the basics functionalities that is needed for authentication and user data.
const { authenticate, isAuthenticated, logout, user } = useMoralis();
return(
<div className='navbar'>
<div className='nav-wrapper'>
<h3 className='message'>Welcome back to UnBolt, {user.get('username').toUpperCase()} </h3>
<div className='items'>
<>
{/* display user or else display small */}
{user ? <small>{
<Link to={`/profile/${user.get('username')}`}> {user.get("ethAddress")} </Link>
}</small> : <small>idk</small> }
</>
</div>
</div>
</div>
)
}
export default Navbar