mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-06 00:49:42 -06:00
fix: templates page back button (#6088)
Co-authored-by: Piyush Gupta <56182734+gupta-piyush19@users.noreply.github.com> Co-authored-by: Anshuman Pandey <54475686+pandeymangg@users.noreply.github.com> Co-authored-by: Matti Nannt <mail@matthiasnannt.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Victor Santos <victor@formbricks.com>
This commit is contained in:
committed by
GitHub
parent
ce47b4c2d8
commit
882ad99ed7
@@ -5,7 +5,11 @@ import { useTranslate } from "@tolgee/react";
|
||||
import { ArrowLeftIcon } from "lucide-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export const BackButton = () => {
|
||||
interface BackButtonProps {
|
||||
path?: string;
|
||||
}
|
||||
|
||||
export const BackButton = ({ path }: BackButtonProps) => {
|
||||
const router = useRouter();
|
||||
const { t } = useTranslate();
|
||||
return (
|
||||
@@ -13,7 +17,11 @@ export const BackButton = () => {
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
router.back();
|
||||
if (path) {
|
||||
router.push(path);
|
||||
} else {
|
||||
router.back();
|
||||
}
|
||||
}}>
|
||||
<ArrowLeftIcon />
|
||||
{t("common.back")}
|
||||
|
||||
@@ -7,7 +7,7 @@ export const MenuBar = () => {
|
||||
<>
|
||||
<div className="border-b border-slate-200 bg-white px-5 py-2.5 sm:flex sm:items-center sm:justify-between">
|
||||
<div className="flex items-center space-x-2 whitespace-nowrap">
|
||||
<BackButton />
|
||||
<BackButton path="/" />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user