add back button

This commit is contained in:
peintnermax
2024-07-11 15:56:41 +02:00
parent 21e7e3b72f
commit 488e806ad3
2 changed files with 20 additions and 3 deletions

View 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;
}

View File

@@ -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"