Skip to content

Commit

Permalink
add page reload
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBenediktBusch committed Feb 14, 2024
1 parent 5c6e092 commit 11e5c23
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/berlin/src/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ function Header() {

const [isBurgerMenuOpen, setIsBurgerMenuOpen] = useState(false);

// Define onClick handler to navigate to account page and trigger reload
const handleAccountClick = () => {
navigate('/account');
window.location.reload();
};

return (
<SyledHeader>
<HeaderContainer>
Expand All @@ -72,7 +78,7 @@ function Header() {
<DesktopButtons>
{user ? (
<>
<NavButton to="/account" $color="secondary">
<NavButton to="#" $color="secondary" onClick={handleAccountClick}>
Account
</NavButton>
<Button onClick={() => mutateLogout()}>Log out</Button>
Expand Down

0 comments on commit 11e5c23

Please sign in to comment.