11import React , { useState } from "react" ;
22import { NavLink as RouterNavLink } from "react-router-dom" ;
3+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" ;
34
45import {
56 Collapse ,
@@ -22,10 +23,7 @@ import { useAuth0 } from "../react-auth0-spa";
2223const NavBar = ( ) => {
2324 const [ isOpen , setIsOpen ] = useState ( false ) ;
2425 const { user, isAuthenticated, loginWithRedirect, logout } = useAuth0 ( ) ;
25-
26- const toggle = ( ) => {
27- setIsOpen ( { isOpen : ! isOpen } ) ;
28- } ;
26+ const toggle = ( ) => setIsOpen ( ! isOpen ) ;
2927
3028 const logoutWithRedirect = ( ) =>
3129 logout ( {
@@ -70,24 +68,26 @@ const NavBar = () => {
7068 < img
7169 src = { user . picture }
7270 alt = "Profile"
73- className = "nav-user-profile"
71+ className = "nav-user-profile rounded-circle"
72+ width = "50"
7473 />
7574 </ DropdownToggle >
76- < DropdownMenu right >
75+ < DropdownMenu >
7776 < DropdownItem header > { user . name } </ DropdownItem >
7877 < DropdownItem
7978 tag = { RouterNavLink }
8079 to = "/profile"
8180 className = "dropdown-profile"
8281 activeClassName = "router-link-exact-active"
8382 >
84- < span className = "icon icon-profile " /> Profile
83+ < FontAwesomeIcon icon = "user" className = "mr-3 " /> Profile
8584 </ DropdownItem >
8685 < DropdownItem
8786 id = "qsLogoutBtn"
8887 onClick = { ( ) => logoutWithRedirect ( ) }
8988 >
90- < span className = "icon icon-power" /> Log out
89+ < FontAwesomeIcon icon = "power-off" className = "mr-3" /> Log
90+ out
9191 </ DropdownItem >
9292 </ DropdownMenu >
9393 </ UncontrolledDropdown >
@@ -108,19 +108,24 @@ const NavBar = () => {
108108 </ Nav >
109109 ) }
110110 { isAuthenticated && (
111- < Nav className = "d-md-none" navbar >
111+ < Nav
112+ className = "d-md-none justify-content-between"
113+ navbar
114+ style = { { minHeight : 170 } }
115+ >
112116 < NavItem >
113117 < span className = "user-info" >
114118 < img
115119 src = { user . picture }
116120 alt = "Profile"
117- className = "nav-user-profile d-inline-block"
121+ className = "nav-user-profile d-inline-block rounded-circle mr-3"
122+ width = "50"
118123 />
119124 < h6 className = "d-inline-block" > { user . name } </ h6 >
120125 </ span >
121126 </ NavItem >
122127 < NavItem >
123- < span className = "icon icon-profile " />
128+ < FontAwesomeIcon icon = "user" className = "mr-3 " />
124129 < RouterNavLink
125130 to = "/profile"
126131 activeClassName = "router-link-exact-active"
@@ -129,7 +134,7 @@ const NavBar = () => {
129134 </ RouterNavLink >
130135 </ NavItem >
131136 < NavItem >
132- < span className = "icon icon-power " />
137+ < FontAwesomeIcon icon = "power-off" className = "mr-3 " />
133138 < RouterNavLink
134139 to = "#"
135140 id = "qsLogoutBtn"
0 commit comments