Hide transactions button if not logged in
This commit is contained in:
@ -17,7 +17,7 @@ type NavBarLayoutProps = {
|
||||
}
|
||||
|
||||
const NavBarLayout = ({ children }: NavBarLayoutProps) => {
|
||||
const { hasRole } = useAuth()
|
||||
const { hasRole, isAuthenticated } = useAuth()
|
||||
const [basket] = useState(getBasket())
|
||||
|
||||
return (
|
||||
@ -40,6 +40,7 @@ const NavBarLayout = ({ children }: NavBarLayoutProps) => {
|
||||
</div>
|
||||
<div className="ml-auto justify-end space-x-3">
|
||||
<ul className="relative hidden items-center space-x-3 lg:flex">
|
||||
{isAuthenticated ? (
|
||||
<li>
|
||||
<Link
|
||||
to={routes.userTransactions()}
|
||||
@ -48,6 +49,9 @@ const NavBarLayout = ({ children }: NavBarLayoutProps) => {
|
||||
Transactions
|
||||
</Link>
|
||||
</li>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</ul>
|
||||
<ThemeToggle />
|
||||
<Link
|
||||
@ -114,6 +118,7 @@ const NavBarLayout = ({ children }: NavBarLayoutProps) => {
|
||||
<p className="font-inter text-base">Basket</p>
|
||||
</Link>
|
||||
</li>
|
||||
{isAuthenticated ? (
|
||||
<li>
|
||||
<Link
|
||||
to={routes.userTransactions()}
|
||||
@ -122,6 +127,9 @@ const NavBarLayout = ({ children }: NavBarLayoutProps) => {
|
||||
<p className="font-inter text-base">Transactions</p>
|
||||
</Link>
|
||||
</li>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user