Rename LoginForm to SignInForm for consistency
The form and its Relay operation were named after the Figma "Login Form" layer, but the rest of the feature speaks "sign in" (SignInDialog, auth.signIn.*, the visible copy). Align the name so the dialog and its form share one prefix. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -25,7 +25,7 @@ import { DialogPopup } from "@probo/ui/src/v2/Dialog/DialogPopup";
|
||||
import { DialogTitle } from "@probo/ui/src/v2/Dialog/DialogTitle";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { LoginForm } from "./LoginForm";
|
||||
import { SignInForm } from "./SignInForm";
|
||||
|
||||
interface SignInDialogProps {
|
||||
open: boolean;
|
||||
@@ -35,7 +35,7 @@ interface SignInDialogProps {
|
||||
}
|
||||
|
||||
// The reusable "Login Dialog" from the design: a modal sign-in gate composed of
|
||||
// the kit Dialog plus the magic-link / SSO login form.
|
||||
// the kit Dialog plus the magic-link / SSO sign-in form.
|
||||
export function SignInDialog({ open, onOpenChange, continueTo }: SignInDialogProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -46,7 +46,7 @@ export function SignInDialog({ open, onOpenChange, continueTo }: SignInDialogPro
|
||||
<DialogTitle>{t("auth.signIn.title")}</DialogTitle>
|
||||
<DialogDescription>{t("auth.signIn.description")}</DialogDescription>
|
||||
</DialogHeader>
|
||||
<LoginForm continueTo={continueTo} onCancel={() => onOpenChange(false)} />
|
||||
<SignInForm continueTo={continueTo} onCancel={() => onOpenChange(false)} />
|
||||
</DialogPopup>
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
@@ -34,20 +34,20 @@ import { graphql } from "relay-runtime";
|
||||
import { getSafeContinueUrl } from "#/lib/auth/continueUrl";
|
||||
import { useMutation } from "#/lib/relay/useMutation";
|
||||
|
||||
import type { LoginFormMutation } from "./__generated__/LoginFormMutation.graphql";
|
||||
import type { SignInFormMutation } from "./__generated__/SignInFormMutation.graphql";
|
||||
import { OIDCProviders } from "./OIDCProviders";
|
||||
|
||||
const RESEND_COOLDOWN_SECONDS = 60;
|
||||
|
||||
const sendMagicLinkMutation = graphql`
|
||||
mutation LoginFormMutation($input: SendMagicLinkInput!) {
|
||||
mutation SignInFormMutation($input: SendMagicLinkInput!) {
|
||||
sendMagicLink(input: $input) {
|
||||
success
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
interface LoginFormProps {
|
||||
interface SignInFormProps {
|
||||
// Absolute URL to return to after authentication (carries the request-all
|
||||
// marker so an access request resumes once signed in).
|
||||
continueTo: string;
|
||||
@@ -56,14 +56,14 @@ interface LoginFormProps {
|
||||
|
||||
// Sign-in form used inside the dialog: SSO providers, then a magic-link email
|
||||
// flow. On success it flips to a "check your email" state with a resend timer.
|
||||
export function LoginForm({ continueTo, onCancel }: LoginFormProps) {
|
||||
export function SignInForm({ continueTo, onCancel }: SignInFormProps) {
|
||||
const { t } = useTranslation();
|
||||
const toast = Toast.useToastManager();
|
||||
const [magicLinkSent, setMagicLinkSent] = useState(false);
|
||||
const [secondsLeft, setSecondsLeft] = useState(RESEND_COOLDOWN_SECONDS);
|
||||
const intervalRef = useRef<ReturnType<typeof setInterval>>(undefined);
|
||||
|
||||
const [sendMagicLink, isSending] = useMutation<LoginFormMutation>(
|
||||
const [sendMagicLink, isSending] = useMutation<SignInFormMutation>(
|
||||
sendMagicLinkMutation,
|
||||
{ errorToast: false },
|
||||
);
|
||||
Reference in New Issue
Block a user