Change "Account" to user email when signed out.
This commit is contained in:
parent
f95abb2035
commit
7129071a55
|
@ -98,7 +98,7 @@ const signIn = (email, password) => {
|
|||
}
|
||||
return (
|
||||
<div className="App">
|
||||
<Header items={nav} />
|
||||
<Header items={nav} user={auth} />
|
||||
<AuthContext.Provider value={auth}>
|
||||
<Routes>
|
||||
<Route path="/" element={<Home greeting="Hey you're at home!" />} />
|
||||
|
|
|
@ -11,14 +11,28 @@ return (
|
|||
<Nav.Link href={item.link} key={itemkey}> {item.label} </Nav.Link>
|
||||
)
|
||||
})
|
||||
// component for Account
|
||||
const Account = (props) => {
|
||||
if (props.user) {
|
||||
return (
|
||||
<NavDropdown title="Account">
|
||||
<NavDropdown.Item href="/signout">Log out</NavDropdown.Item>
|
||||
</NavDropdown>
|
||||
)
|
||||
}
|
||||
else {
|
||||
return null
|
||||
}
|
||||
|
||||
}
|
||||
return (
|
||||
<Navbar>
|
||||
<Container>
|
||||
<Navbar.Brand>App</Navbar.Brand>
|
||||
<Nav>
|
||||
{Links}
|
||||
<NavDropdown title="Account">
|
||||
<NavDropdown.Item>Log out</NavDropdown.Item>
|
||||
<NavDropdown title={props.user.email}>
|
||||
<NavDropdown.Item href="/signout">Log out</NavDropdown.Item>
|
||||
</NavDropdown>
|
||||
</Nav>
|
||||
</Container>
|
||||
|
|
Loading…
Reference in New Issue