logout button in settings
This commit is contained in:
parent
d7ed778c2c
commit
1a5fdf5a0e
@ -1,5 +1,5 @@
|
|||||||
import type { BlitzPage } from "blitz";
|
import type { BlitzPage } from "blitz";
|
||||||
import { Routes } from "blitz";
|
import { Routes, useMutation } from "blitz";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { faCreditCard, faUserCircle } from "@fortawesome/pro-regular-svg-icons";
|
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 appLogger from "../../../integrations/logger";
|
||||||
import useRequireOnboarding from "../../core/hooks/use-require-onboarding";
|
import useRequireOnboarding from "../../core/hooks/use-require-onboarding";
|
||||||
|
import logout from "../../auth/mutations/logout";
|
||||||
|
|
||||||
const logger = appLogger.child({ page: "/settings" });
|
const logger = appLogger.child({ page: "/settings" });
|
||||||
|
|
||||||
@ -27,6 +28,7 @@ const navigation = [
|
|||||||
|
|
||||||
const Settings: BlitzPage = () => {
|
const Settings: BlitzPage = () => {
|
||||||
useRequireOnboarding();
|
useRequireOnboarding();
|
||||||
|
const [logoutMutation] = useMutation(logout);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -48,6 +50,8 @@ const Settings: BlitzPage = () => {
|
|||||||
))}
|
))}
|
||||||
</nav>
|
</nav>
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
|
<button onClick={() => logoutMutation()}>Log out</button>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user