logout button in settings

This commit is contained in:
m5r 2021-08-28 14:03:49 +08:00
parent d7ed778c2c
commit 1a5fdf5a0e

View File

@ -1,5 +1,5 @@
import type { BlitzPage } from "blitz";
import { Routes } from "blitz";
import { Routes, useMutation } from "blitz";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faCreditCard, faUserCircle } from "@fortawesome/pro-regular-svg-icons";
@ -7,6 +7,7 @@ import Layout from "../../core/layouts/layout";
import appLogger from "../../../integrations/logger";
import useRequireOnboarding from "../../core/hooks/use-require-onboarding";
import logout from "../../auth/mutations/logout";
const logger = appLogger.child({ page: "/settings" });
@ -27,6 +28,7 @@ const navigation = [
const Settings: BlitzPage = () => {
useRequireOnboarding();
const [logoutMutation] = useMutation(logout);
return (
<>
@ -48,6 +50,8 @@ const Settings: BlitzPage = () => {
))}
</nav>
</aside>
<button onClick={() => logoutMutation()}>Log out</button>
</div>
</>
);