railbird-gql/component/buttons/sign-out.tsx
2024-02-06 11:34:52 -08:00

19 lines
439 B
TypeScript

import React from "react";
import { Button } from "react-native";
import { handleSignOut } from "../../auth";
import { useAuthHeader } from "../../graphql/client";
export default function SignOutButton(): React.JSX.Element {
const { setAuthHeader } = useAuthHeader();
return (
<Button
title={"Sign out"}
onPress={async () => {
setAuthHeader({ key: "Authorization", value: "" });
await handleSignOut();
}}
/>
);
}