2022-12-09 14:43:47 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import { useSelector } from "react-redux";
|
|
|
|
|
|
|
|
|
|
import FooterLinks from "./FooterLinks";
|
|
|
|
|
import { getTenantConfig } from "@appsmith/selectors/tenantSelectors";
|
2023-04-10 07:02:31 +00:00
|
|
|
import { getAssetUrl } from "@appsmith/utils/airgapHelpers";
|
2022-12-09 14:43:47 +00:00
|
|
|
|
2023-10-11 07:35:24 +00:00
|
|
|
interface ContainerProps {
|
2022-12-09 14:43:47 +00:00
|
|
|
title: string;
|
|
|
|
|
subtitle?: React.ReactNode;
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
footer?: React.ReactNode;
|
|
|
|
|
disabledLoginForm?: boolean;
|
2023-08-26 04:22:23 +00:00
|
|
|
testId?: string;
|
2023-10-11 07:35:24 +00:00
|
|
|
}
|
2022-12-09 14:43:47 +00:00
|
|
|
|
|
|
|
|
function Container(props: ContainerProps) {
|
2023-08-26 04:22:23 +00:00
|
|
|
const { children, footer, subtitle, testId, title } = props;
|
2022-12-09 14:43:47 +00:00
|
|
|
const tenantConfig = useSelector(getTenantConfig);
|
|
|
|
|
|
|
|
|
|
return (
|
2023-08-26 04:22:23 +00:00
|
|
|
<div
|
|
|
|
|
className="flex flex-col items-center gap-4 my-auto min-w-min"
|
|
|
|
|
data-testid={testId}
|
|
|
|
|
>
|
2023-05-19 18:37:06 +00:00
|
|
|
<div className="bg-white border border-t-4 border-[color:var(--ads-v2\-color-border)] border-t-[color:var(--ads-v2\-color-border-brand)] py-8 px-6 w-[min(400px,80%)] flex flex-col gap-6 t--login-container rounded-[var(--ads-v2\-border-radius)]">
|
2023-04-10 07:02:31 +00:00
|
|
|
<img
|
|
|
|
|
className="h-8 mx-auto"
|
|
|
|
|
src={getAssetUrl(tenantConfig.brandLogoUrl)}
|
|
|
|
|
/>
|
2022-12-09 14:43:47 +00:00
|
|
|
<div className="flex flex-col gap-2 text-center">
|
2023-05-19 18:37:06 +00:00
|
|
|
<h1 className="text-xl font-semibold text-center text-[color:var(--ads-v2\-color-fg-emphasis)]">
|
|
|
|
|
{title}
|
|
|
|
|
</h1>
|
|
|
|
|
{subtitle && (
|
|
|
|
|
<p className="text-base text-center text-[color:var(--ads-v2\-color-fg)]">
|
|
|
|
|
{subtitle}
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
2022-12-09 14:43:47 +00:00
|
|
|
</div>
|
|
|
|
|
{children}
|
|
|
|
|
</div>
|
|
|
|
|
|
2023-05-19 18:37:06 +00:00
|
|
|
<div className="bg-white border w-[min(400px,80%)] rounded-[var(--ads-v2\-border-radius)] border-[color:var(--ads-v2\-color-border)]">
|
2022-12-09 14:43:47 +00:00
|
|
|
{footer}
|
|
|
|
|
<FooterLinks />
|
|
|
|
|
</div>
|
2022-12-15 09:29:26 +00:00
|
|
|
</div>
|
2022-12-09 14:43:47 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Container;
|