Finalize multilingual routing and translations
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-03-07 14:10:30 +01:00
parent 1ad9ae9629
commit 7f4277d1d7
53 changed files with 2805 additions and 1382 deletions
+93 -98
View File
@@ -1,7 +1,13 @@
import type { Metadata } from "next";
import { Compass, Layers3, Users } from "lucide-react";
import { getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade";
import { resolveLocale } from "@/lib/site-data";
import { buildLocalizedMetadata } from "@/lib/metadata";
import { resolveLocale } from "@/lib/locale";
import { AppCard } from "@/components/ui/app-card";
import { CardContent } from "@/components/ui/card";
type AboutPageProps = {
params: {
@@ -9,114 +15,103 @@ type AboutPageProps = {
};
};
export default function AboutPage({ params: { locale } }: AboutPageProps) {
export async function generateMetadata({
params: { locale },
}: AboutPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "aboutPage" });
const copy =
localeKey === "de"
? {
title: "Ueber uns",
intro:
"Wir bauen klare digitale Erlebnisse fuer Marken, Produkte und Teams.",
valuesTitle: "Wie wir arbeiten",
valueA: "Strategie zuerst",
valueAText: "Jedes Projekt startet mit Zielbild, Scope und Prioritaeten.",
valueB: "Saubere Systeme",
valueBText: "Wir setzen auf wartbare Komponenten und klare Strukturen.",
valueC: "Enge Zusammenarbeit",
valueCText: "Kurze Schleifen mit direktem Feedback im gesamten Ablauf.",
processTitle: "Unser Ablauf",
processOne: "Discovery und Zieldefinition",
processTwo: "Design und Prototyping",
processThree: "Build, Test und Launch",
}
: {
title: "About",
intro:
"We build clear digital experiences for brands, products and teams.",
valuesTitle: "How we work",
valueA: "Strategy first",
valueAText: "Each project starts with goals, scope and priorities.",
valueB: "Clean systems",
valueBText: "We rely on maintainable components and clear structure.",
valueC: "Close collaboration",
valueCText: "Short loops with direct feedback across the full process.",
processTitle: "Our process",
processOne: "Discovery and goal definition",
processTwo: "Design and prototyping",
processThree: "Build, test and launch",
};
return buildLocalizedMetadata({
locale: localeKey,
pathname: "/about",
title: t("title"),
description: t("intro"),
});
}
export default async function AboutPage({ params: { locale } }: AboutPageProps) {
const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "aboutPage" });
return (
<div className="mx-auto flex w-full max-w-6xl flex-col gap-8 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<Container className="flex flex-col gap-section py-10 lg:py-14">
<MotionFade>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-10">
<h1 className="text-3xl font-semibold text-fg sm:text-4xl">
{copy.title}
</h1>
<p className="mt-4 max-w-3xl text-base text-muted sm:text-lg">
{copy.intro}
</p>
</section>
<AppCard level={3}>
<CardContent className="p-6 lg:p-10">
<h1 className="text-3xl font-semibold text-foreground sm:text-4xl">
{t("title")}
</h1>
<p className="mt-4 max-w-3xl text-base text-muted-foreground sm:text-lg">
{t("intro")}
</p>
</CardContent>
</AppCard>
</MotionFade>
<MotionFade delay={0.05}>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-8">
<h2 className="text-2xl font-semibold text-fg">
{copy.valuesTitle}
</h2>
<div className="mt-6 grid gap-4 md:grid-cols-3">
<article className="rounded-2xl border border-default bg-surface-soft p-5 ">
<Compass className="h-5 w-5 text-muted-strong" />
<h3 className="mt-3 text-lg font-semibold text-fg">
{copy.valueA}
</h3>
<p className="mt-2 text-sm text-muted">
{copy.valueAText}
</p>
</article>
<article className="rounded-2xl border border-default bg-surface-soft p-5 ">
<Layers3 className="h-5 w-5 text-muted-strong" />
<h3 className="mt-3 text-lg font-semibold text-fg">
{copy.valueB}
</h3>
<p className="mt-2 text-sm text-muted">
{copy.valueBText}
</p>
</article>
<article className="rounded-2xl border border-default bg-surface-soft p-5 ">
<Users className="h-5 w-5 text-muted-strong" />
<h3 className="mt-3 text-lg font-semibold text-fg">
{copy.valueC}
</h3>
<p className="mt-2 text-sm text-muted">
{copy.valueCText}
</p>
</article>
</div>
</section>
<AppCard>
<CardContent className="p-6 lg:p-8">
<h2 className="text-2xl font-semibold text-foreground">
{t("valuesTitle")}
</h2>
<div className="mt-6 grid gap-4 md:grid-cols-3">
{[
{
icon: Compass,
title: t("valueA"),
text: t("valueAText"),
},
{
icon: Layers3,
title: t("valueB"),
text: t("valueBText"),
},
{
icon: Users,
title: t("valueC"),
text: t("valueCText"),
},
].map((item) => {
const Icon = item.icon;
return (
<AppCard key={item.title} level={2}>
<CardContent className="p-5">
<Icon className="h-5 w-5 text-brand-primary" />
<h3 className="mt-3 text-lg font-semibold text-foreground">
{item.title}
</h3>
<p className="mt-2 text-sm text-muted-foreground">{item.text}</p>
</CardContent>
</AppCard>
);
})}
</div>
</CardContent>
</AppCard>
</MotionFade>
<MotionFade delay={0.1}>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-8">
<h2 className="text-2xl font-semibold text-fg">
{copy.processTitle}
</h2>
<ol className="mt-5 grid gap-3 sm:grid-cols-3">
{[copy.processOne, copy.processTwo, copy.processThree].map((step, index) => (
<li
key={step}
className="rounded-xl border border-default bg-surface-soft p-4 text-sm text-muted-strong text-muted-strong"
>
<span className="mb-2 inline-flex h-6 w-6 items-center justify-center rounded-full bg-surface-elevated text-xs font-semibold text-muted-strong">
{index + 1}
</span>
<p>{step}</p>
</li>
))}
</ol>
</section>
<AppCard>
<CardContent className="p-6 lg:p-8">
<h2 className="text-2xl font-semibold text-foreground">
{t("processTitle")}
</h2>
<ol className="mt-5 grid gap-3 sm:grid-cols-3">
{[t("processOne"), t("processTwo"), t("processThree")].map((step, index) => (
<AppCard key={step} level={2}>
<CardContent className="p-4">
<span className="mb-2 inline-flex h-6 w-6 items-center justify-center rounded-pill bg-surface-1 text-xs font-semibold text-foreground/80">
{index + 1}
</span>
<p className="text-sm text-foreground/80">{step}</p>
</CardContent>
</AppCard>
))}
</ol>
</CardContent>
</AppCard>
</MotionFade>
</div>
</Container>
);
}
+48 -55
View File
@@ -1,13 +1,18 @@
import type { Metadata } from "next";
import { Mail, MapPin, Phone } from "lucide-react";
import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade";
import { resolveLocale } from "@/lib/site-data";
import { Button } from "@/src/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/src/components/ui/card";
import { Input } from "@/src/components/ui/input";
import { Label } from "@/src/components/ui/label";
import { Textarea } from "@/src/components/ui/textarea";
import { buildLocalizedMetadata } from "@/lib/metadata";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { AppCard } from "@/components/ui/app-card";
import { Button } from "@/components/ui/button";
import { CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";
type ContactPageProps = {
params: {
@@ -15,92 +20,80 @@ type ContactPageProps = {
};
};
export default function ContactPage({ params: { locale } }: ContactPageProps) {
export async function generateMetadata({
params: { locale },
}: ContactPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "contactPage" });
const copy =
localeKey === "de"
? {
title: "Kontakt",
intro: "Schreib uns kurz dein Ziel und wir melden uns zeitnah.",
name: "Name",
email: "E-Mail",
message: "Nachricht",
submit: "Senden",
preview: "Success Seite ansehen",
phone: "+49 30 123456",
mail: "hello@moh-sass.dev",
city: "Berlin, Germany",
}
: {
title: "Contact",
intro: "Share your goal and we will get back quickly.",
name: "Name",
email: "Email",
message: "Message",
submit: "Submit",
preview: "Open success page",
phone: "+49 30 123456",
mail: "hello@moh-sass.dev",
city: "Berlin, Germany",
};
return buildLocalizedMetadata({
locale: localeKey,
pathname: "/contact",
title: t("title"),
description: t("intro"),
});
}
export default async function ContactPage({ params: { locale } }: ContactPageProps) {
const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "contactPage" });
return (
<div className="mx-auto grid w-full max-w-6xl gap-6 px-4 py-10 sm:px-6 lg:grid-cols-2 lg:px-8 lg:py-14">
<Container className="grid gap-6 py-10 lg:grid-cols-2 lg:py-14">
<MotionFade>
<Card>
<AppCard level={3}>
<CardHeader>
<CardTitle className="text-3xl sm:text-4xl">{copy.title}</CardTitle>
<p className="text-base text-muted-foreground sm:text-lg">{copy.intro}</p>
<CardTitle className="text-3xl sm:text-4xl">{t("title")}</CardTitle>
<p className="text-base text-muted-foreground sm:text-lg">{t("intro")}</p>
</CardHeader>
<CardContent>
<ul className="space-y-3 text-sm text-foreground/85">
<li className="inline-flex items-center gap-2">
<Phone className="h-4 w-4" />
{copy.phone}
<Phone className="h-4 w-4 text-brand-primary" />
+49 30 123456
</li>
<li className="inline-flex items-center gap-2">
<Mail className="h-4 w-4" />
{copy.mail}
<Mail className="h-4 w-4 text-brand-primary" />
hello@moh-sass.dev
</li>
<li className="inline-flex items-center gap-2">
<MapPin className="h-4 w-4" />
{copy.city}
<MapPin className="h-4 w-4 text-brand-primary" />
{t("city")}
</li>
</ul>
</CardContent>
</Card>
</AppCard>
</MotionFade>
<MotionFade delay={0.05}>
<Card>
<AppCard>
<CardContent className="pt-6">
<form className="grid gap-4">
<Label className="grid gap-2">
{copy.name}
<Input type="text" placeholder={copy.name} />
{t("name")}
<Input type="text" placeholder={t("name")} />
</Label>
<Label className="grid gap-2">
{copy.email}
<Input type="email" placeholder={copy.email} />
{t("email")}
<Input type="email" placeholder={t("email")} />
</Label>
<Label className="grid gap-2">
{copy.message}
<Textarea rows={5} placeholder={copy.message} />
{t("message")}
<Textarea rows={5} placeholder={t("message")} />
</Label>
<div className="flex flex-wrap gap-3">
<Button type="button">{copy.submit}</Button>
<Button type="button">{t("submit")}</Button>
<Button asChild variant="outline">
<Link href={`/${localeKey}/success`}>{copy.preview}</Link>
<Link href={getLocalizedPath(localeKey, "/success")}>{t("preview")}</Link>
</Button>
</div>
</form>
</CardContent>
</Card>
</AppCard>
</MotionFade>
</div>
</Container>
);
}
+6 -6
View File
@@ -2,11 +2,11 @@ import type { ReactNode } from "react";
import { unstable_noStore as noStore } from "next/cache";
import { redirect } from "next/navigation";
import { Footer } from "@/components/footer";
import { Navbar } from "@/components/navbar";
import { SiteFooter } from "@/components/layout/site-footer";
import { SiteHeader } from "@/components/layout/site-header";
import { isAdminAuthenticated } from "@/lib/admin-auth";
import { getMaintenanceMode } from "@/lib/app-config";
import { resolveLocale } from "@/lib/site-data";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
type SiteLayoutProps = {
children: ReactNode;
@@ -26,14 +26,14 @@ export default async function SiteLayout({ children, params: { locale } }: SiteL
const authenticated = isAdminAuthenticated();
if (maintenanceEnabled && !authenticated) {
redirect(`/${localeKey}/coming-soon`);
redirect(getLocalizedPath(localeKey, "/coming-soon"));
}
return (
<div className="flex min-h-screen flex-col">
<Navbar isAdmin={authenticated} />
<SiteHeader isAdmin={authenticated} />
<main className="flex-1">{children}</main>
<Footer isAdmin={authenticated} />
<SiteFooter isAdmin={authenticated} />
</div>
);
}
+92 -102
View File
@@ -1,3 +1,4 @@
import type { Metadata } from "next";
import {
ArrowRight,
BriefcaseBusiness,
@@ -6,11 +7,16 @@ import {
Sparkles,
} from "lucide-react";
import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade";
import { pickText, portfolioItems, productItems, resolveLocale } from "@/lib/site-data";
import { Button } from "@/src/components/ui/button";
import { Card, CardContent } from "@/src/components/ui/card";
import { buildLocalizedMetadata } from "@/lib/metadata";
import { AppCard } from "@/components/ui/app-card";
import { Button } from "@/components/ui/button";
import { CardContent } from "@/components/ui/card";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { pickText, portfolioItems, productItems } from "@/lib/site-data";
type HomePageProps = {
params: {
@@ -18,194 +24,178 @@ type HomePageProps = {
};
};
export default function HomePage({ params: { locale } }: HomePageProps) {
export async function generateMetadata({
params: { locale },
}: HomePageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "homepage" });
return buildLocalizedMetadata({
locale: localeKey,
pathname: "/",
title: t("heroTitle"),
description: t("heroText"),
});
}
export default async function HomePage({ params: { locale } }: HomePageProps) {
const localeKey = resolveLocale(locale);
const featuredProjects = portfolioItems.slice(0, 3);
const featuredProducts = productItems.slice(0, 3);
const copy =
localeKey === "de"
? {
heroKicker: "Digital Studio",
heroTitle: "Webseiten und Produkte, die schnell liefern.",
heroText:
"Diese Startseite ist die Basis fuer ein mehrsprachiges Marketing- und Produkt-Setup.",
portfolioTitle: "Featured Projects",
portfolioText: "Platzhalter fuer ausgewaehlte Kundenprojekte.",
productsTitle: "Featured Products",
productsText: "Platzhalter fuer die wichtigsten Produktangebote.",
ctaTitle: "Bereit fuer den naechsten Schritt?",
ctaText: "Wir planen zusammen den passenden Scope fuer dein Projekt.",
toPortfolio: "Portfolio ansehen",
toProducts: "Produkte ansehen",
toContact: "Kontakt aufnehmen",
heroCardTitle: "Schneller Rollout",
heroCardText: "Struktur, Content und Komponenten fuer schnelles Wachstum.",
}
: {
heroKicker: "Digital Studio",
heroTitle: "Websites and products that ship fast.",
heroText:
"This homepage is a starter for a multilingual marketing and product setup.",
portfolioTitle: "Featured Projects",
portfolioText: "Placeholder area for highlighted client projects.",
productsTitle: "Featured Products",
productsText: "Placeholder area for top product offerings.",
ctaTitle: "Ready for your next step?",
ctaText: "We can shape the right project scope together.",
toPortfolio: "View portfolio",
toProducts: "View products",
toContact: "Contact us",
heroCardTitle: "Fast rollout",
heroCardText: "Structure, content and components for rapid growth.",
};
const t = await getTranslations({ locale: localeKey, namespace: "homepage" });
return (
<div className="mx-auto flex w-full max-w-6xl flex-col gap-8 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<Container className="flex flex-col gap-section py-10 lg:py-14">
<MotionFade>
<Card>
<CardContent className="grid gap-6 p-6 lg:grid-cols-[1.3fr_0.7fr] lg:p-10">
<AppCard level={3}>
<CardContent className="grid gap-6 p-6 lg:grid-cols-[1.35fr_0.65fr] lg:p-10">
<div className="space-y-5">
<p className="inline-flex items-center gap-2 text-sm font-medium text-muted">
<Sparkles className="h-4 w-4" />
{copy.heroKicker}
<p className="inline-flex items-center gap-2 text-sm font-medium text-muted-foreground">
<Sparkles className="h-4 w-4 text-brand-secondary" />
{t("heroKicker")}
</p>
<h1 className="text-3xl font-semibold tracking-tight text-fg sm:text-5xl">
{copy.heroTitle}
<h1 className="text-balance text-3xl font-semibold tracking-tight text-foreground sm:text-5xl">
{t("heroTitle")}
</h1>
<p className="max-w-2xl text-base text-muted sm:text-lg">
{copy.heroText}
<p className="max-w-2xl text-base text-muted-foreground sm:text-lg">
{t("heroText")}
</p>
<div className="flex flex-wrap gap-3">
<Button asChild>
<Link href={`/${localeKey}/portfolio`}>
{copy.toPortfolio}
<Link href={getLocalizedPath(localeKey, "/portfolio")}>
{t("toPortfolio")}
<ArrowRight className="h-4 w-4" />
</Link>
</Button>
<Button asChild variant="outline">
<Link href={`/${localeKey}/products`}>{copy.toProducts}</Link>
<Link href={getLocalizedPath(localeKey, "/products")}>{t("toProducts")}</Link>
</Button>
</div>
</div>
<div className="rounded-[var(--radius-input)] border border-border bg-muted p-5">
<p className="mb-3 inline-flex items-center gap-2 text-sm font-medium text-muted">
<BriefcaseBusiness className="h-4 w-4" />
{copy.heroCardTitle}
<AppCard level={2} padding="md" className="self-start">
<p className="inline-flex items-center gap-2 text-sm font-medium text-muted-foreground">
<BriefcaseBusiness className="h-4 w-4 text-brand-primary" />
{t("heroCardTitle")}
</p>
<p className="text-sm leading-relaxed text-muted">
{copy.heroCardText}
<p className="mt-3 text-sm leading-relaxed text-muted-foreground">
{t("heroCardText")}
</p>
</div>
</AppCard>
</CardContent>
</Card>
</AppCard>
</MotionFade>
<MotionFade delay={0.05}>
<Card>
<AppCard>
<CardContent className="p-6 lg:p-8">
<div className="mb-6 flex items-center justify-between gap-4">
<div>
<h2 className="text-2xl font-semibold text-fg">
{copy.portfolioTitle}
<h2 className="text-2xl font-semibold text-foreground">
{t("portfolioTitle")}
</h2>
<p className="mt-2 text-sm text-muted">
{copy.portfolioText}
<p className="mt-2 text-sm text-muted-foreground">
{t("portfolioText")}
</p>
</div>
<BriefcaseBusiness className="h-5 w-5 text-subtle" />
<BriefcaseBusiness className="h-5 w-5 text-muted-foreground" />
</div>
<div className="grid gap-4 md:grid-cols-3">
{featuredProjects.map((item) => (
<Card key={item.slug} className="bg-muted/85 transition hover:border-input">
<CardContent className="p-4">
<Link href={`/${localeKey}/portfolio/${item.slug}`} className="group block">
<p className="text-sm text-subtle">
<AppCard key={item.slug} interactive>
<CardContent className="p-5">
<Link
href={getLocalizedPath(localeKey, `/portfolio/${item.slug}`)}
className="group block"
>
<p className="text-sm text-muted-foreground/80">
{pickText(item.category, localeKey)} - {item.year}
</p>
<h3 className="mt-2 text-lg font-semibold text-fg">
<h3 className="mt-2 text-lg font-semibold text-foreground">
{pickText(item.title, localeKey)}
</h3>
<p className="mt-2 text-sm text-muted">
<p className="mt-2 text-sm text-muted-foreground">
{pickText(item.summary, localeKey)}
</p>
<span className="group-hover-fg mt-4 inline-flex items-center gap-2 text-sm font-medium text-muted-strong">
{copy.toPortfolio}
<span className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-foreground/80 group-hover:text-foreground">
{t("toPortfolio")}
<ArrowRight className="h-4 w-4" />
</span>
</Link>
</CardContent>
</Card>
</AppCard>
))}
</div>
</CardContent>
</Card>
</AppCard>
</MotionFade>
<MotionFade delay={0.1}>
<Card>
<AppCard>
<CardContent className="p-6 lg:p-8">
<div className="mb-6 flex items-center justify-between gap-4">
<div>
<h2 className="text-2xl font-semibold text-fg">
{copy.productsTitle}
<h2 className="text-2xl font-semibold text-foreground">
{t("productsTitle")}
</h2>
<p className="mt-2 text-sm text-muted">
{copy.productsText}
<p className="mt-2 text-sm text-muted-foreground">
{t("productsText")}
</p>
</div>
<Boxes className="h-5 w-5 text-subtle" />
<Boxes className="h-5 w-5 text-muted-foreground" />
</div>
<div className="grid gap-4 md:grid-cols-3">
{featuredProducts.map((item) => (
<Card key={item.slug} className="bg-muted/85 transition hover:border-input">
<CardContent className="p-4">
<Link href={`/${localeKey}/products/${item.slug}`} className="group block">
<p className="text-sm text-subtle">
<AppCard key={item.slug} interactive>
<CardContent className="p-5">
<Link
href={getLocalizedPath(localeKey, `/products/${item.slug}`)}
className="group block"
>
<p className="text-sm text-muted-foreground/80">
{pickText(item.segment, localeKey)}
</p>
<h3 className="mt-2 text-lg font-semibold text-fg">
<h3 className="mt-2 text-lg font-semibold text-foreground">
{pickText(item.name, localeKey)}
</h3>
<p className="mt-2 text-sm text-muted">
<p className="mt-2 text-sm text-muted-foreground">
{pickText(item.summary, localeKey)}
</p>
<p className="mt-3 text-sm font-medium text-muted-strong">
<p className="mt-3 text-sm font-medium text-foreground/80">
{pickText(item.price, localeKey)}
</p>
</Link>
</CardContent>
</Card>
</AppCard>
))}
</div>
</CardContent>
</Card>
</AppCard>
</MotionFade>
<MotionFade delay={0.15}>
<Card className="bg-foreground text-background">
<AppCard level="inverse">
<CardContent className="p-6 lg:p-8">
<div className="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
<div>
<p className="inline-flex items-center gap-2 text-sm font-medium opacity-80">
<p className="inline-flex items-center gap-2 text-sm font-medium text-surface-inverse-foreground/80">
<Mail className="h-4 w-4" />
{copy.ctaTitle}
{t("ctaTitle")}
</p>
<p className="mt-2 max-w-2xl text-sm opacity-90 sm:text-base">
{copy.ctaText}
<p className="mt-2 max-w-2xl text-sm text-surface-inverse-foreground/88 sm:text-base">
{t("ctaText")}
</p>
</div>
<Button asChild variant="secondary">
<Link href={`/${localeKey}/contact`}>
{copy.toContact}
<Link href={getLocalizedPath(localeKey, "/contact")}>
{t("toContact")}
<ArrowRight className="h-4 w-4" />
</Link>
</Button>
</div>
</CardContent>
</Card>
</AppCard>
</MotionFade>
</div>
</Container>
);
}
+103 -89
View File
@@ -1,10 +1,18 @@
import type { Metadata } from "next";
import { ArrowLeft, CalendarDays, FolderKanban, Tag } from "lucide-react";
import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { notFound } from "next/navigation";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade";
import { routing } from "@/i18n/routing";
import { getPortfolioItem, pickText, portfolioItems, resolveLocale } from "@/lib/site-data";
import { buildLocalizedMetadata } from "@/lib/metadata";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { getPortfolioItem, pickText, portfolioItems } from "@/lib/site-data";
import { AppCard } from "@/components/ui/app-card";
import { Button } from "@/components/ui/button";
import { CardContent } from "@/components/ui/card";
type PortfolioItemPageProps = {
params: {
@@ -22,7 +30,30 @@ export function generateStaticParams() {
);
}
export default function PortfolioItemPage({
export async function generateMetadata({
params: { locale, slug },
}: PortfolioItemPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale);
const item = getPortfolioItem(slug);
if (!item) {
return buildLocalizedMetadata({
locale: localeKey,
pathname: `/portfolio/${slug}`,
title: "Portfolio",
description: "Portfolio item",
});
}
return buildLocalizedMetadata({
locale: localeKey,
pathname: `/portfolio/${slug}`,
title: pickText(item.title, localeKey),
description: pickText(item.summary, localeKey),
});
}
export default async function PortfolioItemPage({
params: { locale, slug },
}: PortfolioItemPageProps) {
const localeKey = resolveLocale(locale);
@@ -32,100 +63,83 @@ export default function PortfolioItemPage({
notFound();
}
const copy =
localeKey === "de"
? {
back: "Zurueck zum Portfolio",
challenge: "Herausforderung",
solution: "Loesung",
outcome: "Ergebnis",
challengeText:
"Das Projekt brauchte eine klare Informationsarchitektur und schnellere Ladezeiten.",
solutionText:
"Wir haben Design, Komponenten und Content in einem modularen System aufgebaut.",
outcomeText:
"Das Team kann Inhalte schneller ausrollen und Nutzer finden schneller zum Ziel.",
}
: {
back: "Back to portfolio",
challenge: "Challenge",
solution: "Solution",
outcome: "Outcome",
challengeText:
"The project needed clearer information architecture and faster performance.",
solutionText:
"We built design, components and content in a modular system.",
outcomeText:
"The team ships content faster and users reach goals more quickly.",
};
const t = await getTranslations({ locale: localeKey, namespace: "portfolioDetail" });
return (
<div className="mx-auto flex w-full max-w-5xl flex-col gap-8 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<Container size="wide" className="flex flex-col gap-section py-10 lg:py-14">
<MotionFade>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-10">
<Link
href={`/${localeKey}/portfolio`}
className="inline-flex items-center gap-2 text-sm text-muted transition hover:text-fg"
>
<ArrowLeft className="h-4 w-4" />
{copy.back}
</Link>
<h1 className="mt-5 text-3xl font-semibold text-fg sm:text-4xl">
{pickText(item.title, localeKey)}
</h1>
<p className="mt-4 text-base text-muted sm:text-lg">
{pickText(item.summary, localeKey)}
</p>
<AppCard level={3}>
<CardContent className="p-6 lg:p-10">
<Button asChild variant="ghost" className="h-auto px-0 py-0 text-sm">
<Link href={getLocalizedPath(localeKey, "/portfolio")}>
<ArrowLeft className="h-4 w-4" />
{t("back")}
</Link>
</Button>
<div className="mt-6 flex flex-wrap gap-3 text-sm text-muted">
<span className="inline-flex items-center gap-2 rounded-lg border border-default bg-surface-soft px-3 py-2 ">
<Tag className="h-4 w-4" />
{pickText(item.category, localeKey)}
</span>
<span className="inline-flex items-center gap-2 rounded-lg border border-default bg-surface-soft px-3 py-2 ">
<CalendarDays className="h-4 w-4" />
{item.year}
</span>
<span className="inline-flex items-center gap-2 rounded-lg border border-default bg-surface-soft px-3 py-2 ">
<FolderKanban className="h-4 w-4" />
{item.slug}
</span>
</div>
</section>
<h1 className="mt-5 text-3xl font-semibold text-foreground sm:text-4xl">
{pickText(item.title, localeKey)}
</h1>
<p className="mt-4 text-base text-muted-foreground sm:text-lg">
{pickText(item.summary, localeKey)}
</p>
<div className="mt-6 flex flex-wrap gap-3 text-sm text-foreground/80">
{[
{
icon: Tag,
label: pickText(item.category, localeKey),
},
{
icon: CalendarDays,
label: item.year,
},
{
icon: FolderKanban,
label: item.slug,
},
].map((meta) => {
const Icon = meta.icon;
return (
<AppCard key={meta.label} level={2}>
<CardContent className="flex items-center gap-2 p-3">
<Icon className="h-4 w-4 text-brand-primary" />
{meta.label}
</CardContent>
</AppCard>
);
})}
</div>
</CardContent>
</AppCard>
</MotionFade>
<div className="grid gap-4 md:grid-cols-3">
<MotionFade delay={0.05}>
<article className="rounded-2xl border border-default bg-surface p-5 ">
<h2 className="text-lg font-semibold text-fg">
{copy.challenge}
</h2>
<p className="mt-2 text-sm text-muted">
{copy.challengeText}
</p>
</article>
</MotionFade>
<MotionFade delay={0.1}>
<article className="rounded-2xl border border-default bg-surface p-5 ">
<h2 className="text-lg font-semibold text-fg">
{copy.solution}
</h2>
<p className="mt-2 text-sm text-muted">
{copy.solutionText}
</p>
</article>
</MotionFade>
<MotionFade delay={0.15}>
<article className="rounded-2xl border border-default bg-surface p-5 ">
<h2 className="text-lg font-semibold text-fg">
{copy.outcome}
</h2>
<p className="mt-2 text-sm text-muted">
{copy.outcomeText}
</p>
</article>
</MotionFade>
{[
{
title: t("challenge"),
text: t("challengeText"),
},
{
title: t("solution"),
text: t("solutionText"),
},
{
title: t("outcome"),
text: t("outcomeText"),
},
].map((section, index) => (
<MotionFade key={section.title} delay={0.05 * (index + 1)}>
<AppCard>
<CardContent className="p-5">
<h2 className="text-lg font-semibold text-foreground">{section.title}</h2>
<p className="mt-2 text-sm text-muted-foreground">{section.text}</p>
</CardContent>
</AppCard>
</MotionFade>
))}
</div>
</div>
</Container>
);
}
+66 -51
View File
@@ -1,8 +1,15 @@
import type { Metadata } from "next";
import { ArrowUpRight, CalendarDays, FolderKanban } from "lucide-react";
import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade";
import { pickText, portfolioItems, resolveLocale } from "@/lib/site-data";
import { buildLocalizedMetadata } from "@/lib/metadata";
import { AppCard } from "@/components/ui/app-card";
import { CardContent } from "@/components/ui/card";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { pickText, portfolioItems } from "@/lib/site-data";
type PortfolioPageProps = {
params: {
@@ -10,68 +17,76 @@ type PortfolioPageProps = {
};
};
export default function PortfolioPage({ params: { locale } }: PortfolioPageProps) {
export async function generateMetadata({
params: { locale },
}: PortfolioPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "portfolioPage" });
const copy =
localeKey === "de"
? {
title: "Portfolio",
intro: "Eine Auswahl von Projekten mit Fokus auf Klarheit und Ergebnis.",
open: "Projekt oeffnen",
}
: {
title: "Portfolio",
intro: "Selected projects with a focus on clarity and outcomes.",
open: "Open project",
};
return buildLocalizedMetadata({
locale: localeKey,
pathname: "/portfolio",
title: t("title"),
description: t("intro"),
});
}
export default async function PortfolioPage({ params: { locale } }: PortfolioPageProps) {
const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "portfolioPage" });
return (
<div className="mx-auto flex w-full max-w-6xl flex-col gap-8 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<Container className="flex flex-col gap-section py-10 lg:py-14">
<MotionFade>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-10">
<div className="flex items-center gap-3">
<FolderKanban className="h-5 w-5 text-muted-strong" />
<h1 className="text-3xl font-semibold text-fg sm:text-4xl">
{copy.title}
</h1>
</div>
<p className="mt-4 max-w-3xl text-base text-muted sm:text-lg">
{copy.intro}
</p>
</section>
<AppCard level={3}>
<CardContent className="p-6 lg:p-10">
<div className="flex items-center gap-3">
<FolderKanban className="h-5 w-5 text-brand-primary" />
<h1 className="text-3xl font-semibold text-foreground sm:text-4xl">
{t("title")}
</h1>
</div>
<p className="mt-4 max-w-3xl text-base text-muted-foreground sm:text-lg">
{t("intro")}
</p>
</CardContent>
</AppCard>
</MotionFade>
<section className="grid gap-4 md:grid-cols-2">
{portfolioItems.map((item, index) => (
<MotionFade key={item.slug} delay={index * 0.05}>
<Link
href={`/${localeKey}/portfolio/${item.slug}`}
className="group block rounded-2xl border border-default bg-surface p-5 transition group-hover-border-strong "
>
<div className="flex items-center justify-between gap-3">
<p className="text-sm text-subtle">
{pickText(item.category, localeKey)}
</p>
<p className="inline-flex items-center gap-1 text-xs text-subtle">
<CalendarDays className="h-3.5 w-3.5" />
{item.year}
</p>
</div>
<h2 className="mt-3 text-xl font-semibold text-fg">
{pickText(item.title, localeKey)}
</h2>
<p className="mt-2 text-sm text-muted">
{pickText(item.summary, localeKey)}
</p>
<p className="group-hover-fg mt-4 inline-flex items-center gap-2 text-sm font-medium text-muted-strong">
{copy.open}
<ArrowUpRight className="h-4 w-4" />
</p>
</Link>
<AppCard interactive>
<CardContent className="p-5">
<Link
href={getLocalizedPath(localeKey, `/portfolio/${item.slug}`)}
className="group block"
>
<div className="flex items-center justify-between gap-3">
<p className="text-sm text-muted-foreground/80">
{pickText(item.category, localeKey)}
</p>
<p className="inline-flex items-center gap-1 text-xs text-muted-foreground/80">
<CalendarDays className="h-3.5 w-3.5" />
{item.year}
</p>
</div>
<h2 className="mt-3 text-xl font-semibold text-foreground">
{pickText(item.title, localeKey)}
</h2>
<p className="mt-2 text-sm text-muted-foreground">
{pickText(item.summary, localeKey)}
</p>
<p className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-foreground/80 group-hover:text-foreground">
{t("open")}
<ArrowUpRight className="h-4 w-4" />
</p>
</Link>
</CardContent>
</AppCard>
</MotionFade>
))}
</section>
</div>
</Container>
);
}
+99 -75
View File
@@ -1,10 +1,18 @@
import type { Metadata } from "next";
import { ArrowLeft, BadgeEuro, Boxes, Layers2 } from "lucide-react";
import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { notFound } from "next/navigation";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade";
import { routing } from "@/i18n/routing";
import { getProductItem, pickText, productItems, resolveLocale } from "@/lib/site-data";
import { buildLocalizedMetadata } from "@/lib/metadata";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { getProductItem, pickText, productItems } from "@/lib/site-data";
import { AppCard } from "@/components/ui/app-card";
import { Button } from "@/components/ui/button";
import { CardContent } from "@/components/ui/card";
type ProductPageProps = {
params: {
@@ -22,7 +30,30 @@ export function generateStaticParams() {
);
}
export default function ProductPage({ params: { locale, slug } }: ProductPageProps) {
export async function generateMetadata({
params: { locale, slug },
}: ProductPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale);
const item = getProductItem(slug);
if (!item) {
return buildLocalizedMetadata({
locale: localeKey,
pathname: `/products/${slug}`,
title: "Products",
description: "Product page",
});
}
return buildLocalizedMetadata({
locale: localeKey,
pathname: `/products/${slug}`,
title: pickText(item.name, localeKey),
description: pickText(item.summary, localeKey),
});
}
export default async function ProductPage({ params: { locale, slug } }: ProductPageProps) {
const localeKey = resolveLocale(locale);
const item = getProductItem(slug);
@@ -30,87 +61,80 @@ export default function ProductPage({ params: { locale, slug } }: ProductPagePro
notFound();
}
const copy =
localeKey === "de"
? {
back: "Zurueck zu Produkten",
included: "Inklusive",
stepOne: "Kickoff und Scope Klarheit",
stepTwo: "Setup von Design und Komponenten",
stepThree: "Implementierung und Uebergabe",
action: "Kontakt fuer Angebot",
}
: {
back: "Back to products",
included: "Included",
stepOne: "Kickoff and scope clarity",
stepTwo: "Design and component setup",
stepThree: "Implementation and handover",
action: "Contact for proposal",
};
const t = await getTranslations({ locale: localeKey, namespace: "productDetail" });
return (
<div className="mx-auto flex w-full max-w-5xl flex-col gap-8 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<Container size="wide" className="flex flex-col gap-section py-10 lg:py-14">
<MotionFade>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-10">
<Link
href={`/${localeKey}/products`}
className="inline-flex items-center gap-2 text-sm text-muted transition hover:text-fg"
>
<ArrowLeft className="h-4 w-4" />
{copy.back}
</Link>
<AppCard level={3}>
<CardContent className="p-6 lg:p-10">
<Button asChild variant="ghost" className="h-auto px-0 py-0 text-sm">
<Link href={getLocalizedPath(localeKey, "/products")}>
<ArrowLeft className="h-4 w-4" />
{t("back")}
</Link>
</Button>
<h1 className="mt-5 text-3xl font-semibold text-fg sm:text-4xl">
{pickText(item.name, localeKey)}
</h1>
<p className="mt-4 text-base text-muted sm:text-lg">
{pickText(item.summary, localeKey)}
</p>
<h1 className="mt-5 text-3xl font-semibold text-foreground sm:text-4xl">
{pickText(item.name, localeKey)}
</h1>
<p className="mt-4 text-base text-muted-foreground sm:text-lg">
{pickText(item.summary, localeKey)}
</p>
<div className="mt-6 flex flex-wrap gap-3 text-sm text-muted">
<span className="inline-flex items-center gap-2 rounded-lg border border-default bg-surface-soft px-3 py-2 ">
<Layers2 className="h-4 w-4" />
{pickText(item.segment, localeKey)}
</span>
<span className="inline-flex items-center gap-2 rounded-lg border border-default bg-surface-soft px-3 py-2 ">
<BadgeEuro className="h-4 w-4" />
{pickText(item.price, localeKey)}
</span>
<span className="inline-flex items-center gap-2 rounded-lg border border-default bg-surface-soft px-3 py-2 ">
<Boxes className="h-4 w-4" />
{item.slug}
</span>
</div>
</section>
<div className="mt-6 flex flex-wrap gap-3 text-sm text-foreground/80">
{[
{
icon: Layers2,
label: pickText(item.segment, localeKey),
},
{
icon: BadgeEuro,
label: pickText(item.price, localeKey),
},
{
icon: Boxes,
label: item.slug,
},
].map((meta) => {
const Icon = meta.icon;
return (
<AppCard key={meta.label} level={2}>
<CardContent className="flex items-center gap-2 p-3">
<Icon className="h-4 w-4 text-brand-primary" />
{meta.label}
</CardContent>
</AppCard>
);
})}
</div>
</CardContent>
</AppCard>
</MotionFade>
<MotionFade delay={0.05}>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-8">
<h2 className="text-xl font-semibold text-fg">
{copy.included}
</h2>
<ul className="mt-4 grid gap-3 sm:grid-cols-3">
{[copy.stepOne, copy.stepTwo, copy.stepThree].map((step, index) => (
<li
key={step}
className="rounded-xl border border-default bg-surface-soft p-4 text-sm text-muted-strong text-muted-strong"
>
<span className="mb-2 inline-flex h-6 w-6 items-center justify-center rounded-full bg-surface-elevated text-xs font-semibold text-muted-strong">
{index + 1}
</span>
<p>{step}</p>
</li>
))}
</ul>
<Link
href={`/${localeKey}/contact`}
className="mt-6 inline-flex rounded-lg bg-inverse px-4 py-2.5 text-sm font-medium text-inverse transition hover:opacity-90 "
>
{copy.action}
</Link>
</section>
<AppCard>
<CardContent className="p-6 lg:p-8">
<h2 className="text-xl font-semibold text-foreground">{t("included")}</h2>
<ul className="mt-4 grid gap-3 sm:grid-cols-3">
{[t("stepOne"), t("stepTwo"), t("stepThree")].map((step, index) => (
<AppCard key={step} level={2}>
<CardContent className="p-4">
<span className="mb-2 inline-flex h-6 w-6 items-center justify-center rounded-pill bg-surface-1 text-xs font-semibold text-foreground/80">
{index + 1}
</span>
<p className="text-sm text-foreground/80">{step}</p>
</CardContent>
</AppCard>
))}
</ul>
<Button asChild className="mt-6">
<Link href={getLocalizedPath(localeKey, "/contact")}>{t("action")}</Link>
</Button>
</CardContent>
</AppCard>
</MotionFade>
</div>
</Container>
);
}
+64 -49
View File
@@ -1,8 +1,15 @@
import type { Metadata } from "next";
import { ArrowUpRight, Boxes, CircleDollarSign } from "lucide-react";
import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade";
import { pickText, productItems, resolveLocale } from "@/lib/site-data";
import { buildLocalizedMetadata } from "@/lib/metadata";
import { AppCard } from "@/components/ui/app-card";
import { CardContent } from "@/components/ui/card";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { pickText, productItems } from "@/lib/site-data";
type ProductsPageProps = {
params: {
@@ -10,66 +17,74 @@ type ProductsPageProps = {
};
};
export default function ProductsPage({ params: { locale } }: ProductsPageProps) {
export async function generateMetadata({
params: { locale },
}: ProductsPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "productsPage" });
const copy =
localeKey === "de"
? {
title: "Produkte",
intro: "Pakete fuer Teams von Start bis Skalierung.",
open: "Produkt oeffnen",
}
: {
title: "Products",
intro: "Packages for teams from early stage to scale.",
open: "Open product",
};
return buildLocalizedMetadata({
locale: localeKey,
pathname: "/products",
title: t("title"),
description: t("intro"),
});
}
export default async function ProductsPage({ params: { locale } }: ProductsPageProps) {
const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "productsPage" });
return (
<div className="mx-auto flex w-full max-w-6xl flex-col gap-8 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<Container className="flex flex-col gap-section py-10 lg:py-14">
<MotionFade>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-10">
<div className="flex items-center gap-3">
<Boxes className="h-5 w-5 text-muted-strong" />
<h1 className="text-3xl font-semibold text-fg sm:text-4xl">
{copy.title}
</h1>
</div>
<p className="mt-4 max-w-3xl text-base text-muted sm:text-lg">
{copy.intro}
</p>
</section>
<AppCard level={3}>
<CardContent className="p-6 lg:p-10">
<div className="flex items-center gap-3">
<Boxes className="h-5 w-5 text-brand-primary" />
<h1 className="text-3xl font-semibold text-foreground sm:text-4xl">
{t("title")}
</h1>
</div>
<p className="mt-4 max-w-3xl text-base text-muted-foreground sm:text-lg">
{t("intro")}
</p>
</CardContent>
</AppCard>
</MotionFade>
<section className="grid gap-4 md:grid-cols-3">
{productItems.map((item, index) => (
<MotionFade key={item.slug} delay={index * 0.05}>
<Link
href={`/${localeKey}/products/${item.slug}`}
className="group block rounded-2xl border border-default bg-surface p-5 transition group-hover-border-strong "
>
<p className="text-sm text-subtle">
{pickText(item.segment, localeKey)}
</p>
<h2 className="mt-3 text-xl font-semibold text-fg">
{pickText(item.name, localeKey)}
</h2>
<p className="mt-2 text-sm text-muted">
{pickText(item.summary, localeKey)}
</p>
<p className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-muted-strong">
<CircleDollarSign className="h-4 w-4" />
{pickText(item.price, localeKey)}
</p>
<p className="group-hover-fg mt-4 inline-flex items-center gap-2 text-sm font-medium text-muted-strong">
{copy.open}
<ArrowUpRight className="h-4 w-4" />
</p>
</Link>
<AppCard interactive>
<CardContent className="p-5">
<Link
href={getLocalizedPath(localeKey, `/products/${item.slug}`)}
className="group block"
>
<p className="text-sm text-muted-foreground/80">
{pickText(item.segment, localeKey)}
</p>
<h2 className="mt-3 text-xl font-semibold text-foreground">
{pickText(item.name, localeKey)}
</h2>
<p className="mt-2 text-sm text-muted-foreground">
{pickText(item.summary, localeKey)}
</p>
<p className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-foreground/80">
<CircleDollarSign className="h-4 w-4 text-brand-secondary" />
{pickText(item.price, localeKey)}
</p>
<p className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-foreground/80 group-hover:text-foreground">
{t("open")}
<ArrowUpRight className="h-4 w-4" />
</p>
</Link>
</CardContent>
</AppCard>
</MotionFade>
))}
</section>
</div>
</Container>
);
}
+44 -41
View File
@@ -1,8 +1,15 @@
import type { Metadata } from "next";
import { CheckCircle2 } from "lucide-react";
import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade";
import { resolveLocale } from "@/lib/site-data";
import { buildLocalizedMetadata } from "@/lib/metadata";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { AppCard } from "@/components/ui/app-card";
import { Button } from "@/components/ui/button";
import { CardContent } from "@/components/ui/card";
type SuccessPageProps = {
params: {
@@ -10,51 +17,47 @@ type SuccessPageProps = {
};
};
export default function SuccessPage({ params: { locale } }: SuccessPageProps) {
export async function generateMetadata({
params: { locale },
}: SuccessPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "successPage" });
const copy =
localeKey === "de"
? {
title: "Danke fuer deine Nachricht",
text: "Wir haben deine Anfrage erhalten und melden uns zeitnah.",
home: "Zur Startseite",
contact: "Zur Kontaktseite",
}
: {
title: "Thank you for your message",
text: "We received your request and will reply shortly.",
home: "Go to homepage",
contact: "Back to contact",
};
return buildLocalizedMetadata({
locale: localeKey,
pathname: "/success",
title: t("title"),
description: t("text"),
});
}
export default async function SuccessPage({ params: { locale } }: SuccessPageProps) {
const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "successPage" });
return (
<div className="mx-auto flex w-full max-w-4xl px-4 py-12 sm:px-6 lg:px-8 lg:py-16">
<Container size="narrow" className="py-12 lg:py-16">
<MotionFade className="w-full">
<section className="w-full rounded-3xl border border-default bg-surface p-8 text-center ">
<CheckCircle2 className="mx-auto h-12 w-12 text-emerald-500" />
<h1 className="mt-4 text-3xl font-semibold text-fg sm:text-4xl">
{copy.title}
</h1>
<p className="mx-auto mt-3 max-w-2xl text-base text-muted">
{copy.text}
</p>
<div className="mt-6 flex flex-wrap items-center justify-center gap-3">
<Link
href={`/${localeKey}`}
className="inline-flex rounded-lg bg-inverse px-4 py-2.5 text-sm font-medium text-inverse transition hover:opacity-90 "
>
{copy.home}
</Link>
<Link
href={`/${localeKey}/contact`}
className="inline-flex rounded-lg border border-strong px-4 py-2.5 text-sm font-medium text-muted-strong transition hover-surface-soft text-muted-strong"
>
{copy.contact}
</Link>
</div>
</section>
<AppCard level={3}>
<CardContent className="p-8 text-center">
<CheckCircle2 className="mx-auto h-12 w-12 text-status-success" />
<h1 className="mt-4 text-3xl font-semibold text-foreground sm:text-4xl">
{t("title")}
</h1>
<p className="mx-auto mt-3 max-w-2xl text-base text-muted-foreground">
{t("text")}
</p>
<div className="mt-6 flex flex-wrap items-center justify-center gap-3">
<Button asChild>
<Link href={getLocalizedPath(localeKey)}>{t("home")}</Link>
</Button>
<Button asChild variant="outline">
<Link href={getLocalizedPath(localeKey, "/contact")}>{t("contact")}</Link>
</Button>
</div>
</CardContent>
</AppCard>
</MotionFade>
</div>
</Container>
);
}
+101 -87
View File
@@ -1,10 +1,17 @@
import type { Metadata } from "next";
import { Sparkles } from "lucide-react";
import Image from "next/image";
import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade";
import { ThemeToggle } from "@/components/theme-toggle";
import { resolveLocale } from "@/lib/site-data";
import { buildLocalizedMetadata } from "@/lib/metadata";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { AppCard } from "@/components/ui/app-card";
import { Button } from "@/components/ui/button";
import { CardContent } from "@/components/ui/card";
type ComingSoonPageProps = {
params: {
@@ -12,101 +19,108 @@ type ComingSoonPageProps = {
};
};
export default function ComingSoonPage({ params: { locale } }: ComingSoonPageProps) {
export async function generateMetadata({
params: { locale },
}: ComingSoonPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale);
const targetLocale = localeKey === "de" ? "en" : "de";
const languageLabel = targetLocale.toUpperCase();
const t = await getTranslations({ locale: localeKey, namespace: "comingSoon" });
const copy =
localeKey === "de"
? {
badge: "Coming Soon",
titleStart: "Etwas",
titleAccent: "Neues",
titleEnd: "ist auf dem Weg.",
description:
"Meine Website ist aktuell im Wartungsmodus. Ich finalisiere Inhalte und den letzten Feinschliff vor dem Launch.",
note:
"Danke fuer deine Geduld. Bald geht eine klarere, schnellere und staerkere Version live.",
}
: {
badge: "Coming Soon",
titleStart: "Something",
titleAccent: "new",
titleEnd: "is on the way.",
description:
"My website is currently in maintenance mode. I am finalizing content and polish before launch.",
note:
"Thank you for your patience. A cleaner, faster, and stronger version is launching soon.",
};
return buildLocalizedMetadata({
locale: localeKey,
pathname: "/coming-soon",
title: `${t("badge")} | moh-sass`,
description: t("description"),
});
}
export default async function ComingSoonPage({
params: { locale },
}: ComingSoonPageProps) {
const localeKey = resolveLocale(locale);
const localeOptions = ["de", "en", "ar"] as const;
const t = await getTranslations({ locale: localeKey, namespace: "comingSoon" });
const tNav = await getTranslations({ locale: localeKey, namespace: "navigation" });
return (
<div className="relative min-h-screen overflow-hidden bg-app">
<div
className="pointer-events-none absolute inset-0"
style={{
background:
"radial-gradient(circle at 14% 18%, color-mix(in oklab, var(--color-brand-secondary) 36%, transparent), transparent 48%), radial-gradient(circle at 86% 82%, color-mix(in oklab, var(--color-brand-primary) 32%, transparent), transparent 50%)",
}}
/>
<div className="relative min-h-screen overflow-hidden bg-background">
<div className="surface-grid absolute inset-0 opacity-30" />
<div className="absolute inset-0 bg-[radial-gradient(circle_at_top,hsl(var(--brand-primary)/0.18),transparent_42%),radial-gradient(circle_at_bottom_right,hsl(var(--brand-secondary)/0.14),transparent_36%)]" />
<div className="pointer-events-none absolute left-1/2 top-[-120px] h-[340px] w-[340px] -translate-x-1/2 rounded-full bg-[color-mix(in_oklab,var(--color-brand-secondary)_32%,transparent)] blur-[96px]" />
<div className="relative mx-auto flex min-h-screen w-full max-w-6xl items-center px-4 py-14 sm:px-6 lg:px-8">
<Container className="relative flex min-h-screen items-center py-14">
<MotionFade className="w-full">
<section className="brand-glow relative mx-auto max-w-4xl overflow-hidden rounded-[2.25rem] border border-default bg-surface-elevated p-7 text-center shadow-[0_24px_70px_-26px_rgba(0,0,0,0.35)] sm:p-10 lg:p-14">
<div className="pointer-events-none absolute -right-24 -top-24 h-72 w-72 rounded-full bg-[color-mix(in_oklab,var(--color-brand-secondary)_30%,transparent)] blur-[90px]" />
<div className="pointer-events-none absolute -bottom-24 -left-24 h-80 w-80 rounded-full bg-[color-mix(in_oklab,var(--color-brand-primary)_28%,transparent)] blur-[110px]" />
<AppCard
level={3}
className="brand-glow mx-auto max-w-4xl overflow-hidden border-border/70"
>
<CardContent className="relative p-7 text-center sm:p-10 lg:p-14">
<div className="pointer-events-none absolute -right-20 -top-20 h-64 w-64 rounded-full bg-brand-secondary/15 blur-3xl" />
<div className="pointer-events-none absolute -bottom-24 -left-16 h-72 w-72 rounded-full bg-brand-primary/15 blur-3xl" />
<div className="relative">
<div className="mx-auto mb-8 flex w-fit items-center gap-2 rounded-xl border border-strong bg-surface px-2 py-2">
<ThemeToggle />
<Link
href={`/${targetLocale}/coming-soon`}
className="inline-flex h-9 min-w-11 items-center justify-center rounded-md border border-strong px-3 text-xs font-semibold tracking-wide text-muted-strong transition hover-surface-soft"
aria-label={`Switch language to ${targetLocale}`}
>
{languageLabel}
</Link>
<div className="relative">
<div className="mx-auto mb-8 flex w-fit items-center gap-2 rounded-surface border border-border bg-surface-1 px-2 py-2 shadow-sm">
<ThemeToggle ariaLabel={tNav("themeToggle")} />
<div className="flex items-center gap-2">
{localeOptions.map((targetLocale) => (
<Button
key={targetLocale}
asChild
type="button"
variant={targetLocale === localeKey ? "secondary" : "outline"}
size="sm"
>
<Link
href={getLocalizedPath(targetLocale, "/coming-soon")}
aria-label={targetLocale.toUpperCase()}
>
{targetLocale.toUpperCase()}
</Link>
</Button>
))}
</div>
</div>
<p className="inline-flex items-center gap-2 rounded-pill border border-border bg-surface-1 px-3 py-1 text-xs font-semibold uppercase tracking-[0.14em] text-foreground/80">
<Sparkles className="h-3.5 w-3.5 text-brand-secondary" />
{t("badge")}
</p>
<div className="mt-7 flex items-center justify-center">
<Image
src="/logos/light-primary.svg"
alt="mohfarawati"
width={190}
height={44}
className="block h-auto w-[150px] dark:hidden sm:w-[190px]"
priority
/>
<Image
src="/logos/dark-primary.svg"
alt="mohfarawati"
width={190}
height={44}
className="hidden h-auto w-[150px] dark:block sm:w-[190px]"
priority
/>
</div>
<h1 className="text-balance mx-auto mt-7 max-w-3xl text-4xl font-semibold tracking-tight text-foreground sm:text-5xl lg:text-6xl">
{t("titleStart")}{" "}
<span className="brand-gradient-text">{t("titleAccent")}</span>{" "}
{t("titleEnd")}
</h1>
<p className="mx-auto mt-5 max-w-2xl text-base leading-relaxed text-muted-foreground sm:text-lg">
{t("description")}
</p>
<p className="mx-auto mt-6 max-w-2xl text-sm text-foreground/72 sm:text-base">
{t("note")}
</p>
</div>
<p className="inline-flex items-center gap-2 rounded-full border border-default bg-surface px-3 py-1 text-xs font-semibold uppercase tracking-[0.14em] text-muted-strong">
<Sparkles className="h-3.5 w-3.5" />
{copy.badge}
</p>
<div className="mt-7 flex items-center justify-center">
<Image
src="/logos/light-primary.svg"
alt="Logo"
width={190}
height={44}
className="block h-auto w-[150px] dark:hidden sm:w-[190px]"
priority
/>
<Image
src="/logos/dark-primary.svg"
alt="Logo"
width={190}
height={44}
className="hidden h-auto w-[150px] dark:block sm:w-[190px]"
priority
/>
</div>
<h1 className="mx-auto mt-7 max-w-3xl text-4xl font-semibold tracking-tight text-fg sm:text-5xl lg:text-6xl">
{copy.titleStart} <span className="brand-gradient-text">{copy.titleAccent}</span> {copy.titleEnd}
</h1>
<p className="mx-auto mt-5 max-w-2xl text-base leading-relaxed text-muted-strong sm:text-lg">
{copy.description}
</p>
<p className="mx-auto mt-6 max-w-2xl text-sm text-subtle sm:text-base">{copy.note}</p>
</div>
</section>
</CardContent>
</AppCard>
</MotionFade>
</div>
</Container>
</div>
);
}
+2 -2
View File
@@ -4,8 +4,8 @@ import { NextIntlClientProvider } from "next-intl";
import { getMessages, setRequestLocale } from "next-intl/server";
import { notFound } from "next/navigation";
import { ThemeProvider } from "@/components/theme-provider";
import { routing } from "@/i18n/routing";
import { getDirection } from "@/lib/locale";
type LocaleLayoutProps = {
children: ReactNode;
@@ -37,7 +37,7 @@ export default async function LocaleLayout({
return (
<NextIntlClientProvider messages={messages}>
<ThemeProvider>{children}</ThemeProvider>
<div lang={locale} dir={getDirection(locale)}>{children}</div>
</NextIntlClientProvider>
);
}
+126 -217
View File
@@ -3,98 +3,131 @@
@tailwind utilities;
:root {
--background: 220 23% 97%;
--foreground: 222 22% 11%;
--background: 210 20% 98%;
--foreground: 222 30% 12%;
--card: 0 0% 100%;
--card-foreground: 222 22% 11%;
--card-foreground: 222 30% 12%;
--popover: 0 0% 100%;
--popover-foreground: 222 22% 11%;
--popover-foreground: 222 30% 12%;
--primary: 10 74% 50%;
--primary: 214 84% 42%;
--primary-foreground: 210 40% 98%;
--secondary: 214 19% 93%;
--secondary-foreground: 222 22% 11%;
--muted: 215 20% 92%;
--muted-foreground: 219 15% 35%;
--accent: 44 93% 55%;
--accent-foreground: 222 22% 11%;
--destructive: 0 72% 45%;
--secondary: 210 24% 94%;
--secondary-foreground: 222 30% 12%;
--muted: 210 20% 95%;
--muted-foreground: 215 16% 38%;
--accent: 191 78% 42%;
--accent-foreground: 210 40% 98%;
--destructive: 0 72% 47%;
--destructive-foreground: 210 40% 98%;
--surface: 0 0% 100%;
--surface-soft: 215 18% 93%;
--surface-elevated: 0 0% 99%;
--border: 215 20% 88%;
--input: 215 20% 83%;
--ring: 10 74% 50%;
--surface-1: 0 0% 100%;
--surface-2: 210 20% 96%;
--surface-3: 210 24% 93%;
--surface-inverse: 222 34% 14%;
--surface-inverse-foreground: 210 40% 98%;
--radius: 0.85rem;
--radius-card: 1rem;
--radius-input: 0.7rem;
--radius-sidebar: 1rem;
--border: 214 22% 88%;
--border-strong: 214 20% 80%;
--input: 214 20% 84%;
--ring: 214 84% 42%;
--shadow-xs: 0 1px 2px 0 hsl(220 30% 10% / 0.06);
--shadow-sm: 0 6px 18px -14px hsl(220 32% 20% / 0.18);
--shadow-md: 0 18px 35px -24px hsl(220 32% 20% / 0.24);
--shadow-lg: 0 24px 55px -30px hsl(220 32% 20% / 0.3);
--shadow-card: 0 10px 30px -20px hsl(220 35% 10% / 0.22);
--shadow-sidebar: inset 0 1px 0 0 hsl(0 0% 100% / 0.08);
--status-success: 145 63% 42%;
--status-success-soft: 145 58% 92%;
--status-warning: 36 92% 44%;
--status-warning-soft: 41 96% 90%;
--sidebar-background: 220 27% 96%;
--sidebar-foreground: 223 18% 24%;
--sidebar-primary: 10 74% 50%;
--brand-primary: 214 84% 42%;
--brand-secondary: 191 78% 42%;
--radius-surface: 0rem;
--radius-nested: 0rem;
--radius-pill: 9999px;
--shadow-xs: 0 1px 2px hsl(220 26% 18% / 0.05);
--shadow-sm: 0 12px 30px -20px hsl(220 32% 18% / 0.16);
--shadow-md: 0 22px 48px -28px hsl(220 32% 18% / 0.2);
--shadow-lg: 0 28px 70px -34px hsl(220 32% 18% / 0.28);
--shadow-card: 0 20px 46px -30px hsl(220 32% 18% / 0.2);
--shadow-panel: 0 18px 50px -32px hsl(220 32% 18% / 0.18);
--shadow-sidebar: inset 0 1px 0 hsl(0 0% 100% / 0.7);
--focus-ring: 0 0 0 3px hsl(var(--ring) / 0.18);
--container-narrow: 48rem;
--container-default: 72rem;
--container-wide: 80rem;
--container-admin: 88rem;
--header-height: 4.5rem;
--section-space: 3.5rem;
--content-space: 1.5rem;
--sidebar-background: 210 22% 95%;
--sidebar-foreground: 222 24% 18%;
--sidebar-primary: 214 84% 42%;
--sidebar-primary-foreground: 210 40% 98%;
--sidebar-accent: 220 24% 91%;
--sidebar-accent-foreground: 222 20% 15%;
--sidebar-border: 216 20% 85%;
--sidebar-ring: 10 74% 50%;
--focus-ring: 0 0 0 2px hsl(var(--ring) / 0.35);
--sidebar-accent: 210 20% 90%;
--sidebar-accent-foreground: 222 24% 18%;
--sidebar-border: 214 20% 84%;
--sidebar-ring: 214 84% 42%;
}
.dark {
--background: 223 32% 7%;
--foreground: 216 36% 93%;
--background: 222 33% 8%;
--foreground: 210 25% 92%;
--card: 221 29% 11%;
--card-foreground: 216 36% 93%;
--popover: 221 29% 11%;
--popover-foreground: 216 36% 93%;
--card: 222 28% 11%;
--card-foreground: 210 25% 92%;
--popover: 222 28% 11%;
--popover-foreground: 210 25% 92%;
--primary: 10 80% 56%;
--primary-foreground: 216 36% 93%;
--secondary: 221 23% 18%;
--secondary-foreground: 216 36% 93%;
--muted: 221 21% 20%;
--muted-foreground: 218 17% 76%;
--accent: 44 92% 52%;
--accent-foreground: 221 29% 11%;
--destructive: 0 72% 50%;
--destructive-foreground: 216 36% 93%;
--primary: 205 88% 64%;
--primary-foreground: 222 33% 8%;
--secondary: 222 18% 18%;
--secondary-foreground: 210 25% 92%;
--muted: 222 18% 16%;
--muted-foreground: 215 16% 72%;
--accent: 190 76% 57%;
--accent-foreground: 222 33% 8%;
--destructive: 0 72% 58%;
--destructive-foreground: 210 40% 98%;
--surface: 221 29% 11%;
--surface-soft: 220 24% 15%;
--surface-elevated: 220 21% 20%;
--border: 221 21% 24%;
--input: 221 20% 27%;
--ring: 10 80% 56%;
--surface-1: 222 28% 11%;
--surface-2: 222 22% 14%;
--surface-3: 222 18% 17%;
--surface-inverse: 210 40% 98%;
--surface-inverse-foreground: 222 33% 8%;
--shadow-xs: 0 1px 2px 0 hsl(220 40% 2% / 0.5);
--shadow-sm: 0 8px 20px -12px hsl(220 40% 2% / 0.65);
--shadow-md: 0 18px 36px -20px hsl(220 40% 2% / 0.75);
--shadow-lg: 0 28px 60px -28px hsl(220 40% 2% / 0.85);
--shadow-card: 0 16px 34px -24px hsl(220 40% 2% / 0.8);
--shadow-sidebar: inset 0 1px 0 0 hsl(216 36% 93% / 0.05);
--border: 221 18% 21%;
--border-strong: 221 18% 28%;
--input: 221 18% 26%;
--ring: 205 88% 64%;
--sidebar-background: 223 30% 9%;
--sidebar-foreground: 216 28% 86%;
--sidebar-primary: 10 80% 56%;
--sidebar-primary-foreground: 216 36% 93%;
--sidebar-accent: 221 23% 17%;
--sidebar-accent-foreground: 216 36% 93%;
--sidebar-border: 221 20% 21%;
--sidebar-ring: 10 80% 56%;
--status-success: 145 68% 66%;
--status-success-soft: 145 36% 18%;
--status-warning: 42 96% 66%;
--status-warning-soft: 35 40% 18%;
--brand-primary: 205 88% 64%;
--brand-secondary: 190 76% 57%;
--shadow-xs: 0 1px 2px hsl(220 50% 2% / 0.42);
--shadow-sm: 0 14px 30px -20px hsl(220 50% 2% / 0.48);
--shadow-md: 0 24px 48px -28px hsl(220 50% 2% / 0.58);
--shadow-lg: 0 34px 78px -34px hsl(220 50% 2% / 0.72);
--shadow-card: 0 20px 52px -28px hsl(220 50% 2% / 0.55);
--shadow-panel: 0 22px 56px -32px hsl(220 50% 2% / 0.52);
--shadow-sidebar: inset 0 1px 0 hsl(210 25% 92% / 0.06);
--sidebar-background: 222 25% 10%;
--sidebar-foreground: 210 18% 86%;
--sidebar-primary: 205 88% 64%;
--sidebar-primary-foreground: 222 33% 8%;
--sidebar-accent: 221 18% 18%;
--sidebar-accent-foreground: 210 25% 92%;
--sidebar-border: 221 18% 22%;
--sidebar-ring: 205 88% 64%;
}
html {
@@ -114,132 +147,28 @@ html.dark {
body {
@apply min-h-screen bg-background text-foreground antialiased;
}
}
body {
color: hsl(var(--foreground));
background: hsl(var(--background));
a {
@apply transition-colors;
}
}
::selection {
background: hsl(var(--primary) / 0.82);
color: hsl(var(--primary-foreground));
background: hsl(var(--primary) / 0.2);
color: hsl(var(--foreground));
}
@layer utilities {
.bg-app {
background-color: hsl(var(--background));
.text-balance {
text-wrap: balance;
}
.bg-surface {
background-color: hsl(var(--surface));
}
.bg-surface-soft {
background-color: hsl(var(--surface-soft));
}
.bg-surface-elevated {
background-color: hsl(var(--surface-elevated));
}
.bg-inverse {
background-color: hsl(var(--foreground));
}
.text-fg {
color: hsl(var(--foreground));
}
.text-muted {
color: hsl(var(--muted-foreground));
}
.text-muted-strong {
color: hsl(var(--foreground) / 0.86);
}
.text-subtle {
color: hsl(var(--muted-foreground) / 0.88);
}
.text-inverse {
color: hsl(var(--background));
}
.border-default {
border-color: hsl(var(--border));
}
.border-strong {
border-color: hsl(var(--input));
}
.status-success {
background-color: hsl(142 70% 45% / 0.15);
color: hsl(142 72% 34%);
}
.status-warning {
background-color: hsl(38 92% 56% / 0.17);
color: hsl(33 92% 34%);
}
.status-danger {
background-color: hsl(var(--destructive) / 0.18);
color: hsl(var(--destructive));
}
.hover-surface-soft:hover {
background-color: hsl(var(--surface-soft));
}
.hover-fg:hover {
color: hsl(var(--foreground));
}
.group:hover .group-hover-fg {
color: hsl(var(--foreground));
}
.group:hover .group-hover-border-strong {
border-color: hsl(var(--input));
}
.btn-primary {
background-color: hsl(var(--primary));
color: hsl(var(--primary-foreground));
}
.btn-primary:hover {
filter: brightness(0.95);
}
.btn-secondary {
border: 1px solid hsl(var(--input));
color: hsl(var(--foreground) / 0.88);
background-color: transparent;
}
.btn-secondary:hover {
background-color: hsl(var(--surface-soft));
}
.field-surface {
border: 1px solid hsl(var(--input));
background-color: hsl(var(--surface));
color: hsl(var(--foreground));
border-radius: var(--radius-input);
}
.field-surface:focus {
outline: none;
box-shadow: var(--focus-ring);
}
.brand-gradient-text {
background: linear-gradient(120deg, hsl(var(--primary)), hsl(var(--accent)));
background-image: linear-gradient(
135deg,
hsl(var(--brand-primary)),
hsl(var(--brand-secondary))
);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
@@ -247,35 +176,15 @@ body {
.brand-glow {
box-shadow:
0 10px 40px -16px hsl(var(--primary) / 0.45),
0 8px 32px -18px hsl(var(--accent) / 0.45);
0 22px 60px -34px hsl(var(--brand-primary) / 0.38),
0 18px 44px -32px hsl(var(--brand-secondary) / 0.28);
}
.float-slow {
animation: float-slow 9s ease-in-out infinite;
}
.float-medium {
animation: float-medium 7s ease-in-out infinite;
}
}
@keyframes float-slow {
0%,
100% {
transform: translateY(0px) translateX(0px) scale(1);
}
50% {
transform: translateY(-12px) translateX(10px) scale(1.04);
}
}
@keyframes float-medium {
0%,
100% {
transform: translateY(0px) translateX(0px) scale(1);
}
50% {
transform: translateY(10px) translateX(-8px) scale(1.03);
.surface-grid {
background-image:
linear-gradient(hsl(var(--border) / 0.45) 1px, transparent 1px),
linear-gradient(90deg, hsl(var(--border) / 0.45) 1px, transparent 1px);
background-size: 24px 24px;
background-position: center center;
}
}
+11 -3
View File
@@ -1,19 +1,27 @@
import type { Metadata } from "next";
import { getLocale } from "next-intl/server";
import { ThemeProvider } from "@/components/theme-provider";
import { getDirection } from "@/lib/locale";
import "./globals.css";
export const metadata: Metadata = {
title: "moh-sass",
description: "Multilingual Next.js base project",
metadataBase: new URL(process.env.NEXT_PUBLIC_SITE_URL ?? "https://mohfarawati.de"),
};
export default function RootLayout({
export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const locale = await getLocale().catch(() => "de");
return (
<html lang="de" suppressHydrationWarning>
<body>{children}</body>
<html lang={locale} dir={getDirection(locale)} suppressHydrationWarning>
<body>
<ThemeProvider>{children}</ThemeProvider>
</body>
</html>
);
}
-5
View File
@@ -1,5 +0,0 @@
import { redirect } from "next/navigation";
export default function RootPage() {
redirect("/de");
}
+139
View File
@@ -0,0 +1,139 @@
import { ArrowLeft, LogOut, Power } from "lucide-react";
import Link from "next/link";
import { revalidatePath } from "next/cache";
import { redirect } from "next/navigation";
import { AppHeader } from "@/components/layout/app-header";
import { AppShell } from "@/components/layout/app-shell";
import { AppSidebar } from "@/components/layout/app-sidebar";
import { ThemeToggle } from "@/components/theme-toggle";
import { routing } from "@/i18n/routing";
import { getLocalizedPath } from "@/lib/locale";
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
import { getMaintenanceMode, setMaintenanceMode } from "@/lib/app-config";
import { getRootNavigation } from "@/lib/root-navigation";
import { AppCard } from "@/components/ui/app-card";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
export const dynamic = "force-dynamic";
const copy = {
title: "Wartungsmodus",
subtitle: "Steuerung fuer den globalen Maintenance Status.",
overview: "Uebersicht",
maintenance: "Wartungsmodus",
uiKit: "UI Kit",
maintenanceText: "Wenn aktiv, werden alle Seiten auf die Coming Soon Seite weitergeleitet.",
maintenanceOn: "Aktiv",
maintenanceOff: "Inaktiv",
enableMaintenance: "Wartungsmodus aktivieren",
disableMaintenance: "Wartungsmodus deaktivieren",
logout: "Ausloggen",
backToSite: "Zur Website",
};
export default async function RootMaintenancePage() {
const authenticated = isAdminAuthenticated();
if (!authenticated) {
redirect("/root");
}
const maintenanceEnabled = await getMaintenanceMode();
async function logoutAction() {
"use server";
clearAdminSessionCookie();
redirect("/root");
}
async function updateMaintenanceMode(formData: FormData) {
"use server";
if (!isAdminAuthenticated()) {
redirect("/root");
}
const nextValue = formData.get("enabled") === "true";
await setMaintenanceMode(nextValue);
revalidatePath("/", "layout");
revalidatePath("/coming-soon");
revalidatePath("/root");
revalidatePath("/root/maintenance");
for (const appLocale of routing.locales) {
revalidatePath(getLocalizedPath(appLocale), "layout");
revalidatePath(getLocalizedPath(appLocale, "/coming-soon"));
}
redirect("/root/maintenance");
}
const sidebarItems = getRootNavigation(copy, "maintenance");
return (
<AppShell
sidebar={
<AppSidebar
title={copy.title}
description={copy.subtitle}
items={sidebarItems}
footer={
<div className="space-y-2">
<div className="flex items-center gap-2">
<ThemeToggle ariaLabel="Theme wechseln" />
</div>
<Button asChild variant="outline" className="w-full justify-start">
<Link href={getLocalizedPath("de")}>
<ArrowLeft className="h-4 w-4" />
{copy.backToSite}
</Link>
</Button>
<form action={logoutAction}>
<Button type="submit" variant="destructive" className="w-full justify-start">
<LogOut className="h-4 w-4" />
{copy.logout}
</Button>
</form>
</div>
}
/>
}
header={
<AppHeader
title={copy.title}
description={copy.subtitle}
actions={
<Badge variant={maintenanceEnabled ? "warning" : "success"}>
{maintenanceEnabled ? copy.maintenanceOn : copy.maintenanceOff}
</Badge>
}
/>
}
>
<AppCard>
<CardHeader>
<CardTitle className="text-xl">{copy.title}</CardTitle>
<CardDescription>{copy.maintenanceText}</CardDescription>
</CardHeader>
<CardContent>
<form action={updateMaintenanceMode}>
<input
type="hidden"
name="enabled"
value={maintenanceEnabled ? "false" : "true"}
/>
<Button type="submit">
<Power className="h-4 w-4" />
{maintenanceEnabled ? copy.disableMaintenance : copy.enableMaintenance}
</Button>
</form>
</CardContent>
</AppCard>
</AppShell>
);
}
+116 -196
View File
@@ -1,22 +1,19 @@
import {
ArrowLeft,
BarChart3,
Boxes,
FolderKanban,
LayoutDashboard,
LockKeyhole,
LogOut,
Power,
ShieldAlert,
Users2,
} from "lucide-react";
import { revalidatePath } from "next/cache";
import { cookies } from "next/headers";
import { redirect } from "next/navigation";
import { ArrowLeft, ExternalLink, LockKeyhole, LogOut } from "lucide-react";
import Link from "next/link";
import { redirect } from "next/navigation";
import { AppHeader } from "@/components/layout/app-header";
import { AppShell } from "@/components/layout/app-shell";
import { AppSidebar } from "@/components/layout/app-sidebar";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade";
import { routing } from "@/i18n/routing";
import { ThemeToggle } from "@/components/theme-toggle";
import { getLocalizedPath } from "@/lib/locale";
import { AppCard } from "@/components/ui/app-card";
import { Button } from "@/components/ui/button";
import { CardContent, CardDescription, CardHeader } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import {
clearAdminSessionCookie,
getAdminLockState,
@@ -27,17 +24,8 @@ import {
resetAdminFailedAttempts,
setAdminSessionCookie,
} from "@/lib/admin-auth";
import { getMaintenanceMode, setMaintenanceMode } from "@/lib/app-config";
import { resolveLocale } from "@/lib/site-data";
import { AppHeader } from "@/src/components/layout/app-header";
import { AppShell } from "@/src/components/layout/app-shell";
import { AppSidebar } from "@/src/components/layout/app-sidebar";
import { Badge } from "@/src/components/ui/badge";
import { Button } from "@/src/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/src/components/ui/card";
import { Input } from "@/src/components/ui/input";
import { Label } from "@/src/components/ui/label";
import { getMaintenanceMode } from "@/lib/app-config";
import { getRootNavigation } from "@/lib/root-navigation";
type RootPageProps = {
searchParams?: {
@@ -47,9 +35,34 @@ type RootPageProps = {
export const dynamic = "force-dynamic";
const copy = {
title: "Uebersicht",
subtitle: "Interner Bereich fuer Kennzahlen und zentrale Navigation.",
overview: "Uebersicht",
maintenance: "Wartungsmodus",
maintenanceTitle: "Wartungsmodus",
maintenanceVisitorsClosed: "Website fuer Besucher geschlossen",
maintenanceDescription:
"Wenn aktiv, werden alle Seiten auf die Coming Soon Seite weitergeleitet.",
maintenanceOpen: "Website fuer Besucher offen",
maintenanceAction: "Zur Wartungsseite",
uiKitTitle: "UI Kit",
uiKitDescription: "Globale Referenz fuer Cards, Buttons, Inputs und Surface Levels.",
uiKitAction: "Zur UI Kit",
loginTitle: "Root Login",
loginText: "Nur autorisierte Nutzer duerfen diesen Bereich verwenden.",
passwordLabel: "Passwort",
loginButton: "Einloggen",
invalidLogin: "Falsches Passwort.",
lockedLogin: "Zu viele Fehlversuche. Bitte spaeter erneut versuchen.",
configMissing: "ADMIN_PASSWORD und ADMIN_AUTH_SECRET fehlen in env.",
basicAuthMissing: "ROOT_BASIC_AUTH_USER und ROOT_BASIC_AUTH_PASS fehlen in env.",
logout: "Ausloggen",
backToSite: "Zur Website",
uiKit: "UI Kit",
};
export default async function RootPage({ searchParams }: RootPageProps) {
const requestLocale = cookies().get("NEXT_LOCALE")?.value;
const localeKey = resolveLocale(requestLocale ?? "de");
const authConfigured = isAdminAuthConfigured();
const basicConfigured = Boolean(
process.env.ROOT_BASIC_AUTH_USER && process.env.ROOT_BASIC_AUTH_PASS,
@@ -89,121 +102,39 @@ export default async function RootPage({ searchParams }: RootPageProps) {
redirect("/root");
}
async function updateMaintenanceMode(formData: FormData) {
"use server";
if (!isAdminAuthenticated()) {
redirect("/root");
}
const nextValue = formData.get("enabled") === "true";
await setMaintenanceMode(nextValue);
revalidatePath("/", "layout");
revalidatePath("/root");
for (const appLocale of routing.locales) {
revalidatePath(`/${appLocale}`, "layout");
revalidatePath(`/${appLocale}/coming-soon`);
}
redirect("/root");
}
const copy =
resolveLocale(requestLocale ?? localeKey) === "de"
? {
title: "Root",
subtitle: "Interner Bereich fuer Kennzahlen und Wartungssteuerung.",
activeUsers: "Aktive Nutzer",
projects: "Laufende Projekte",
products: "Aktive Produkte",
conversion: "Conversion",
updates: "Letzte Updates",
updateOne: "Kontaktformular wurde ueberarbeitet.",
updateTwo: "Neue Produktseite fuer Growth Kit vorbereitet.",
updateThree: "Portfolio-Daten fuer Q2 aktualisiert.",
maintenanceTitle: "Wartungsmodus",
maintenanceText:
"Wenn aktiv, werden alle Seiten auf die Coming Soon Seite weitergeleitet.",
maintenanceOn: "Aktiv",
maintenanceOff: "Inaktiv",
enableMaintenance: "Wartungsmodus aktivieren",
disableMaintenance: "Wartungsmodus deaktivieren",
loginTitle: "Root Login",
loginText: "Nur autorisierte Nutzer duerfen diesen Bereich verwenden.",
passwordLabel: "Passwort",
loginButton: "Einloggen",
invalidLogin: "Falsches Passwort.",
lockedLogin: "Zu viele Fehlversuche. Bitte spaeter erneut versuchen.",
configMissing: "ADMIN_PASSWORD und ADMIN_AUTH_SECRET fehlen in env.",
basicAuthMissing:
"ROOT_BASIC_AUTH_USER und ROOT_BASIC_AUTH_PASS fehlen in env.",
logout: "Ausloggen",
backToSite: "Zur Website",
}
: {
title: "Root",
subtitle: "Internal area for metrics and maintenance controls.",
activeUsers: "Active users",
projects: "Running projects",
products: "Active products",
conversion: "Conversion",
updates: "Latest updates",
updateOne: "Contact form layout updated.",
updateTwo: "New Growth Kit product page prepared.",
updateThree: "Portfolio data updated for Q2.",
maintenanceTitle: "Maintenance mode",
maintenanceText:
"When enabled, all site routes are redirected to the coming soon page.",
maintenanceOn: "Enabled",
maintenanceOff: "Disabled",
enableMaintenance: "Enable maintenance mode",
disableMaintenance: "Disable maintenance mode",
loginTitle: "Root login",
loginText: "Only authorized users can access this area.",
passwordLabel: "Password",
loginButton: "Sign in",
invalidLogin: "Invalid password.",
lockedLogin: "Too many failed attempts. Please try again later.",
configMissing: "ADMIN_PASSWORD and ADMIN_AUTH_SECRET are missing in env.",
basicAuthMissing:
"ROOT_BASIC_AUTH_USER and ROOT_BASIC_AUTH_PASS are missing in env.",
logout: "Sign out",
backToSite: "Back to site",
};
if (!authenticated) {
return (
<div className="mx-auto flex w-full max-w-xl flex-col gap-6 px-4 py-12 sm:px-6 lg:px-8">
<Container size="narrow" className="py-12">
<MotionFade>
<Card>
<AppCard level={3}>
<CardHeader>
<p className="inline-flex items-center gap-2 text-sm font-medium text-muted-foreground">
<LockKeyhole className="h-4 w-4" />
<LockKeyhole className="h-4 w-4 text-brand-primary" />
{copy.loginTitle}
</p>
<CardDescription>{copy.loginText}</CardDescription>
</CardHeader>
<CardContent>
{!authConfigured ? (
<p className="mb-4 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive">
<p className="mb-4 rounded-nested border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive">
{copy.configMissing}
</p>
) : null}
{!basicConfigured ? (
<p className="mb-4 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive">
<p className="mb-4 rounded-nested border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive">
{copy.basicAuthMissing}
</p>
) : null}
{searchParams?.error === "invalid" ? (
<p className="mb-4 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-700 dark:text-amber-300">
<p className="mb-4 rounded-nested border border-status-warning/30 bg-status-warning-soft px-3 py-2 text-sm text-status-warning">
{copy.invalidLogin}
</p>
) : null}
{searchParams?.error === "locked" || lockState.locked ? (
<p className="mb-4 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-700 dark:text-amber-300">
<p className="mb-4 rounded-nested border border-status-warning/30 bg-status-warning-soft px-3 py-2 text-sm text-status-warning">
{copy.lockedLogin}
</p>
) : null}
@@ -211,30 +142,22 @@ export default async function RootPage({ searchParams }: RootPageProps) {
<form action={loginAction} className="space-y-3">
<Label htmlFor="password">{copy.passwordLabel}</Label>
<Input id="password" type="password" name="password" required />
<Button type="submit" disabled={!authConfigured || !basicConfigured || lockState.locked}>
<LockKeyhole className="mr-2 h-4 w-4" />
<Button
type="submit"
disabled={!authConfigured || !basicConfigured || lockState.locked}
>
<LockKeyhole className="h-4 w-4" />
{copy.loginButton}
</Button>
</form>
</CardContent>
</Card>
</AppCard>
</MotionFade>
</div>
</Container>
);
}
const stats = [
{ label: copy.activeUsers, value: "1,280", icon: Users2 },
{ label: copy.projects, value: "24", icon: FolderKanban },
{ label: copy.products, value: "8", icon: Boxes },
{ label: copy.conversion, value: "4.8%", icon: BarChart3 },
];
const sidebarItems = [
{ label: copy.title, href: "/root", icon: LayoutDashboard, active: true },
{ label: copy.maintenanceTitle, href: "#maintenance", icon: ShieldAlert },
{ label: copy.updates, href: "#updates", icon: FolderKanban },
];
const sidebarItems = getRootNavigation(copy, "overview");
return (
<AppShell
@@ -244,12 +167,23 @@ export default async function RootPage({ searchParams }: RootPageProps) {
description={copy.subtitle}
items={sidebarItems}
footer={
<form action={logoutAction}>
<Button type="submit" variant="outline" className="w-full justify-start">
<LogOut className="mr-2 h-4 w-4" />
{copy.logout}
<div className="space-y-2">
<div className="flex items-center gap-2">
<ThemeToggle ariaLabel="Theme wechseln" />
</div>
<Button asChild variant="outline" className="w-full justify-start">
<Link href={getLocalizedPath("de")}>
<ArrowLeft className="h-4 w-4" />
{copy.backToSite}
</Link>
</Button>
</form>
<form action={logoutAction}>
<Button type="submit" variant="destructive" className="w-full justify-start">
<LogOut className="h-4 w-4" />
{copy.logout}
</Button>
</form>
</div>
}
/>
}
@@ -258,73 +192,59 @@ export default async function RootPage({ searchParams }: RootPageProps) {
title={copy.title}
description={copy.subtitle}
actions={
<>
<Badge variant={maintenanceEnabled ? "warning" : "success"}>
{maintenanceEnabled ? copy.maintenanceOn : copy.maintenanceOff}
</Badge>
<Button asChild variant="outline">
<Link href={`/${localeKey}`}>
<ArrowLeft className="mr-2 h-4 w-4" />
{copy.backToSite}
maintenanceEnabled ? (
<Button asChild variant="destructive">
<Link href="/root/maintenance">
{copy.maintenanceVisitorsClosed}
</Link>
</Button>
</>
) : null
}
/>
}
>
<div className="grid gap-6">
<MotionFade delay={0.05}>
<Card id="maintenance">
<CardHeader>
<CardTitle className="text-xl">{copy.maintenanceTitle}</CardTitle>
<CardDescription>{copy.maintenanceText}</CardDescription>
</CardHeader>
<CardContent>
<form action={updateMaintenanceMode}>
<input type="hidden" name="enabled" value={maintenanceEnabled ? "false" : "true"} />
<Button type="submit">
<Power className="mr-2 h-4 w-4" />
{maintenanceEnabled ? copy.disableMaintenance : copy.enableMaintenance}
<section className="grid gap-4 lg:grid-cols-2">
<MotionFade delay={0.05}>
<AppCard level={2}>
<CardHeader>
<CardDescription>{copy.maintenanceTitle}</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<p className="text-lg font-semibold text-foreground">
{maintenanceEnabled ? copy.maintenanceVisitorsClosed : copy.maintenanceOpen}
</p>
<p className="text-sm text-muted-foreground">
{copy.maintenanceDescription}
</p>
<Button asChild variant={maintenanceEnabled ? "destructive" : "outline"}>
<Link href="/root/maintenance">
{copy.maintenanceAction}
<ExternalLink className="h-4 w-4" />
</Link>
</Button>
</form>
</CardContent>
</Card>
</MotionFade>
</CardContent>
</AppCard>
</MotionFade>
<section className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
{stats.map((item, index) => {
const Icon = item.icon;
return (
<MotionFade key={item.label} delay={index * 0.05}>
<Card>
<CardContent className="p-5">
<Icon className="h-5 w-5 text-muted-foreground" />
<p className="mt-3 text-sm text-muted-foreground">{item.label}</p>
<p className="mt-1 text-2xl font-semibold text-foreground">{item.value}</p>
</CardContent>
</Card>
</MotionFade>
);
})}
<MotionFade delay={0.1}>
<AppCard level={2}>
<CardHeader>
<CardDescription>{copy.uiKitTitle}</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<p className="text-lg font-semibold text-foreground">{copy.uiKitTitle}</p>
<p className="text-sm text-muted-foreground">{copy.uiKitDescription}</p>
<Button asChild variant="outline">
<Link href="/root/ui-kit">
{copy.uiKitAction}
<ExternalLink className="h-4 w-4" />
</Link>
</Button>
</CardContent>
</AppCard>
</MotionFade>
</section>
<MotionFade delay={0.1}>
<Card id="updates">
<CardHeader>
<CardTitle className="text-xl">{copy.updates}</CardTitle>
</CardHeader>
<CardContent>
<ul className="space-y-3">
{[copy.updateOne, copy.updateTwo, copy.updateThree].map((item) => (
<li key={item} className="rounded-[var(--radius-input)] border border-border bg-muted px-4 py-3 text-sm text-muted-foreground">
{item}
</li>
))}
</ul>
</CardContent>
</Card>
</MotionFade>
</div>
</AppShell>
);
+76
View File
@@ -0,0 +1,76 @@
import { ArrowLeft, LogOut } from "lucide-react";
import Link from "next/link";
import { redirect } from "next/navigation";
import { AppHeader } from "@/components/layout/app-header";
import { AppShell } from "@/components/layout/app-shell";
import { AppSidebar } from "@/components/layout/app-sidebar";
import { ThemeToggle } from "@/components/theme-toggle";
import { getLocalizedPath } from "@/lib/locale";
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
import { getRootNavigation } from "@/lib/root-navigation";
import { Button } from "@/components/ui/button";
import { UiKitShowcase } from "@/components/ui/ui-kit-showcase";
export const dynamic = "force-dynamic";
const copy = {
title: "UI Kit",
subtitle: "Globale Referenz fuer das visuelle System im Root Bereich.",
maintenance: "Wartungsmodus",
overview: "Uebersicht",
uiKit: "UI Kit",
logout: "Ausloggen",
backToSite: "Zur Website",
};
export default async function RootUiKitPage() {
const authenticated = isAdminAuthenticated();
if (!authenticated) {
redirect("/root");
}
async function logoutAction() {
"use server";
clearAdminSessionCookie();
redirect("/root");
}
const sidebarItems = getRootNavigation(copy, "ui-kit");
return (
<AppShell
sidebar={
<AppSidebar
title={copy.title}
description={copy.subtitle}
items={sidebarItems}
footer={
<div className="space-y-2">
<div className="flex items-center gap-2">
<ThemeToggle ariaLabel="Theme wechseln" />
</div>
<Button asChild variant="outline" className="w-full justify-start">
<Link href={getLocalizedPath("de")}>
<ArrowLeft className="h-4 w-4" />
{copy.backToSite}
</Link>
</Button>
<form action={logoutAction}>
<Button type="submit" variant="destructive" className="w-full justify-start">
<LogOut className="h-4 w-4" />
{copy.logout}
</Button>
</form>
</div>
}
/>
}
header={<AppHeader title={copy.title} description={copy.subtitle} />}
>
<UiKitShowcase localeKey="de" />
</AppShell>
);
}