Add Sonner-based notifications and UX polish
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { FlashMessage } from "@/components/root/flash-message";
|
||||
import { MarqueeSettingsForm } from "@/components/root/marquee-settings-form";
|
||||
import { RootDashboardShell } from "@/components/root/root-dashboard-shell";
|
||||
import { MotionFade } from "@/components/motion-fade";
|
||||
@@ -26,16 +25,7 @@ const copy = {
|
||||
backToSite: "Zur Website",
|
||||
};
|
||||
|
||||
type RootMarqueePageProps = {
|
||||
searchParams?: {
|
||||
success?: string;
|
||||
error?: string;
|
||||
};
|
||||
};
|
||||
|
||||
export default async function RootMarqueePage({
|
||||
searchParams,
|
||||
}: RootMarqueePageProps) {
|
||||
export default async function RootMarqueePage() {
|
||||
if (!isAdminAuthenticated()) {
|
||||
redirect("/root");
|
||||
}
|
||||
@@ -57,21 +47,8 @@ export default async function RootMarqueePage({
|
||||
headerTitle={copy.title}
|
||||
headerDescription={copy.subtitle}
|
||||
saveFormId="marquee-settings-form"
|
||||
reloadDocumentOnSave
|
||||
>
|
||||
<div className="space-y-6">
|
||||
{searchParams?.success ? (
|
||||
<MotionFade delay={0.08}>
|
||||
<FlashMessage type="success" message={searchParams.success} />
|
||||
</MotionFade>
|
||||
) : null}
|
||||
|
||||
{searchParams?.error ? (
|
||||
<MotionFade delay={0.1}>
|
||||
<FlashMessage type="error" message={searchParams.error} />
|
||||
</MotionFade>
|
||||
) : null}
|
||||
|
||||
<MotionFade delay={0.14}>
|
||||
<MarqueeSettingsForm
|
||||
action={saveMarqueeSettingsAction}
|
||||
|
||||
Reference in New Issue
Block a user