feat: New UI for SignUp / Login (#16802)

This commit is contained in:
Benny Joo authored and GitHub committed 2024-09-26 15:27:56 -04:00
1 parent ffa58d1cdb
commit 90f6c7e239
9 files changed
+343 -221

No files matched your search

+10 -3
View File
@@ -7,6 +7,7 @@ import { HOSTED_CAL_FEATURES } from "@calcom/lib/constants";
import { LastUsed, useLastUsed } from "@calcom/lib/hooks/useLastUsed";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
import type { ButtonProps } from "@calcom/ui";
import { Button } from "@calcom/ui";
interface Props {
@@ -19,7 +20,12 @@ const schema = z.object({
email: z.string().email({ message: "Please enter a valid email" }),
});
export function SAMLLogin({ samlTenantID, samlProductID, setErrorMessage }: Props) {
export function SAMLLogin({
samlTenantID,
samlProductID,
setErrorMessage,
...buttonProps
}: Props & ButtonProps) {
const { t } = useLocale();
const methods = useFormContext();
const [lastUsed, setLastUsed] = useLastUsed();
@@ -38,7 +44,7 @@ export function SAMLLogin({ samlTenantID, samlProductID, setErrorMessage }: Prop
<Button
StartIcon="lock"
color="secondary"
data-testid="saml"
data-testid="samlAndOidc"
className="flex w-full justify-center"
onClick={async (event) => {
event.preventDefault();
@@ -64,7 +70,8 @@ export function SAMLLogin({ samlTenantID, samlProductID, setErrorMessage }: Prop
mutation.mutate({
email,
});
}}>
}}
{...buttonProps}>
<span>{t("signin_with_saml_oidc")}</span>
{lastUsed === "saml" && <LastUsed />}
</Button>