mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 08:32:39 +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,
|
||||
AuthenticationMethodType,
|
||||
} from "@zitadel/server";
|
||||
import BackButton from "./BackButton";
|
||||
|
||||
type Inputs = {
|
||||
password: string;
|
||||
@@ -213,9 +214,7 @@ export default function PasswordForm({
|
||||
)}
|
||||
|
||||
<div className="mt-8 flex w-full flex-row items-center">
|
||||
{/* <Button type="button" variant={ButtonVariants.Secondary}>
|
||||
back
|
||||
</Button> */}
|
||||
<BackButton />
|
||||
<span className="flex-grow"></span>
|
||||
<Button
|
||||
type="submit"
|
||||
|
||||
Reference in New Issue
Block a user