mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:07:32 +00:00
i18n
This commit is contained in:
@@ -6,7 +6,6 @@ import {
|
|||||||
IdentityProvider,
|
IdentityProvider,
|
||||||
IdentityProviderType,
|
IdentityProviderType,
|
||||||
} from "@zitadel/proto/zitadel/settings/v2/login_settings_pb";
|
} from "@zitadel/proto/zitadel/settings/v2/login_settings_pb";
|
||||||
import { useTranslations } from "next-intl";
|
|
||||||
import { ReactNode, useActionState } from "react";
|
import { ReactNode, useActionState } from "react";
|
||||||
import { Alert } from "./alert";
|
import { Alert } from "./alert";
|
||||||
import { SignInWithIdentityProviderProps } from "./idps/base-button";
|
import { SignInWithIdentityProviderProps } from "./idps/base-button";
|
||||||
@@ -16,6 +15,7 @@ import { SignInWithGeneric } from "./idps/sign-in-with-generic";
|
|||||||
import { SignInWithGithub } from "./idps/sign-in-with-github";
|
import { SignInWithGithub } from "./idps/sign-in-with-github";
|
||||||
import { SignInWithGitlab } from "./idps/sign-in-with-gitlab";
|
import { SignInWithGitlab } from "./idps/sign-in-with-gitlab";
|
||||||
import { SignInWithGoogle } from "./idps/sign-in-with-google";
|
import { SignInWithGoogle } from "./idps/sign-in-with-google";
|
||||||
|
import { Translated } from "./translated";
|
||||||
|
|
||||||
export interface SignInWithIDPProps {
|
export interface SignInWithIDPProps {
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
@@ -32,7 +32,6 @@ export function SignInWithIdp({
|
|||||||
linkOnly,
|
linkOnly,
|
||||||
}: Readonly<SignInWithIDPProps>) {
|
}: Readonly<SignInWithIDPProps>) {
|
||||||
const [state, action, _isPending] = useActionState(redirectToIdp, {});
|
const [state, action, _isPending] = useActionState(redirectToIdp, {});
|
||||||
const t = useTranslations("idp");
|
|
||||||
|
|
||||||
const renderIDPButton = (idp: IdentityProvider, index: number) => {
|
const renderIDPButton = (idp: IdentityProvider, index: number) => {
|
||||||
const { id, name, type } = idp;
|
const { id, name, type } = idp;
|
||||||
@@ -78,7 +77,9 @@ export function SignInWithIdp({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col w-full space-y-2 text-sm">
|
<div className="flex flex-col w-full space-y-2 text-sm">
|
||||||
<p className="text-center ztdl-p">{t("orSignInWith")}</p>
|
<p className="text-center ztdl-p">
|
||||||
|
<Translated i18nKey="orSignInWith" namespace="idp" />
|
||||||
|
</p>
|
||||||
{!!identityProviders.length && identityProviders?.map(renderIDPButton)}
|
{!!identityProviders.length && identityProviders?.map(renderIDPButton)}
|
||||||
{state?.error && (
|
{state?.error && (
|
||||||
<div className="py-4">
|
<div className="py-4">
|
||||||
|
Reference in New Issue
Block a user