Hide header actions when signed out
This commit is contained in:
@@ -40,19 +40,19 @@ export default function HeaderActions() {
|
||||
}
|
||||
}
|
||||
|
||||
if (!signedIn) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="header-actions">
|
||||
<a href="/">Requests</a>
|
||||
<a href="/how-it-works">How it works</a>
|
||||
{signedIn && <a href="/profile">My profile</a>}
|
||||
<a href="/profile">My profile</a>
|
||||
{role === 'admin' && <a href="/admin">Settings</a>}
|
||||
{signedIn ? (
|
||||
<button type="button" className="header-link" onClick={signOut}>
|
||||
Sign out
|
||||
</button>
|
||||
) : (
|
||||
<a href="/login">Sign in</a>
|
||||
)}
|
||||
<button type="button" className="header-link" onClick={signOut}>
|
||||
Sign out
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user