- implement disable_email_auth env var

- add sync crowdin translations github action
This commit is contained in:
Amruth Pillai
2023-11-21 09:44:37 +01:00
parent 635f743e56
commit 1825fc3283
84 changed files with 2693 additions and 2341 deletions

View File

@ -14,6 +14,7 @@ import {
FormMessage,
Input,
} from "@reactive-resume/ui";
import { cn } from "@reactive-resume/utils";
import { useRef } from "react";
import { Helmet } from "react-helmet-async";
import { useForm } from "react-hook-form";
@ -21,12 +22,16 @@ import { Link } from "react-router-dom";
import { z } from "zod";
import { useLogin } from "@/client/services/auth";
import { useAuthProviders } from "@/client/services/auth/providers";
type FormValues = z.infer<typeof loginSchema>;
export const LoginPage = () => {
const { login, loading } = useLogin();
const { providers } = useAuthProviders();
const emailAuthDisabled = !providers || !providers.includes("email");
const formRef = useRef<HTMLFormElement>(null);
usePasswordToggle(formRef);
@ -53,7 +58,7 @@ export const LoginPage = () => {
<div className="space-y-1.5">
<h2 className="text-2xl font-semibold tracking-tight">{t`Sign in to your account`}</h2>
<h6>
<h6 className={cn(emailAuthDisabled && "hidden")}>
<span className="opacity-75">{t`Don't have an account?`}</span>
<Button asChild variant="link" className="px-1.5">
<Link to="/auth/register">
@ -64,7 +69,7 @@ export const LoginPage = () => {
</h6>
</div>
<div>
<div className={cn(emailAuthDisabled && "hidden")}>
<Form {...form}>
<form
ref={formRef}