2022-05-14 13:49:39 +00:00
|
|
|
import classNames from "classnames";
|
2022-01-27 10:16:20 +00:00
|
|
|
import React from "react";
|
|
|
|
|
2022-07-01 17:19:52 +00:00
|
|
|
import { LOGO } from "@calcom/lib/constants";
|
|
|
|
|
2022-01-27 10:16:20 +00:00
|
|
|
import Loader from "@components/Loader";
|
|
|
|
import { HeadSeo } from "@components/seo/head-seo";
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
title: string;
|
|
|
|
description: string;
|
|
|
|
footerText?: React.ReactNode | string;
|
|
|
|
showLogo?: boolean;
|
|
|
|
heading?: string;
|
|
|
|
loading?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function AuthContainer(props: React.PropsWithChildren<Props>) {
|
|
|
|
return (
|
2022-09-12 09:25:54 +00:00
|
|
|
<div className="flex min-h-screen flex-col justify-center border-gray-200 bg-neutral-50 py-12 sm:px-6 lg:px-8">
|
2022-01-27 10:16:20 +00:00
|
|
|
<HeadSeo title={props.title} description={props.description} />
|
2022-05-14 13:49:39 +00:00
|
|
|
<div className={classNames(props.showLogo ? "text-center" : "", "sm:mx-auto sm:w-full sm:max-w-md")}>
|
2022-01-27 10:16:20 +00:00
|
|
|
{props.showLogo && (
|
2022-05-14 13:49:39 +00:00
|
|
|
// eslint-disable-next-line @next/next/no-img-element
|
2022-07-01 17:19:52 +00:00
|
|
|
<img className="mx-auto h-6" src={LOGO} alt="Cal.com Logo" />
|
2022-01-27 10:16:20 +00:00
|
|
|
)}
|
|
|
|
{props.heading && (
|
2022-03-15 16:59:04 +00:00
|
|
|
<h2 className="font-cal mt-6 text-center text-3xl text-neutral-900">{props.heading}</h2>
|
2022-01-27 10:16:20 +00:00
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
{props.loading && (
|
2022-02-09 00:05:13 +00:00
|
|
|
<div className="absolute z-50 flex h-screen w-full items-center bg-gray-50">
|
2022-01-27 10:16:20 +00:00
|
|
|
<Loader />
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
|
2022-09-12 09:25:54 +00:00
|
|
|
<div className="mx-2 rounded-md border border-gray-300 bg-white px-4 py-8 sm:px-10">
|
2022-01-27 10:16:20 +00:00
|
|
|
{props.children}
|
|
|
|
</div>
|
2022-02-09 00:05:13 +00:00
|
|
|
<div className="mt-4 text-center text-sm text-neutral-600">{props.footerText}</div>
|
2022-01-27 10:16:20 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|