@@ -2,20 +2,20 @@ import { useNavigate } from "react-router-dom";
22import useAuth from "../hooks/useAuth" ;
33import useAxios from "../hooks/useAxios" ;
44import { Link } from "react-router-dom" ;
5- import Container from ' react-bootstrap/Container' ;
6- import Nav from ' react-bootstrap/Nav' ;
7- import Navbar from ' react-bootstrap/Navbar' ;
8- import Button from ' react-bootstrap/Button' ;
5+ import Container from " react-bootstrap/Container" ;
6+ import Nav from " react-bootstrap/Nav" ;
7+ import Navbar from " react-bootstrap/Navbar" ;
8+ import Button from " react-bootstrap/Button" ;
99
1010
1111export default function Navigationbar ( ) {
12- const user = useAuth ( ) ;
12+ const auth = useAuth ( ) ;
1313 const navigate = useNavigate ( ) ;
1414 const axios = useAxios ( ) ;
1515 const handleLogout = async ( ) => {
1616 try {
1717 await axios . get ( "/api/logout" ) ;
18- user . logoutUser ( ) ;
18+ auth . logoutUser ( ) ;
1919 navigate ( "/" ) ;
2020 }
2121 catch ( error ) {
@@ -25,61 +25,63 @@ export default function Navigationbar() {
2525 } ;
2626
2727 const linkStyle = {
28- margin : "1rem" ,
29- textDecoration : "none" ,
30- color : ' white'
28+ margin : "1rem" ,
29+ textDecoration : "none" ,
30+ color : " white"
3131 } ;
3232
33- if ( user . isUserLoggedIn ( ) ) {
34- return (
33+ if ( auth . isUserLoggedIn ( ) ) {
34+ return (
3535 < Navbar bg = "dark" variant = "dark" expand = "lg" >
36- < Container >
37- < Navbar . Brand href = "#home" >
38- < img style = { { objectFit :"contain" } }
39- src = "/logo_50_dark.png"
40- width = "auto"
41- height = "auto"
42- /> { ' ' }
36+ < Container >
37+ < Navbar . Brand href = "#home" >
38+ < img style = { { objectFit : "contain" } }
39+ src = "/logo_50_dark.png"
40+ width = "auto"
41+ height = "auto"
42+ /> { " " }
4343 CryptCollab
4444 </ Navbar . Brand >
4545 < Navbar . Toggle aria-controls = "basic-navbar-nav" />
46- < Navbar . Collapse id = "basic-navbar-nav" >
47- < Nav className = "ms-auto" >
48- < Link to = "/dashboard" style = { linkStyle } > Dashboard</ Link >
49- < Link to = "/document" style = { linkStyle } > Document</ Link >
50- < Button onClick = { handleLogout } variant = "link"
51- style = { { textDecoration : "none" ,
52- color : 'white' } } >
53- Logout
46+ < Navbar . Collapse id = "basic-navbar-nav" >
47+ < Nav className = "ms-auto" >
48+ < Link to = "/dashboard" style = { linkStyle } > Dashboard</ Link >
49+ < Link to = "/document" style = { linkStyle } > Document</ Link >
50+ < Button onClick = { handleLogout } variant = "link"
51+ style = { {
52+ textDecoration : "none" ,
53+ color : "white"
54+ } } >
55+ Logout
5456 </ Button >
55- </ Nav >
57+ </ Nav >
5658 </ Navbar . Collapse >
57- </ Container >
58- </ Navbar >
59+ </ Container >
60+ </ Navbar >
5961 ) ;
6062 }
6163 else {
62- return (
64+ return (
6365 < Navbar bg = "dark" variant = "dark" expand = "lg" >
64- < Container >
65- < Navbar . Brand href = "#home" >
66- < img style = { { objectFit :"contain" } }
67- src = "/logo_50_dark.png"
68- width = "auto"
69- height = "40"
70-
71- /> { ' ' }
66+ < Container >
67+ < Navbar . Brand href = "#home" >
68+ < img style = { { objectFit : "contain" } }
69+ src = "/logo_50_dark.png"
70+ width = "auto"
71+ height = "40"
72+
73+ /> { " " }
7274 CryptCollab
7375 </ Navbar . Brand >
7476 < Navbar . Toggle aria-controls = "basic-navbar-nav" />
75- < Navbar . Collapse id = "basic-navbar-nav" >
76- < Nav className = "ms-auto" >
77- < Link to = "/login" style = { linkStyle } > Login</ Link >
78- < Link to = "/register" style = { linkStyle } > Register</ Link >
79- </ Nav >
77+ < Navbar . Collapse id = "basic-navbar-nav" >
78+ < Nav className = "ms-auto" >
79+ < Link to = "/login" style = { linkStyle } > Login</ Link >
80+ < Link to = "/register" style = { linkStyle } > Register</ Link >
81+ </ Nav >
8082 </ Navbar . Collapse >
81- </ Container >
82- </ Navbar >
83+ </ Container >
84+ </ Navbar >
8385 ) ;
8486 }
8587
0 commit comments