mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 10:04:25 +00:00
add back button
This commit is contained in:
18
apps/login/src/ui/BackButton.tsx
Normal file
18
apps/login/src/ui/BackButton.tsx
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import Link from "next/link";
|
||||||
|
import { Button, ButtonVariants } from "./Button";
|
||||||
|
|
||||||
|
type Props = { hasBack?: boolean };
|
||||||
|
|
||||||
|
export default function BackButton({ hasBack }: Props) {
|
||||||
|
return hasBack || history?.length > 1 ? (
|
||||||
|
<Button
|
||||||
|
onClick={() => history.back()}
|
||||||
|
type="button"
|
||||||
|
variant={ButtonVariants.Secondary}
|
||||||
|
>
|
||||||
|
back
|
||||||
|
</Button>
|
||||||
|
) : null;
|
||||||
|
}
|
||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
Checks,
|
Checks,
|
||||||
AuthenticationMethodType,
|
AuthenticationMethodType,
|
||||||
} from "@zitadel/server";
|
} from "@zitadel/server";
|
||||||
|
import BackButton from "./BackButton";
|
||||||
|
|
||||||
type Inputs = {
|
type Inputs = {
|
||||||
password: string;
|
password: string;
|
||||||
@@ -213,9 +214,7 @@ export default function PasswordForm({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="mt-8 flex w-full flex-row items-center">
|
<div className="mt-8 flex w-full flex-row items-center">
|
||||||
{/* <Button type="button" variant={ButtonVariants.Secondary}>
|
<BackButton />
|
||||||
back
|
|
||||||
</Button> */}
|
|
||||||
<span className="flex-grow"></span>
|
<span className="flex-grow"></span>
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|||||||
Reference in New Issue
Block a user