cal.pub0.org/apps/web/pages/auth/logout.tsx

59 lines
1.8 KiB
TypeScript
Raw Normal View History

2021-07-20 18:18:26 +00:00
import { CheckIcon } from "@heroicons/react/outline";
import { GetServerSidePropsContext } from "next";
import Link from "next/link";
import { useRouter } from "next/router";
import { useEffect } from "react";
import Button from "@calcom/ui/Button";
import { useLocale } from "@lib/hooks/useLocale";
import { inferSSRProps } from "@lib/types/inferSSRProps";
import AuthContainer from "@components/ui/AuthContainer";
2021-04-07 15:03:02 +00:00
import { ssrInit } from "@server/lib/ssr";
type Props = inferSSRProps<typeof getServerSideProps>;
export default function Logout(props: Props) {
const router = useRouter();
useEffect(() => {
if (props.query?.survey === "true") {
router.push("https://cal.com/cancellation");
}
}, []);
const { t } = useLocale();
2021-07-20 18:18:26 +00:00
return (
<AuthContainer title={t("logged_out")} description={t("youve_been_logged_out")}>
<div className="mb-4">
<div className="mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100">
<CheckIcon className="h-6 w-6 text-green-600" />
</div>
<div className="mt-3 text-center sm:mt-5">
<h3 className="text-lg font-medium leading-6 text-gray-900" id="modal-title">
{t("youve_been_logged_out")}
</h3>
<div className="mt-2">
<p className="text-sm text-gray-500">{t("hope_to_see_you_soon")}</p>
2021-07-20 18:18:26 +00:00
</div>
2021-04-07 15:03:02 +00:00
</div>
2021-07-20 18:18:26 +00:00
</div>
<Link href="/auth/login">
<Button className="flex w-full justify-center"> {t("go_back_login")}</Button>
</Link>
</AuthContainer>
2021-07-20 18:18:26 +00:00
);
2021-07-19 15:56:58 +00:00
}
export async function getServerSideProps(context: GetServerSidePropsContext) {
const ssr = await ssrInit(context);
return {
props: {
trpcState: ssr.dehydrate(),
query: context.query,
},
};
}