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>
);
}