Add Sonner-based notifications and UX polish

This commit is contained in:
MOH
2026-03-10 17:43:26 +01:00
parent eceb0f3a54
commit 77cc9dca87
32 changed files with 279 additions and 310 deletions
+1 -24
View File
@@ -1,7 +1,5 @@
import { redirect } from "next/navigation";
import { MotionFade } from "@/components/motion-fade";
import { FlashMessage } from "@/components/root/flash-message";
import { PortfolioCategoriesManager } from "@/components/root/portfolio-categories-manager";
import { RootDashboardShell } from "@/components/root/root-dashboard-shell";
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
@@ -24,16 +22,7 @@ const copy = {
backToSite: "Zur Website",
};
type RootPortfolioCategoriesPageProps = {
searchParams?: {
success?: string;
error?: string;
};
};
export default async function RootPortfolioCategoriesPage({
searchParams,
}: RootPortfolioCategoriesPageProps) {
export default async function RootPortfolioCategoriesPage() {
if (!isAdminAuthenticated()) {
redirect("/root");
}
@@ -59,18 +48,6 @@ export default async function RootPortfolioCategoriesPage({
headerDescription={copy.subtitle}
>
<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}
<PortfolioCategoriesManager
categories={categories}
activeCount={activeCount}
-14
View File
@@ -1,8 +1,6 @@
import { redirect } from "next/navigation";
import { RootDashboardShell } from "@/components/root/root-dashboard-shell";
import { MotionFade } from "@/components/motion-fade";
import { FlashMessage } from "@/components/root/flash-message";
import { PortfolioProjectsOverview } from "@/components/root/portfolio-projects-overview";
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
import { getAdminPortfolioCategories, getAdminPortfolioProjects } from "@/lib/portfolio";
@@ -67,18 +65,6 @@ export default async function RootPortfolioPage({ searchParams }: RootPortfolioP
headerDescription={copy.subtitle}
>
<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}
<PortfolioProjectsOverview
categories={categories}
projects={projects}
-18
View File
@@ -1,7 +1,6 @@
import { redirect } from "next/navigation";
import { MotionFade } from "@/components/motion-fade";
import { FlashMessage } from "@/components/root/flash-message";
import { PortfolioProjectForm } from "@/components/root/portfolio-project-form";
import { RootDashboardShell } from "@/components/root/root-dashboard-shell";
import { AppCard } from "@/components/ui/app-card";
@@ -39,15 +38,10 @@ type RootPortfolioProjectPageProps = {
params: {
id: string;
};
searchParams?: {
success?: string;
error?: string;
};
};
export default async function RootPortfolioProjectPage({
params,
searchParams,
}: RootPortfolioProjectPageProps) {
if (!isAdminAuthenticated()) {
redirect("/root");
@@ -82,18 +76,6 @@ export default async function RootPortfolioProjectPage({
saveButtonLabel={copy.saveProject}
>
<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.15}>
<PortfolioProjectForm
action={saveProjectAction}
+1 -16
View File
@@ -1,7 +1,6 @@
import { redirect } from "next/navigation";
import { MotionFade } from "@/components/motion-fade";
import { FlashMessage } from "@/components/root/flash-message";
import { PortfolioProjectForm } from "@/components/root/portfolio-project-form";
import { RootDashboardShell } from "@/components/root/root-dashboard-shell";
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
@@ -25,15 +24,7 @@ const copy = {
backToSite: "Zur Website",
};
type RootNewPortfolioProjectPageProps = {
searchParams?: {
error?: string;
};
};
export default async function RootNewPortfolioProjectPage({
searchParams,
}: RootNewPortfolioProjectPageProps) {
export default async function RootNewPortfolioProjectPage() {
if (!isAdminAuthenticated()) {
redirect("/root");
}
@@ -61,12 +52,6 @@ export default async function RootNewPortfolioProjectPage({
saveFormId="portfolio-project-form"
>
<div className="space-y-6">
{searchParams?.error ? (
<MotionFade delay={0.1}>
<FlashMessage type="error" message={searchParams.error} />
</MotionFade>
) : null}
<MotionFade delay={0.15}>
<PortfolioProjectForm
action={saveProjectAction}
-16
View File
@@ -1,7 +1,5 @@
import { redirect } from "next/navigation";
import { MotionFade } from "@/components/motion-fade";
import { FlashMessage } from "@/components/root/flash-message";
import { PortfolioProjectsOverview } from "@/components/root/portfolio-projects-overview";
import { RootDashboardShell } from "@/components/root/root-dashboard-shell";
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
@@ -26,8 +24,6 @@ type RootPortfolioProjectsPageProps = {
searchParams?: {
category?: string;
status?: "all" | "draft" | "published";
success?: string;
error?: string;
};
};
@@ -69,18 +65,6 @@ export default async function RootPortfolioProjectsPage({
headerDescription={copy.subtitle}
>
<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}
<PortfolioProjectsOverview
categories={categories}
projects={projects}