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

61 lines
2.2 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 { useLocale } from "@lib/hooks/useLocale";
import { HeadSeo } from "@components/seo/head-seo";
2021-04-07 15:03:02 +00:00
import { ssrInit } from "@server/lib/ssr";
2021-04-07 15:03:02 +00:00
export default function Logout() {
const { t } = useLocale();
2021-07-20 18:18:26 +00:00
return (
<div
className="fixed inset-0 z-50 overflow-y-auto"
2021-07-20 18:18:26 +00:00
aria-labelledby="modal-title"
role="dialog"
aria-modal="true">
<HeadSeo title={t("logged_out")} description={t("logged_out")} />
<div className="flex items-end justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:block sm:p-0">
2021-07-20 18:18:26 +00:00
<span className="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">
&#8203;
</span>
<div className="inline-block px-4 pt-5 pb-4 overflow-hidden text-left align-bottom transition-all transform bg-white rounded-lg shadow-xl sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
2021-07-20 18:18:26 +00:00
<div>
<div className="flex items-center justify-center w-12 h-12 mx-auto bg-green-100 rounded-full">
<CheckIcon className="w-6 h-6 text-green-600" />
2021-04-07 15:03:02 +00:00
</div>
2021-07-20 18:18:26 +00:00
<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")}
2021-07-20 18:18:26 +00:00
</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>
</div>
</div>
<div className="mt-5 sm:mt-6">
<Link href="/auth/login">
<a className="inline-flex justify-center w-full px-4 py-2 text-base font-medium border border-transparent rounded-md shadow-sm bg-brand text-brandcontrast focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black sm:text-sm">
{t("go_back_login")}
2021-07-20 18:18:26 +00:00
</a>
</Link>
</div>
2021-04-07 15:03:02 +00:00
</div>
2021-07-20 18:18:26 +00:00
</div>
</div>
);
2021-07-19 15:56:58 +00:00
}
export async function getServerSideProps(context: GetServerSidePropsContext) {
const ssr = await ssrInit(context);
return {
props: {
trpcState: ssr.dehydrate(),
},
};
}