Add Sonner-based notifications and UX polish
This commit is contained in:
@@ -2,7 +2,6 @@ import { redirect } from "next/navigation";
|
||||
|
||||
import { MotionFade } from "@/components/motion-fade";
|
||||
import { ContactProtectionForm } from "@/components/root/contact-protection-form";
|
||||
import { FlashMessage } from "@/components/root/flash-message";
|
||||
import { RootDashboardShell } from "@/components/root/root-dashboard-shell";
|
||||
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
|
||||
import { getContactProtectionFormValues } from "@/lib/app-config";
|
||||
@@ -26,16 +25,7 @@ const copy = {
|
||||
backToSite: "Zur Website",
|
||||
};
|
||||
|
||||
type RootSMTPProtectionPageProps = {
|
||||
searchParams?: {
|
||||
success?: string;
|
||||
error?: string;
|
||||
};
|
||||
};
|
||||
|
||||
export default async function RootSMTPProtectionPage({
|
||||
searchParams,
|
||||
}: RootSMTPProtectionPageProps) {
|
||||
export default async function RootSMTPProtectionPage() {
|
||||
if (!isAdminAuthenticated()) {
|
||||
redirect("/root");
|
||||
}
|
||||
@@ -58,21 +48,8 @@ export default async function RootSMTPProtectionPage({
|
||||
headerTitle={copy.title}
|
||||
headerDescription={copy.subtitle}
|
||||
saveFormId="contact-protection-form"
|
||||
reloadDocumentOnSave
|
||||
>
|
||||
<div className="space-y-6">
|
||||
{searchParams?.success ? (
|
||||
<MotionFade delay={0.1}>
|
||||
<FlashMessage type="success" message={searchParams.success} />
|
||||
</MotionFade>
|
||||
) : null}
|
||||
|
||||
{searchParams?.error ? (
|
||||
<MotionFade delay={0.12}>
|
||||
<FlashMessage type="error" message={searchParams.error} />
|
||||
</MotionFade>
|
||||
) : null}
|
||||
|
||||
<MotionFade delay={0.16}>
|
||||
<ContactProtectionForm
|
||||
action={saveContactProtectionSettingsAction}
|
||||
|
||||
+1
-22
@@ -1,7 +1,6 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { MotionFade } from "@/components/motion-fade";
|
||||
import { FlashMessage } from "@/components/root/flash-message";
|
||||
import { RootDashboardShell } from "@/components/root/root-dashboard-shell";
|
||||
import { SMTPSettingsForm } from "@/components/root/smtp-settings-form";
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -27,14 +26,7 @@ const copy = {
|
||||
backToSite: "Zur Website",
|
||||
};
|
||||
|
||||
type RootSMTPPageProps = {
|
||||
searchParams?: {
|
||||
success?: string;
|
||||
error?: string;
|
||||
};
|
||||
};
|
||||
|
||||
export default async function RootSMTPPage({ searchParams }: RootSMTPPageProps) {
|
||||
export default async function RootSMTPPage() {
|
||||
if (!isAdminAuthenticated()) {
|
||||
redirect("/root");
|
||||
}
|
||||
@@ -57,7 +49,6 @@ export default async function RootSMTPPage({ searchParams }: RootSMTPPageProps)
|
||||
headerTitle={copy.title}
|
||||
headerDescription={copy.subtitle}
|
||||
saveFormId="smtp-settings-form"
|
||||
reloadDocumentOnSave
|
||||
headerActions={(
|
||||
<form action={sendTestEmailAction}>
|
||||
<Button type="submit" variant="outline">
|
||||
@@ -67,18 +58,6 @@ export default async function RootSMTPPage({ searchParams }: RootSMTPPageProps)
|
||||
)}
|
||||
>
|
||||
<div className="space-y-6">
|
||||
{searchParams?.success ? (
|
||||
<MotionFade delay={0.1}>
|
||||
<FlashMessage type="success" message={searchParams.success} />
|
||||
</MotionFade>
|
||||
) : null}
|
||||
|
||||
{searchParams?.error ? (
|
||||
<MotionFade delay={0.12}>
|
||||
<FlashMessage type="error" message={searchParams.error} />
|
||||
</MotionFade>
|
||||
) : null}
|
||||
|
||||
<MotionFade delay={0.16}>
|
||||
<SMTPSettingsForm
|
||||
action={saveMailSettingsAction}
|
||||
|
||||
Reference in New Issue
Block a user