Skip to content

Commit

Permalink
no ssr the logout button
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisinajar committed Feb 27, 2024
1 parent 165d48e commit 63fcd51
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/components/logout-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react";
import { useApolloClient } from "@apollo/client";
import { useRouter } from "next/router";

import NoSsr from "@mui/material/NoSsr";
import Button from "@mui/material/Button";

import { useToken } from "src/token";
Expand All @@ -22,14 +23,16 @@ export function LogoutButton(): JSX.Element | null {
}

return (
<Button
aria-label="Logout and return to login screen"
color="error"
variant="contained"
disableElevation
onClick={handleLogout}
>
Logout
</Button>
<NoSsr>
<Button
aria-label="Logout and return to login screen"
color="error"
variant="contained"
disableElevation
onClick={handleLogout}
>
Logout
</Button>
</NoSsr>
);
}

0 comments on commit 63fcd51

Please sign in to comment.