refactor: update disabled form UI to use Card component and remove redundant Toaster from layout
This commit is contained in:
+8
-4
@@ -185,10 +185,14 @@ export function FormFillerClient({ form, questions, initialAnswers = {} }: FormF
|
|||||||
return (
|
return (
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
{!form.isOpen && (
|
{!form.isOpen && (
|
||||||
<div className="absolute inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm rounded-xl">
|
<div className="fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm p-4">
|
||||||
<div className="bg-background border shadow-lg p-6 rounded-lg">
|
<Card className="w-full max-w-sm">
|
||||||
<h2 className="text-xl font-bold text-center">This form disable for now</h2>
|
<CardHeader>
|
||||||
</div>
|
<CardTitle className="text-center text-xl">
|
||||||
|
This form is disabled for now
|
||||||
|
</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<form onSubmit={handleSubmit} className="space-y-6">
|
<form onSubmit={handleSubmit} className="space-y-6">
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { getServerSession } from "next-auth";
|
import { getServerSession } from "next-auth";
|
||||||
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
|
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
|
||||||
import { Toaster } from "@/components/ui/sonner";
|
|
||||||
import { FormLayoutClient } from "./client";
|
import { FormLayoutClient } from "./client";
|
||||||
import LoginDialog from "@/components/login-dialog";
|
import LoginDialog from "@/components/login-dialog";
|
||||||
|
|
||||||
@@ -25,7 +24,6 @@ export default async function FormLayout({
|
|||||||
)}
|
)}
|
||||||
</header>
|
</header>
|
||||||
<main className="flex-1">{children}</main>
|
<main className="flex-1">{children}</main>
|
||||||
<Toaster />
|
|
||||||
{!session && <LoginDialog />}
|
{!session && <LoginDialog />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user