From 6cd07c70aac19bee08f187aba76818a03375e49d Mon Sep 17 00:00:00 2001 From: peintnermax Date: Thu, 8 Aug 2024 10:29:17 +0200 Subject: [PATCH] register button improvement --- apps/login/src/app/(login)/loginname/page.tsx | 20 ++++++------- apps/login/src/ui/SignInWithIDP.tsx | 4 --- apps/login/src/ui/UsernameForm.tsx | 28 +++++++++++-------- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/apps/login/src/app/(login)/loginname/page.tsx b/apps/login/src/app/(login)/loginname/page.tsx index ee2139aff4e..7d04c3924b9 100644 --- a/apps/login/src/app/(login)/loginname/page.tsx +++ b/apps/login/src/app/(login)/loginname/page.tsx @@ -51,16 +51,16 @@ export default async function Page({ organization={organization} submit={submit} allowRegister={!!loginSettings?.allowRegister} - /> - - {legal && identityProviders && process.env.ZITADEL_API_URL && ( - - )} + > + {legal && identityProviders && process.env.ZITADEL_API_URL && ( + + )} + ); diff --git a/apps/login/src/ui/SignInWithIDP.tsx b/apps/login/src/ui/SignInWithIDP.tsx index eee49e25720..55677301a76 100644 --- a/apps/login/src/ui/SignInWithIDP.tsx +++ b/apps/login/src/ui/SignInWithIDP.tsx @@ -143,10 +143,6 @@ export function SignInWithIDP({ {error} )} -
- - -
); } diff --git a/apps/login/src/ui/UsernameForm.tsx b/apps/login/src/ui/UsernameForm.tsx index a470d77aec7..96b719bdfaf 100644 --- a/apps/login/src/ui/UsernameForm.tsx +++ b/apps/login/src/ui/UsernameForm.tsx @@ -11,6 +11,7 @@ import { LoginSettings, PasskeysType, } from "@zitadel/proto/zitadel/settings/v2/login_settings_pb"; +import BackButton from "./BackButton"; type Inputs = { loginName: string; @@ -23,6 +24,7 @@ type Props = { organization?: string; submit: boolean; allowRegister: boolean; + children?: React.ReactNode; }; export default function UsernameForm({ @@ -32,6 +34,7 @@ export default function UsernameForm({ organization, submit, allowRegister, + children, }: Props) { const { register, handleSubmit, formState } = useForm({ mode: "onBlur", @@ -220,6 +223,16 @@ export default function UsernameForm({ {...register("loginName", { required: "This field is required" })} label="Loginname" /> + {allowRegister && ( + + )} {error && ( @@ -228,17 +241,10 @@ export default function UsernameForm({ )} -
- {allowRegister && ( - - )} +
{children}
+ +
+