This commit is contained in:
@@ -28,6 +28,7 @@ yarn-error.log*
|
||||
# local env files
|
||||
.env
|
||||
.env*.local
|
||||
docker-compose.override.yml
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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
@@ -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
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default function RootPage() {
|
||||
redirect("/de");
|
||||
}
|
||||
@@ -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
@@ -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>
|
||||
);
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
+3
-4
@@ -11,11 +11,10 @@
|
||||
"prefix": ""
|
||||
},
|
||||
"aliases": {
|
||||
"components": "@/src/components",
|
||||
"components": "@/components",
|
||||
"utils": "@/lib/utils",
|
||||
"ui": "@/src/components/ui",
|
||||
"lib": "@/lib",
|
||||
"hooks": "@/src/hooks"
|
||||
"ui": "@/components/ui",
|
||||
"lib": "@/lib"
|
||||
},
|
||||
"iconLibrary": "lucide"
|
||||
}
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
import Link from "next/link";
|
||||
import { useLocale, useTranslations } from "next-intl";
|
||||
|
||||
const navItems = [
|
||||
{ key: "home", path: "" },
|
||||
{ key: "portfolio", path: "/portfolio" },
|
||||
{ key: "products", path: "/products" },
|
||||
{ key: "about", path: "/about" },
|
||||
{ key: "contact", path: "/contact" },
|
||||
];
|
||||
|
||||
type FooterProps = {
|
||||
isAdmin?: boolean;
|
||||
};
|
||||
|
||||
export function Footer({ isAdmin = false }: FooterProps) {
|
||||
const locale = useLocale();
|
||||
const tNav = useTranslations("navigation");
|
||||
const tFooter = useTranslations("footer");
|
||||
|
||||
return (
|
||||
<footer className="border-t border-default bg-surface-soft">
|
||||
<div className="mx-auto flex w-full max-w-6xl flex-col gap-4 px-4 py-8 sm:px-6 lg:px-8">
|
||||
<nav className="flex flex-wrap gap-4 text-sm">
|
||||
{navItems.map((item) => (
|
||||
<Link
|
||||
key={item.key}
|
||||
href={`/${locale}${item.path}`}
|
||||
className="text-muted transition hover:text-fg"
|
||||
>
|
||||
{tNav(item.key)}
|
||||
</Link>
|
||||
))}
|
||||
{isAdmin ? (
|
||||
<a href="/root" className="text-muted transition hover:text-fg">
|
||||
{tNav("root")}
|
||||
</a>
|
||||
) : null}
|
||||
</nav>
|
||||
<p className="text-xs text-subtle">{tFooter("copyright", { year: new Date().getFullYear() })}</p>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import { Card, CardContent } from "@/src/components/ui/card";
|
||||
import { AppCard } from "@/components/ui/app-card";
|
||||
import { CardContent } from "@/components/ui/card";
|
||||
|
||||
type AppHeaderProps = {
|
||||
title: string;
|
||||
@@ -10,14 +11,20 @@ type AppHeaderProps = {
|
||||
|
||||
export function AppHeader({ title, description, actions }: AppHeaderProps) {
|
||||
return (
|
||||
<Card>
|
||||
<CardContent className="flex flex-wrap items-start justify-between gap-4 p-6 lg:p-8">
|
||||
<div>
|
||||
<h1 className="text-3xl font-semibold tracking-tight text-foreground sm:text-4xl">{title}</h1>
|
||||
{description ? <p className="mt-2 max-w-3xl text-sm text-muted-foreground sm:text-base">{description}</p> : null}
|
||||
<AppCard level={3}>
|
||||
<CardContent className="flex flex-wrap items-start justify-between gap-5 p-6 lg:p-8">
|
||||
<div className="space-y-2">
|
||||
<h1 className="text-3xl font-semibold tracking-tight text-foreground sm:text-4xl">
|
||||
{title}
|
||||
</h1>
|
||||
{description ? (
|
||||
<p className="max-w-3xl text-sm text-muted-foreground sm:text-base">
|
||||
{description}
|
||||
</p>
|
||||
) : null}
|
||||
</div>
|
||||
{actions ? <div className="flex items-center gap-2">{actions}</div> : null}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</AppCard>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import { Container } from "@/components/layout/container";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
type AppShellProps = {
|
||||
sidebar: ReactNode;
|
||||
header: ReactNode;
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
export function AppShell({ sidebar, header, children, className }: AppShellProps) {
|
||||
return (
|
||||
<div className="min-h-screen bg-background py-6 lg:py-8">
|
||||
<Container size="admin">
|
||||
<div className="flex gap-6">
|
||||
<aside className="hidden w-72 shrink-0 md:block">{sidebar}</aside>
|
||||
<div className={cn("flex min-w-0 flex-1 flex-col gap-6", className)}>
|
||||
{header}
|
||||
<main>{children}</main>
|
||||
</div>
|
||||
</div>
|
||||
</Container>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -2,8 +2,9 @@ import Link from "next/link";
|
||||
import type { LucideIcon } from "lucide-react";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import { AppCard } from "@/components/ui/app-card";
|
||||
import { CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/src/components/ui/card";
|
||||
|
||||
type SidebarItem = {
|
||||
label: string;
|
||||
@@ -19,22 +20,28 @@ type AppSidebarProps = {
|
||||
footer?: ReactNode;
|
||||
};
|
||||
|
||||
export function AppSidebar({ title, description, items, footer }: AppSidebarProps) {
|
||||
export function AppSidebar({
|
||||
title,
|
||||
description,
|
||||
items,
|
||||
footer,
|
||||
}: AppSidebarProps) {
|
||||
return (
|
||||
<Card className="sticky top-6 overflow-hidden border-sidebar-border bg-sidebar text-sidebar-foreground shadow-sidebar">
|
||||
<AppCard className="sticky top-6 overflow-hidden bg-sidebar text-sidebar-foreground shadow-sidebar">
|
||||
<CardHeader className="pb-4">
|
||||
<CardTitle className="text-base font-semibold">{title}</CardTitle>
|
||||
<p className="text-sm text-sidebar-foreground/70">{description}</p>
|
||||
<p className="text-sm text-sidebar-foreground/72">{description}</p>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-1 px-3 pb-3 pt-0">
|
||||
{items.map((item) => {
|
||||
const Icon = item.icon;
|
||||
|
||||
return (
|
||||
<Link
|
||||
key={item.label}
|
||||
href={item.href}
|
||||
className={cn(
|
||||
"flex items-center gap-2 rounded-[var(--radius-sidebar)] px-3 py-2 text-sm transition",
|
||||
"flex items-center gap-2 rounded-nested px-3 py-2 text-sm transition-colors",
|
||||
item.active
|
||||
? "bg-sidebar-primary text-sidebar-primary-foreground"
|
||||
: "text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
||||
@@ -47,6 +54,6 @@ export function AppSidebar({ title, description, items, footer }: AppSidebarProp
|
||||
})}
|
||||
</CardContent>
|
||||
{footer ? <div className="border-t border-sidebar-border px-4 py-3">{footer}</div> : null}
|
||||
</Card>
|
||||
</AppCard>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import * as React from "react";
|
||||
import { Slot } from "@radix-ui/react-slot";
|
||||
import { cva, type VariantProps } from "class-variance-authority";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const containerVariants = cva("mx-auto w-full px-4 sm:px-6 lg:px-8", {
|
||||
variants: {
|
||||
size: {
|
||||
default: "max-w-layout",
|
||||
narrow: "max-w-narrow",
|
||||
wide: "max-w-wide",
|
||||
admin: "max-w-admin",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
size: "default",
|
||||
},
|
||||
});
|
||||
|
||||
export interface ContainerProps
|
||||
extends React.HTMLAttributes<HTMLDivElement>,
|
||||
VariantProps<typeof containerVariants> {
|
||||
asChild?: boolean;
|
||||
}
|
||||
|
||||
const Container = React.forwardRef<HTMLDivElement, ContainerProps>(
|
||||
({ className, size, asChild = false, ...props }, ref) => {
|
||||
const Comp = asChild ? Slot : "div";
|
||||
|
||||
return (
|
||||
<Comp
|
||||
ref={ref}
|
||||
className={cn(containerVariants({ size }), className)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Container.displayName = "Container";
|
||||
|
||||
export { Container, containerVariants };
|
||||
@@ -0,0 +1,37 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { AppLocale, getLocalizedPath, stripLocalePrefix } from "@/lib/locale";
|
||||
|
||||
type LocaleToggleProps = {
|
||||
locale: string;
|
||||
};
|
||||
|
||||
export function LocaleToggle({ locale }: LocaleToggleProps) {
|
||||
const pathname = usePathname();
|
||||
const locales: AppLocale[] = ["de", "en", "ar"];
|
||||
const currentPath = stripLocalePrefix(pathname);
|
||||
const currentLocale = (["de", "en", "ar"].includes(locale) ? locale : "de") as AppLocale;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
{locales.map((targetLocale) => (
|
||||
<Button
|
||||
key={targetLocale}
|
||||
asChild
|
||||
type="button"
|
||||
variant={targetLocale === currentLocale ? "secondary" : "outline"}
|
||||
size="sm"
|
||||
className="text-xs"
|
||||
>
|
||||
<Link href={getLocalizedPath(targetLocale, currentPath)}>
|
||||
{targetLocale.toUpperCase()}
|
||||
</Link>
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import Link from "next/link";
|
||||
import { useLocale, useTranslations } from "next-intl";
|
||||
|
||||
import { Container } from "@/components/layout/container";
|
||||
import { getLocalizedPath } from "@/lib/locale";
|
||||
|
||||
const navItems = [
|
||||
{ key: "home", path: "" },
|
||||
{ key: "portfolio", path: "/portfolio" },
|
||||
{ key: "products", path: "/products" },
|
||||
{ key: "about", path: "/about" },
|
||||
{ key: "contact", path: "/contact" },
|
||||
];
|
||||
|
||||
type SiteFooterProps = {
|
||||
isAdmin?: boolean;
|
||||
};
|
||||
|
||||
export function SiteFooter({ isAdmin = false }: SiteFooterProps) {
|
||||
const locale = useLocale();
|
||||
const tNav = useTranslations("navigation");
|
||||
const tFooter = useTranslations("footer");
|
||||
|
||||
return (
|
||||
<footer className="border-t border-border bg-surface-2">
|
||||
<Container className="flex flex-col gap-4 py-8">
|
||||
<nav className="flex flex-wrap gap-x-5 gap-y-3 text-sm">
|
||||
{navItems.map((item) => (
|
||||
<Link
|
||||
key={item.key}
|
||||
href={getLocalizedPath(locale, item.path || "/")}
|
||||
className="text-muted-foreground hover:text-foreground"
|
||||
>
|
||||
{tNav(item.key)}
|
||||
</Link>
|
||||
))}
|
||||
{isAdmin ? (
|
||||
<a href="/root" className="text-muted-foreground hover:text-foreground">
|
||||
{tNav("root")}
|
||||
</a>
|
||||
) : null}
|
||||
</nav>
|
||||
<p className="text-xs text-muted-foreground/80">
|
||||
{tFooter("copyright", { year: new Date().getFullYear() })}
|
||||
</p>
|
||||
</Container>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
"use client";
|
||||
|
||||
import { Menu, X } from "lucide-react";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { useLocale, useTranslations } from "next-intl";
|
||||
import { useState } from "react";
|
||||
|
||||
import { Container } from "@/components/layout/container";
|
||||
import { LocaleToggle } from "@/components/layout/locale-toggle";
|
||||
import { ThemeToggle } from "@/components/theme-toggle";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { getLocalizedPath } from "@/lib/locale";
|
||||
|
||||
const navItems = [
|
||||
{ key: "home", path: "" },
|
||||
{ key: "portfolio", path: "/portfolio" },
|
||||
{ key: "products", path: "/products" },
|
||||
{ key: "about", path: "/about" },
|
||||
{ key: "contact", path: "/contact" },
|
||||
];
|
||||
|
||||
type SiteHeaderProps = {
|
||||
isAdmin?: boolean;
|
||||
};
|
||||
|
||||
function NavLinks({
|
||||
isAdmin,
|
||||
onNavigate,
|
||||
}: {
|
||||
isAdmin: boolean;
|
||||
onNavigate?: () => void;
|
||||
}) {
|
||||
const locale = useLocale();
|
||||
const t = useTranslations("navigation");
|
||||
|
||||
return (
|
||||
<>
|
||||
{navItems.map((item) => (
|
||||
<Link
|
||||
key={item.key}
|
||||
href={getLocalizedPath(locale, item.path || "/")}
|
||||
className="text-sm text-muted-foreground hover:text-foreground"
|
||||
onClick={onNavigate}
|
||||
>
|
||||
{t(item.key)}
|
||||
</Link>
|
||||
))}
|
||||
{isAdmin ? (
|
||||
<a
|
||||
href="/root"
|
||||
className="text-sm text-muted-foreground hover:text-foreground"
|
||||
onClick={onNavigate}
|
||||
>
|
||||
{t("root")}
|
||||
</a>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export function SiteHeader({ isAdmin = false }: SiteHeaderProps) {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const locale = useLocale();
|
||||
const t = useTranslations("navigation");
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 z-40 border-b border-border/80 bg-background/88 backdrop-blur-chrome">
|
||||
<Container>
|
||||
<div className="flex min-h-header items-center justify-between gap-4">
|
||||
<div className="flex items-center gap-4">
|
||||
<Link
|
||||
href={getLocalizedPath(locale)}
|
||||
className="inline-flex items-center rounded-nested border border-border bg-surface-1 px-3 py-2 shadow-xs"
|
||||
>
|
||||
<Image
|
||||
src="/logos/light-primary.svg"
|
||||
alt="mohfarawati"
|
||||
width={140}
|
||||
height={24}
|
||||
className="block h-6 w-auto dark:hidden"
|
||||
priority
|
||||
/>
|
||||
<Image
|
||||
src="/logos/dark-primary.svg"
|
||||
alt="mohfarawati"
|
||||
width={140}
|
||||
height={24}
|
||||
className="hidden h-6 w-auto dark:block"
|
||||
priority
|
||||
/>
|
||||
</Link>
|
||||
|
||||
<nav className="hidden items-center gap-5 md:flex">
|
||||
<NavLinks isAdmin={isAdmin} />
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div className="hidden items-center gap-2 md:flex">
|
||||
<ThemeToggle ariaLabel={t("themeToggle")} />
|
||||
<LocaleToggle locale={locale} />
|
||||
</div>
|
||||
|
||||
<Button
|
||||
type="button"
|
||||
onClick={() => setIsOpen((open) => !open)}
|
||||
variant="outline"
|
||||
size="icon"
|
||||
className="md:hidden"
|
||||
aria-label={isOpen ? t("closeMenu") : t("openMenu")}
|
||||
>
|
||||
{isOpen ? <X className="h-4 w-4" /> : <Menu className="h-4 w-4" />}
|
||||
</Button>
|
||||
</div>
|
||||
</Container>
|
||||
|
||||
{isOpen ? (
|
||||
<div className="border-t border-border/80 bg-surface-1 md:hidden">
|
||||
<Container className="py-4">
|
||||
<nav className="flex flex-col gap-3">
|
||||
<NavLinks isAdmin={isAdmin} onNavigate={() => setIsOpen(false)} />
|
||||
</nav>
|
||||
<div className="mt-4 flex items-center gap-2">
|
||||
<ThemeToggle ariaLabel={t("themeToggle")} />
|
||||
<LocaleToggle locale={locale} />
|
||||
</div>
|
||||
</Container>
|
||||
</div>
|
||||
) : null}
|
||||
</header>
|
||||
);
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { Menu, X } from "lucide-react";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { useLocale, useTranslations } from "next-intl";
|
||||
import { useState } from "react";
|
||||
|
||||
import { ThemeToggle } from "@/components/theme-toggle";
|
||||
import { Button } from "@/src/components/ui/button";
|
||||
|
||||
const navItems = [
|
||||
{ key: "home", path: "" },
|
||||
{ key: "portfolio", path: "/portfolio" },
|
||||
{ key: "products", path: "/products" },
|
||||
{ key: "about", path: "/about" },
|
||||
{ key: "contact", path: "/contact" },
|
||||
];
|
||||
|
||||
type NavbarProps = {
|
||||
isAdmin?: boolean;
|
||||
};
|
||||
|
||||
export function Navbar({ isAdmin = false }: NavbarProps) {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const locale = useLocale();
|
||||
const t = useTranslations("navigation");
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 z-40 border-b border-default bg-surface backdrop-blur">
|
||||
<div className="mx-auto flex w-full max-w-6xl items-center justify-between gap-4 px-4 py-3 sm:px-6 lg:px-8">
|
||||
<div className="flex items-center gap-3">
|
||||
<Link
|
||||
href={`/${locale}`}
|
||||
className="inline-flex items-center rounded-md border border-input bg-card px-3 py-2 shadow-xs"
|
||||
>
|
||||
<Image
|
||||
src="/logos/light-primary.svg"
|
||||
alt="mohfarawati logo"
|
||||
width={140}
|
||||
height={24}
|
||||
className="block h-6 w-auto dark:hidden"
|
||||
priority
|
||||
/>
|
||||
<Image
|
||||
src="/logos/dark-primary.svg"
|
||||
alt="mohfarawati logo"
|
||||
width={140}
|
||||
height={24}
|
||||
className="hidden h-6 w-auto dark:block"
|
||||
priority
|
||||
/>
|
||||
</Link>
|
||||
<nav className="hidden items-center gap-5 md:flex">
|
||||
{navItems.map((item) => (
|
||||
<Link
|
||||
key={item.key}
|
||||
href={`/${locale}${item.path}`}
|
||||
className="text-sm text-muted transition hover:text-fg"
|
||||
>
|
||||
{t(item.key)}
|
||||
</Link>
|
||||
))}
|
||||
{isAdmin ? (
|
||||
<a href="/root" className="text-sm text-muted transition hover:text-fg">
|
||||
{t("root")}
|
||||
</a>
|
||||
) : null}
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div className="hidden items-center gap-2 md:flex">
|
||||
<ThemeToggle />
|
||||
<Button type="button" variant="outline" size="sm" className="text-xs">
|
||||
{t("languagePlaceholder")}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
type="button"
|
||||
onClick={() => setIsOpen((open) => !open)}
|
||||
variant="outline"
|
||||
size="icon"
|
||||
className="md:hidden"
|
||||
aria-label={isOpen ? t("closeMenu") : t("openMenu")}
|
||||
>
|
||||
{isOpen ? <X className="h-4 w-4" /> : <Menu className="h-4 w-4" />}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{isOpen ? (
|
||||
<div className="border-t border-default px-4 py-4 md:hidden">
|
||||
<nav className="flex flex-col gap-3">
|
||||
{navItems.map((item) => (
|
||||
<Link
|
||||
key={item.key}
|
||||
href={`/${locale}${item.path}`}
|
||||
className="text-sm text-muted"
|
||||
onClick={() => setIsOpen(false)}
|
||||
>
|
||||
{t(item.key)}
|
||||
</Link>
|
||||
))}
|
||||
{isAdmin ? (
|
||||
<a href="/root" className="text-sm text-muted" onClick={() => setIsOpen(false)}>
|
||||
{t("root")}
|
||||
</a>
|
||||
) : null}
|
||||
</nav>
|
||||
<div className="mt-4 flex items-center gap-2">
|
||||
<ThemeToggle />
|
||||
<Button type="button" variant="outline" size="sm" className="text-xs">
|
||||
{t("languagePlaceholder")}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
</header>
|
||||
);
|
||||
}
|
||||
@@ -3,9 +3,14 @@
|
||||
import { Moon, Sun } from "lucide-react";
|
||||
import { useTheme } from "next-themes";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Button } from "@/src/components/ui/button";
|
||||
|
||||
export function ThemeToggle() {
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
type ThemeToggleProps = {
|
||||
ariaLabel?: string;
|
||||
};
|
||||
|
||||
export function ThemeToggle({ ariaLabel = "Toggle theme" }: ThemeToggleProps) {
|
||||
const { setTheme, theme, resolvedTheme } = useTheme();
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
@@ -15,7 +20,7 @@ export function ThemeToggle() {
|
||||
|
||||
if (!mounted) {
|
||||
return (
|
||||
<Button type="button" variant="outline" size="icon" aria-label="Toggle theme">
|
||||
<Button type="button" variant="outline" size="icon" aria-label={ariaLabel}>
|
||||
<Moon className="h-4 w-4" />
|
||||
</Button>
|
||||
);
|
||||
@@ -25,7 +30,7 @@ export function ThemeToggle() {
|
||||
const isDark = activeTheme === "dark";
|
||||
|
||||
return (
|
||||
<Button type="button" variant="outline" size="icon" onClick={() => setTheme(isDark ? "light" : "dark")} aria-label="Toggle theme">
|
||||
<Button type="button" variant="outline" size="icon" onClick={() => setTheme(isDark ? "light" : "dark")} aria-label={ariaLabel}>
|
||||
{isDark ? <Sun className="h-4 w-4" /> : <Moon className="h-4 w-4" />}
|
||||
</Button>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
import * as React from "react";
|
||||
import { cva, type VariantProps } from "class-variance-authority";
|
||||
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const appCardVariants = cva(
|
||||
"rounded-surface border transition-all duration-200",
|
||||
{
|
||||
variants: {
|
||||
level: {
|
||||
1: "border-border bg-surface-1 text-foreground shadow-card",
|
||||
2: "border-border bg-surface-2 text-foreground shadow-sm",
|
||||
3: "border-border/90 bg-surface-3 text-foreground shadow-panel",
|
||||
inverse: "border-transparent bg-surface-inverse text-surface-inverse-foreground shadow-lg",
|
||||
},
|
||||
padding: {
|
||||
none: "",
|
||||
sm: "p-4",
|
||||
md: "p-6",
|
||||
lg: "p-8",
|
||||
},
|
||||
interactive: {
|
||||
true: "hover:-translate-y-0.5 hover:border-border-strong hover:shadow-md",
|
||||
false: "",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
level: 1,
|
||||
padding: "none",
|
||||
interactive: false,
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
export interface AppCardProps
|
||||
extends React.HTMLAttributes<HTMLDivElement>,
|
||||
VariantProps<typeof appCardVariants> {}
|
||||
|
||||
const AppCard = React.forwardRef<HTMLDivElement, AppCardProps>(
|
||||
({ className, level, padding, interactive, ...props }, ref) => (
|
||||
<Card
|
||||
ref={ref}
|
||||
className={cn(
|
||||
appCardVariants({
|
||||
level,
|
||||
padding,
|
||||
interactive,
|
||||
}),
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
),
|
||||
);
|
||||
|
||||
AppCard.displayName = "AppCard";
|
||||
|
||||
export { AppCard, appCardVariants };
|
||||
@@ -4,15 +4,15 @@ import { cva, type VariantProps } from "class-variance-authority";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const badgeVariants = cva(
|
||||
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
||||
"inline-flex items-center rounded-pill border px-2.5 py-1 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
||||
{
|
||||
variants: {
|
||||
variant: {
|
||||
default: "border-transparent bg-primary text-primary-foreground",
|
||||
secondary: "border-transparent bg-secondary text-secondary-foreground",
|
||||
outline: "text-foreground",
|
||||
success: "border-transparent bg-emerald-600/20 text-emerald-700 dark:text-emerald-300",
|
||||
warning: "border-transparent bg-amber-500/20 text-amber-700 dark:text-amber-300",
|
||||
outline: "border-border bg-surface-1 text-foreground",
|
||||
success: "border-transparent bg-status-success-soft text-status-success",
|
||||
warning: "border-transparent bg-status-warning-soft text-status-warning",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
@@ -21,7 +21,9 @@ const badgeVariants = cva(
|
||||
},
|
||||
);
|
||||
|
||||
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
|
||||
export interface BadgeProps
|
||||
extends React.HTMLAttributes<HTMLDivElement>,
|
||||
VariantProps<typeof badgeVariants> {}
|
||||
|
||||
function Badge({ className, variant, ...props }: BadgeProps) {
|
||||
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
|
||||
@@ -5,21 +5,21 @@ import { cva, type VariantProps } from "class-variance-authority";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const buttonVariants = cva(
|
||||
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
||||
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-nested text-sm font-medium ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
||||
{
|
||||
variants: {
|
||||
variant: {
|
||||
default: "bg-primary text-primary-foreground shadow-xs hover:brightness-95",
|
||||
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/85",
|
||||
outline: "border border-input bg-background shadow-xs hover:bg-muted",
|
||||
ghost: "hover:bg-muted hover:text-foreground",
|
||||
link: "text-primary underline-offset-4 hover:underline",
|
||||
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
||||
outline: "border border-border bg-surface-1 text-foreground shadow-xs hover:border-border-strong hover:bg-surface-2",
|
||||
ghost: "text-muted-foreground hover:bg-muted hover:text-foreground",
|
||||
link: "rounded-none text-primary underline-offset-4 hover:underline",
|
||||
destructive: "bg-destructive text-destructive-foreground shadow-xs hover:brightness-95",
|
||||
},
|
||||
size: {
|
||||
default: "h-10 px-4 py-2",
|
||||
sm: "h-9 rounded-md px-3",
|
||||
lg: "h-11 rounded-md px-8",
|
||||
sm: "h-9 px-3",
|
||||
lg: "h-11 px-6",
|
||||
icon: "h-10 w-10",
|
||||
},
|
||||
},
|
||||
@@ -40,9 +40,16 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
({ className, variant, size, asChild = false, ...props }, ref) => {
|
||||
const Comp = asChild ? Slot : "button";
|
||||
|
||||
return <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />;
|
||||
return (
|
||||
<Comp
|
||||
className={cn(buttonVariants({ variant, size, className }))}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Button.displayName = "Button";
|
||||
|
||||
export { Button, buttonVariants };
|
||||
@@ -7,38 +7,59 @@ const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElemen
|
||||
<div
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"rounded-[var(--radius-card)] border border-border bg-card text-card-foreground shadow-card",
|
||||
"rounded-surface border border-border bg-surface-1 text-card-foreground shadow-card",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
),
|
||||
);
|
||||
|
||||
Card.displayName = "Card";
|
||||
|
||||
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
||||
({ className, ...props }, ref) => <div ref={ref} className={cn("flex flex-col space-y-1.5 p-6", className)} {...props} />,
|
||||
({ className, ...props }, ref) => (
|
||||
<div ref={ref} className={cn("flex flex-col gap-1.5 p-6", className)} {...props} />
|
||||
),
|
||||
);
|
||||
|
||||
CardHeader.displayName = "CardHeader";
|
||||
|
||||
const CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
|
||||
({ className, ...props }, ref) => <h3 ref={ref} className={cn("text-2xl font-semibold leading-none tracking-tight", className)} {...props} />,
|
||||
({ className, ...props }, ref) => (
|
||||
<h3
|
||||
ref={ref}
|
||||
className={cn("text-2xl font-semibold leading-none tracking-tight", className)}
|
||||
{...props}
|
||||
/>
|
||||
),
|
||||
);
|
||||
|
||||
CardTitle.displayName = "CardTitle";
|
||||
|
||||
const CardDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
|
||||
({ className, ...props }, ref) => <p ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />,
|
||||
);
|
||||
const CardDescription = React.forwardRef<
|
||||
HTMLParagraphElement,
|
||||
React.HTMLAttributes<HTMLParagraphElement>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<p ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />
|
||||
));
|
||||
|
||||
CardDescription.displayName = "CardDescription";
|
||||
|
||||
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
||||
({ className, ...props }, ref) => <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />,
|
||||
({ className, ...props }, ref) => (
|
||||
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
|
||||
),
|
||||
);
|
||||
|
||||
CardContent.displayName = "CardContent";
|
||||
|
||||
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
||||
({ className, ...props }, ref) => <div ref={ref} className={cn("flex items-center p-6 pt-0", className)} {...props} />,
|
||||
({ className, ...props }, ref) => (
|
||||
<div ref={ref} className={cn("flex items-center p-6 pt-0", className)} {...props} />
|
||||
),
|
||||
);
|
||||
|
||||
CardFooter.displayName = "CardFooter";
|
||||
|
||||
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
||||
@@ -0,0 +1,21 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
|
||||
({ className, type, ...props }, ref) => (
|
||||
<input
|
||||
type={type}
|
||||
className={cn(
|
||||
"flex h-10 w-full rounded-nested border border-input bg-surface-1 px-3 py-2 text-sm text-foreground ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
||||
className,
|
||||
)}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
),
|
||||
);
|
||||
|
||||
Input.displayName = "Input";
|
||||
|
||||
export { Input };
|
||||
@@ -0,0 +1,17 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
function Label({
|
||||
className,
|
||||
...props
|
||||
}: React.LabelHTMLAttributes<HTMLLabelElement>) {
|
||||
return (
|
||||
<label
|
||||
className={cn("text-sm font-medium text-foreground/90", className)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export { Label };
|
||||
@@ -6,7 +6,11 @@ type SeparatorProps = React.HTMLAttributes<HTMLDivElement> & {
|
||||
orientation?: "horizontal" | "vertical";
|
||||
};
|
||||
|
||||
function Separator({ className, orientation = "horizontal", ...props }: SeparatorProps) {
|
||||
function Separator({
|
||||
className,
|
||||
orientation = "horizontal",
|
||||
...props
|
||||
}: SeparatorProps) {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
@@ -0,0 +1,114 @@
|
||||
"use client";
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
type TabsContextValue = {
|
||||
value: string;
|
||||
setValue: (value: string) => void;
|
||||
};
|
||||
|
||||
const TabsContext = React.createContext<TabsContextValue | null>(null);
|
||||
|
||||
function useTabsContext() {
|
||||
const context = React.useContext(TabsContext);
|
||||
|
||||
if (!context) {
|
||||
throw new Error("Tabs components must be used within Tabs.");
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
type TabsProps = {
|
||||
defaultValue: string;
|
||||
children: React.ReactNode;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
function Tabs({ defaultValue, children, className }: TabsProps) {
|
||||
const [value, setValue] = React.useState(defaultValue);
|
||||
|
||||
return (
|
||||
<TabsContext.Provider value={{ value, setValue }}>
|
||||
<div className={cn("w-full", className)}>{children}</div>
|
||||
</TabsContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
function TabsList({
|
||||
className,
|
||||
...props
|
||||
}: React.HTMLAttributes<HTMLDivElement>) {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"inline-flex h-auto flex-wrap items-center gap-2 rounded-surface border border-border bg-surface-2 p-1.5",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
type TabsTriggerProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
||||
value: string;
|
||||
};
|
||||
|
||||
function TabsTrigger({
|
||||
className,
|
||||
value,
|
||||
onClick,
|
||||
...props
|
||||
}: TabsTriggerProps) {
|
||||
const { value: activeValue, setValue } = useTabsContext();
|
||||
const isActive = activeValue === value;
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className={cn(
|
||||
"inline-flex items-center justify-center rounded-nested px-3 py-2 text-sm font-medium text-muted-foreground transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
||||
isActive && "bg-surface-1 text-foreground shadow-xs",
|
||||
className,
|
||||
)}
|
||||
onClick={(event) => {
|
||||
setValue(value);
|
||||
onClick?.(event);
|
||||
}}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
type TabsContentProps = React.HTMLAttributes<HTMLDivElement> & {
|
||||
value: string;
|
||||
};
|
||||
|
||||
function TabsContent({
|
||||
className,
|
||||
value,
|
||||
children,
|
||||
...props
|
||||
}: TabsContentProps) {
|
||||
const { value: activeValue } = useTabsContext();
|
||||
|
||||
if (activeValue !== value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"mt-6 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
||||
@@ -0,0 +1,20 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const Textarea = React.forwardRef<HTMLTextAreaElement, React.ComponentProps<"textarea">>(
|
||||
({ className, ...props }, ref) => (
|
||||
<textarea
|
||||
className={cn(
|
||||
"flex min-h-[112px] w-full rounded-nested border border-input bg-surface-1 px-3 py-2 text-sm text-foreground ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
||||
className,
|
||||
)}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
),
|
||||
);
|
||||
|
||||
Textarea.displayName = "Textarea";
|
||||
|
||||
export { Textarea };
|
||||
@@ -0,0 +1,522 @@
|
||||
import { Layers3, Type } from "lucide-react";
|
||||
|
||||
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";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
|
||||
type UiKitShowcaseProps = {
|
||||
localeKey: "de" | "en";
|
||||
};
|
||||
|
||||
function UiKitSection({
|
||||
title,
|
||||
description,
|
||||
children,
|
||||
}: {
|
||||
title: string;
|
||||
description: string;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<AppCard>
|
||||
<CardHeader>
|
||||
<CardTitle className="text-xl">{title}</CardTitle>
|
||||
<CardDescription>{description}</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>{children}</CardContent>
|
||||
</AppCard>
|
||||
);
|
||||
}
|
||||
|
||||
export function UiKitShowcase({ localeKey }: UiKitShowcaseProps) {
|
||||
const copy =
|
||||
localeKey === "de"
|
||||
? {
|
||||
title: "UI Kit",
|
||||
intro:
|
||||
"Zentrale Referenz fuer globale Oberflaechen, Steuerelemente und verschachtelte Ebenen.",
|
||||
cards: "Cards",
|
||||
buttons: "Buttons",
|
||||
inputs: "Inputs",
|
||||
badges: "Badges",
|
||||
tabs: "Tabs",
|
||||
surfaces: "Surfaces",
|
||||
typography: "Typography",
|
||||
headers: "Headers",
|
||||
cardsDesc:
|
||||
"Aussenflaechen, innere Karten und verschachtelte Ebenen mit einheitlicher Hierarchie.",
|
||||
buttonsDesc:
|
||||
"Globale Button Varianten und Groessen aus einer zentralen Quelle.",
|
||||
inputsDesc:
|
||||
"Gemeinsame Feldzustande mit derselben inneren Radius- und Oberflaechenlogik.",
|
||||
badgesDesc:
|
||||
"Kleine Statusmarken mit minimaler, konsistenter Formensprache.",
|
||||
surfacesDesc:
|
||||
"Die gesamte Oberflaechenhierarchie basiert auf Level 1 bis 3 und einer inversen Ebene.",
|
||||
typographyDesc:
|
||||
"Typografische Grundstufen fuer Seiten, Sektionen und Metainformationen.",
|
||||
headersDesc:
|
||||
"Header Muster fuer Seiten und Sektionen innerhalb des Systems.",
|
||||
tabsDesc:
|
||||
"Tabs bleiben in einer Route und verwenden dieselbe verschachtelte Steuerlogik.",
|
||||
outerCard: "Aeussere Card",
|
||||
surfaceLevel: "Surface Level 1",
|
||||
innerCard: "Innere Card",
|
||||
nestedContent: "Verschachtelte Inhalte nutzen den zweiten Radius und eine weichere Oberflaeche.",
|
||||
nestedSurface: "Verschachtelte Ebene",
|
||||
nestedSurfaceText: "Mehr Tiefe ohne einen neuen Component Stil zu erfinden.",
|
||||
interactiveOuterCard: "Interaktive aeussere Card",
|
||||
hoverText: "Das Hover Verhalten bleibt an dieselbe Oberflaechenebene gebunden.",
|
||||
inverseOuterCard: "Inverse aeussere Card",
|
||||
inverseOuterCardText: "Nur verwenden, wenn ein starker Kontrastblock wirklich noetig ist.",
|
||||
default: "Standard",
|
||||
secondary: "Sekundaer",
|
||||
outline: "Outline",
|
||||
ghost: "Ghost",
|
||||
destructive: "Destruktiv",
|
||||
linkButton: "Link Button",
|
||||
small: "Klein",
|
||||
large: "Gross",
|
||||
iconButton: "Icon Button",
|
||||
disabled: "Deaktiviert",
|
||||
defaultInput: "Standard Input",
|
||||
placeholderText: "Platzhaltertext",
|
||||
filledInput: "Gefuellter Input",
|
||||
filledValue: "Gefuellter Wert",
|
||||
disabledInput: "Deaktivierter Input",
|
||||
disabledState: "Deaktivierter Zustand",
|
||||
focusPreview: "Focus Vorschau",
|
||||
focusedLook: "Fokussierte Ansicht",
|
||||
errorPreview: "Fehler Vorschau",
|
||||
invalidValue: "Ungueltiger Wert",
|
||||
textarea: "Textarea",
|
||||
textareaValue: "Laengerer Feldzustand fuer mehrzeilige Inhalte.",
|
||||
success: "Erfolg",
|
||||
warning: "Warnung",
|
||||
first: "Erste",
|
||||
second: "Zweite",
|
||||
third: "Dritte",
|
||||
firstTabText: "Inhalt des ersten Tabs innerhalb einer Level 1 Oberflaeche.",
|
||||
secondTabText: "Inhalt des zweiten Tabs mit derselben globalen Hierarchie.",
|
||||
thirdTabText: "Inhalt des dritten Tabs ohne lokale Sonderstile.",
|
||||
surfaceOne: "Surface 1",
|
||||
surfaceOneText: "Aeussere und primaere Container.",
|
||||
surfaceTwo: "Surface 2",
|
||||
surfaceTwoText: "Innere und unterstuetzende Panels.",
|
||||
surfaceThree: "Surface 3",
|
||||
surfaceThreeText: "Mehr Betonung ohne neue Styling-Zweige.",
|
||||
inverse: "Inverse",
|
||||
inverseText: "Reserviert fuer bewusst eingesetzte Kontrastbloecke.",
|
||||
eyebrow: "Eyebrow",
|
||||
pageHeading: "Seitenueberschrift",
|
||||
pageHeadingText: "Begleitender Absatz fuer primaere Seiteneinfuehrungen und Zusammenfassungen.",
|
||||
sectionHeading: "Abschnittsueberschrift",
|
||||
sectionHeadingText: "Fuer gruppierte Bereiche innerhalb einer aeusseren Seitenoberflaeche.",
|
||||
strongSupportingText: "Betonter Begleittext",
|
||||
pageHeader: "Seitenheader",
|
||||
outerSurfaceHeader: "Header der aeusseren Oberflaeche",
|
||||
outerSurfaceHeaderText: "Dieses Muster wird fuer Seitensektionen mit staerkerer Hierarchie genutzt.",
|
||||
sectionHeader: "Abschnittsheader",
|
||||
nestedBlockHeading: "Ueberschrift des verschachtelten Blocks",
|
||||
nestedBlockHeadingText: "Innerhalb einer aeusseren Card verwenden, wenn Inhalte bereits gruppiert sind."
|
||||
}
|
||||
: {
|
||||
title: "UI Kit",
|
||||
intro:
|
||||
"Central reference for global surfaces, controls, and nested interface levels.",
|
||||
cards: "Cards",
|
||||
buttons: "Buttons",
|
||||
inputs: "Inputs",
|
||||
badges: "Badges",
|
||||
tabs: "Tabs",
|
||||
surfaces: "Surfaces",
|
||||
typography: "Typography",
|
||||
headers: "Headers",
|
||||
cardsDesc:
|
||||
"Outer surfaces, inner cards, and nested levels with one consistent hierarchy.",
|
||||
buttonsDesc:
|
||||
"Global button variants and sizes from one shared source of truth.",
|
||||
inputsDesc:
|
||||
"Shared field states using the same inner radius and surface logic.",
|
||||
badgesDesc:
|
||||
"Small status markers with a minimal and consistent shape language.",
|
||||
surfacesDesc:
|
||||
"The full surface hierarchy is built on level 1 through 3 and one inverse layer.",
|
||||
typographyDesc:
|
||||
"Typography foundations for pages, sections, and supporting copy.",
|
||||
headersDesc:
|
||||
"Header patterns for pages and sections inside the system.",
|
||||
tabsDesc:
|
||||
"Tabs stay within one route and use the same nested control logic.",
|
||||
outerCard: "Outer card",
|
||||
surfaceLevel: "Surface level 1",
|
||||
innerCard: "Inner card",
|
||||
nestedContent: "Nested content uses the secondary radius and a softer surface.",
|
||||
nestedSurface: "Nested surface",
|
||||
nestedSurfaceText: "Deeper emphasis without inventing a new component style.",
|
||||
interactiveOuterCard: "Interactive outer card",
|
||||
hoverText: "Hover behavior stays attached to the same surface level.",
|
||||
inverseOuterCard: "Inverse outer card",
|
||||
inverseOuterCardText: "Use only when a strong contrast block is truly needed.",
|
||||
default: "Default",
|
||||
secondary: "Secondary",
|
||||
outline: "Outline",
|
||||
ghost: "Ghost",
|
||||
destructive: "Destructive",
|
||||
linkButton: "Link button",
|
||||
small: "Small",
|
||||
large: "Large",
|
||||
iconButton: "Icon button",
|
||||
disabled: "Disabled",
|
||||
defaultInput: "Default input",
|
||||
placeholderText: "Placeholder text",
|
||||
filledInput: "Filled input",
|
||||
filledValue: "Filled value",
|
||||
disabledInput: "Disabled input",
|
||||
disabledState: "Disabled state",
|
||||
focusPreview: "Focus-style preview",
|
||||
focusedLook: "Focused look",
|
||||
errorPreview: "Error-style preview",
|
||||
invalidValue: "Invalid value",
|
||||
textarea: "Textarea",
|
||||
textareaValue: "Longer field state for multiline content.",
|
||||
success: "Success",
|
||||
warning: "Warning",
|
||||
first: "First",
|
||||
second: "Second",
|
||||
third: "Third",
|
||||
firstTabText: "First tab content inside a level 1 surface.",
|
||||
secondTabText: "Second tab content using the same global hierarchy.",
|
||||
thirdTabText: "Third tab content without local custom styling.",
|
||||
surfaceOne: "Surface 1",
|
||||
surfaceOneText: "Outer and primary containers.",
|
||||
surfaceTwo: "Surface 2",
|
||||
surfaceTwoText: "Inner and supporting panels.",
|
||||
surfaceThree: "Surface 3",
|
||||
surfaceThreeText: "Raised emphasis without new styling branches.",
|
||||
inverse: "Inverse",
|
||||
inverseText: "Reserved for deliberate high-contrast blocks.",
|
||||
eyebrow: "Eyebrow",
|
||||
pageHeading: "Page heading",
|
||||
pageHeadingText: "Supporting paragraph text for primary page introductions and summaries.",
|
||||
sectionHeading: "Section heading",
|
||||
sectionHeadingText: "Use this for grouped blocks inside an outer page surface.",
|
||||
strongSupportingText: "Strong supporting text",
|
||||
pageHeader: "Page header",
|
||||
outerSurfaceHeader: "Outer surface header",
|
||||
outerSurfaceHeaderText: "This pattern is used for page-level sections that need stronger hierarchy.",
|
||||
sectionHeader: "Section header",
|
||||
nestedBlockHeading: "Nested block heading",
|
||||
nestedBlockHeadingText: "Use inside an outer card when content is already grouped."
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-section">
|
||||
<AppCard level={3}>
|
||||
<CardContent className="flex flex-col gap-4 p-6 lg:p-10">
|
||||
<div className="inline-flex w-fit 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">
|
||||
<Layers3 className="h-3.5 w-3.5 text-brand-secondary" />
|
||||
{copy.title}
|
||||
</div>
|
||||
<div className="space-y-3">
|
||||
<h1 className="text-3xl font-semibold tracking-tight text-foreground sm:text-5xl">
|
||||
{copy.title}
|
||||
</h1>
|
||||
<p className="max-w-3xl text-base text-muted-foreground sm:text-lg">
|
||||
{copy.intro}
|
||||
</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
|
||||
<Tabs defaultValue="cards">
|
||||
<TabsList>
|
||||
<TabsTrigger value="cards">{copy.cards}</TabsTrigger>
|
||||
<TabsTrigger value="buttons">{copy.buttons}</TabsTrigger>
|
||||
<TabsTrigger value="inputs">{copy.inputs}</TabsTrigger>
|
||||
<TabsTrigger value="badges">{copy.badges}</TabsTrigger>
|
||||
<TabsTrigger value="tabs">{copy.tabs}</TabsTrigger>
|
||||
<TabsTrigger value="surfaces">{copy.surfaces}</TabsTrigger>
|
||||
<TabsTrigger value="typography">{copy.typography}</TabsTrigger>
|
||||
<TabsTrigger value="headers">{copy.headers}</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="cards">
|
||||
<UiKitSection title={copy.cards} description={copy.cardsDesc}>
|
||||
<div className="grid gap-6 lg:grid-cols-2">
|
||||
<AppCard level={1}>
|
||||
<CardContent className="space-y-4 p-6">
|
||||
<div>
|
||||
<p className="text-sm font-medium text-muted-foreground">{copy.outerCard}</p>
|
||||
<h3 className="mt-1 text-lg font-semibold text-foreground">{copy.surfaceLevel}</h3>
|
||||
</div>
|
||||
<AppCard level={2}>
|
||||
<CardContent className="space-y-3 p-5">
|
||||
<div>
|
||||
<p className="text-sm font-medium text-muted-foreground">{copy.innerCard}</p>
|
||||
<p className="mt-1 text-sm text-muted-foreground">
|
||||
{copy.nestedContent}
|
||||
</p>
|
||||
</div>
|
||||
<AppCard level={3}>
|
||||
<CardContent className="space-y-2 p-4">
|
||||
<p className="text-sm font-medium text-foreground">{copy.nestedSurface}</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{copy.nestedSurfaceText}
|
||||
</p>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
|
||||
<div className="grid gap-4">
|
||||
<AppCard level={1} interactive>
|
||||
<CardContent className="p-5">
|
||||
<p className="text-sm font-medium text-muted-foreground">{copy.interactiveOuterCard}</p>
|
||||
<p className="mt-2 text-sm text-muted-foreground">
|
||||
{copy.hoverText}
|
||||
</p>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
<AppCard level="inverse">
|
||||
<CardContent className="p-5">
|
||||
<p className="text-sm font-medium text-surface-inverse-foreground/80">
|
||||
{copy.inverseOuterCard}
|
||||
</p>
|
||||
<p className="mt-2 text-sm text-surface-inverse-foreground/88">
|
||||
{copy.inverseOuterCardText}
|
||||
</p>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
</div>
|
||||
</div>
|
||||
</UiKitSection>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="buttons">
|
||||
<UiKitSection title={copy.buttons} description={copy.buttonsDesc}>
|
||||
<div className="grid gap-6 lg:grid-cols-2">
|
||||
<AppCard level={2}>
|
||||
<CardContent className="flex flex-wrap gap-3 p-5">
|
||||
<Button>{copy.default}</Button>
|
||||
<Button variant="secondary">{copy.secondary}</Button>
|
||||
<Button variant="outline">{copy.outline}</Button>
|
||||
<Button variant="ghost">{copy.ghost}</Button>
|
||||
<Button variant="destructive">{copy.destructive}</Button>
|
||||
<Button variant="link">{copy.linkButton}</Button>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
<AppCard level={2}>
|
||||
<CardContent className="flex flex-wrap items-center gap-3 p-5">
|
||||
<Button size="sm">{copy.small}</Button>
|
||||
<Button>{copy.default}</Button>
|
||||
<Button size="lg">{copy.large}</Button>
|
||||
<Button size="icon" aria-label={copy.iconButton}>
|
||||
<Layers3 className="h-4 w-4" />
|
||||
</Button>
|
||||
<Button disabled>{copy.disabled}</Button>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
</div>
|
||||
</UiKitSection>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="inputs">
|
||||
<UiKitSection title={copy.inputs} description={copy.inputsDesc}>
|
||||
<div className="grid gap-6 lg:grid-cols-2">
|
||||
<AppCard level={2}>
|
||||
<CardContent className="grid gap-4 p-5">
|
||||
<Label className="grid gap-2">
|
||||
{copy.defaultInput}
|
||||
<Input placeholder={copy.placeholderText} />
|
||||
</Label>
|
||||
<Label className="grid gap-2">
|
||||
{copy.filledInput}
|
||||
<Input defaultValue={copy.filledValue} />
|
||||
</Label>
|
||||
<Label className="grid gap-2">
|
||||
{copy.disabledInput}
|
||||
<Input disabled defaultValue={copy.disabledState} />
|
||||
</Label>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
<AppCard level={2}>
|
||||
<CardContent className="grid gap-4 p-5">
|
||||
<Label className="grid gap-2">
|
||||
{copy.focusPreview}
|
||||
<Input
|
||||
defaultValue={copy.focusedLook}
|
||||
className="ring-2 ring-ring ring-offset-2"
|
||||
readOnly
|
||||
/>
|
||||
</Label>
|
||||
<Label className="grid gap-2">
|
||||
{copy.errorPreview}
|
||||
<Input
|
||||
defaultValue={copy.invalidValue}
|
||||
className="border-destructive text-destructive focus-visible:ring-destructive"
|
||||
readOnly
|
||||
/>
|
||||
</Label>
|
||||
<Label className="grid gap-2">
|
||||
{copy.textarea}
|
||||
<Textarea defaultValue={copy.textareaValue} />
|
||||
</Label>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
</div>
|
||||
</UiKitSection>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="badges">
|
||||
<UiKitSection title={copy.badges} description={copy.badgesDesc}>
|
||||
<div className="flex flex-wrap gap-3">
|
||||
<Badge>{copy.default}</Badge>
|
||||
<Badge variant="secondary">{copy.secondary}</Badge>
|
||||
<Badge variant="outline">{copy.outline}</Badge>
|
||||
<Badge variant="success">{copy.success}</Badge>
|
||||
<Badge variant="warning">{copy.warning}</Badge>
|
||||
</div>
|
||||
</UiKitSection>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="tabs">
|
||||
<UiKitSection title={copy.tabs} description={copy.tabsDesc}>
|
||||
<AppCard level={2}>
|
||||
<CardContent className="space-y-4 p-5">
|
||||
<Tabs defaultValue="first">
|
||||
<TabsList>
|
||||
<TabsTrigger value="first">{copy.first}</TabsTrigger>
|
||||
<TabsTrigger value="second">{copy.second}</TabsTrigger>
|
||||
<TabsTrigger value="third">{copy.third}</TabsTrigger>
|
||||
</TabsList>
|
||||
<TabsContent value="first">
|
||||
<AppCard level={1}>
|
||||
<CardContent className="p-4 text-sm text-muted-foreground">
|
||||
{copy.firstTabText}
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
</TabsContent>
|
||||
<TabsContent value="second">
|
||||
<AppCard level={1}>
|
||||
<CardContent className="p-4 text-sm text-muted-foreground">
|
||||
{copy.secondTabText}
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
</TabsContent>
|
||||
<TabsContent value="third">
|
||||
<AppCard level={1}>
|
||||
<CardContent className="p-4 text-sm text-muted-foreground">
|
||||
{copy.thirdTabText}
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
</UiKitSection>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="surfaces">
|
||||
<UiKitSection title={copy.surfaces} description={copy.surfacesDesc}>
|
||||
<div className="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
|
||||
<AppCard level={1}>
|
||||
<CardContent className="p-5">
|
||||
<p className="font-medium">{copy.surfaceOne}</p>
|
||||
<p className="mt-2 text-sm text-muted-foreground">{copy.surfaceOneText}</p>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
<AppCard level={2}>
|
||||
<CardContent className="p-5">
|
||||
<p className="font-medium">{copy.surfaceTwo}</p>
|
||||
<p className="mt-2 text-sm text-muted-foreground">{copy.surfaceTwoText}</p>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
<AppCard level={3}>
|
||||
<CardContent className="p-5">
|
||||
<p className="font-medium">{copy.surfaceThree}</p>
|
||||
<p className="mt-2 text-sm text-muted-foreground">{copy.surfaceThreeText}</p>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
<AppCard level="inverse">
|
||||
<CardContent className="p-5">
|
||||
<p className="font-medium text-surface-inverse-foreground">{copy.inverse}</p>
|
||||
<p className="mt-2 text-sm text-surface-inverse-foreground/88">{copy.inverseText}</p>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
</div>
|
||||
</UiKitSection>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="typography">
|
||||
<UiKitSection title={copy.typography} description={copy.typographyDesc}>
|
||||
<div className="space-y-6">
|
||||
<div className="space-y-2">
|
||||
<p className="text-sm font-medium uppercase tracking-[0.14em] text-muted-foreground">
|
||||
{copy.eyebrow}
|
||||
</p>
|
||||
<h1 className="text-4xl font-semibold tracking-tight text-foreground">
|
||||
{copy.pageHeading}
|
||||
</h1>
|
||||
<p className="max-w-2xl text-base text-muted-foreground">
|
||||
{copy.pageHeadingText}
|
||||
</p>
|
||||
</div>
|
||||
<AppCard level={2}>
|
||||
<CardContent className="space-y-3 p-5">
|
||||
<h2 className="text-2xl font-semibold text-foreground">{copy.sectionHeading}</h2>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{copy.sectionHeadingText}
|
||||
</p>
|
||||
<p className="text-sm font-medium text-foreground/82">{copy.strongSupportingText}</p>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
</div>
|
||||
</UiKitSection>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="headers">
|
||||
<UiKitSection title={copy.headers} description={copy.headersDesc}>
|
||||
<div className="grid gap-6 lg:grid-cols-2">
|
||||
<AppCard level={3}>
|
||||
<CardContent className="space-y-3 p-6">
|
||||
<div className="inline-flex w-fit 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">
|
||||
<Type className="h-3.5 w-3.5 text-brand-primary" />
|
||||
{copy.pageHeader}
|
||||
</div>
|
||||
<h2 className="text-3xl font-semibold tracking-tight text-foreground">
|
||||
{copy.outerSurfaceHeader}
|
||||
</h2>
|
||||
<p className="text-base text-muted-foreground">
|
||||
{copy.outerSurfaceHeaderText}
|
||||
</p>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
<AppCard level={2}>
|
||||
<CardContent className="space-y-3 p-5">
|
||||
<p className="text-sm font-medium text-muted-foreground">{copy.sectionHeader}</p>
|
||||
<h3 className="text-xl font-semibold text-foreground">{copy.nestedBlockHeading}</h3>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{copy.nestedBlockHeadingText}
|
||||
</p>
|
||||
</CardContent>
|
||||
</AppCard>
|
||||
</div>
|
||||
</UiKitSection>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
+4
-1
@@ -1,6 +1,9 @@
|
||||
import { defineRouting } from "next-intl/routing";
|
||||
|
||||
export const routing = defineRouting({
|
||||
locales: ["en", "de"],
|
||||
locales: ["de", "en", "ar"],
|
||||
defaultLocale: "de",
|
||||
localePrefix: "as-needed",
|
||||
localeCookie: false,
|
||||
localeDetection: false,
|
||||
});
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
import { routing } from "@/i18n/routing";
|
||||
|
||||
export type AppLocale = (typeof routing.locales)[number];
|
||||
|
||||
export function resolveLocale(locale: string): AppLocale {
|
||||
if (locale === "en" || locale === "ar") {
|
||||
return locale;
|
||||
}
|
||||
|
||||
return routing.defaultLocale;
|
||||
}
|
||||
|
||||
export function getDirection(locale: string): "ltr" | "rtl" {
|
||||
return resolveLocale(locale) === "ar" ? "rtl" : "ltr";
|
||||
}
|
||||
|
||||
export function stripLocalePrefix(pathname: string): string {
|
||||
for (const locale of routing.locales) {
|
||||
if (pathname === `/${locale}`) {
|
||||
return "/";
|
||||
}
|
||||
|
||||
if (pathname.startsWith(`/${locale}/`)) {
|
||||
return pathname.slice(locale.length + 1);
|
||||
}
|
||||
}
|
||||
|
||||
return pathname || "/";
|
||||
}
|
||||
|
||||
export function getLocalizedPath(locale: string, pathname = "/"): string {
|
||||
const localeKey = resolveLocale(locale);
|
||||
const normalizedPath = pathname === "" ? "/" : pathname;
|
||||
const strippedPath = stripLocalePrefix(normalizedPath);
|
||||
|
||||
if (localeKey === routing.defaultLocale) {
|
||||
return strippedPath;
|
||||
}
|
||||
|
||||
return strippedPath === "/" ? `/${localeKey}` : `/${localeKey}${strippedPath}`;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
import type { Metadata } from "next";
|
||||
|
||||
import { routing } from "@/i18n/routing";
|
||||
import { AppLocale, getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
|
||||
function getSiteUrl(): URL {
|
||||
return new URL(process.env.NEXT_PUBLIC_SITE_URL ?? "https://mohfarawati.de");
|
||||
}
|
||||
|
||||
function toAbsoluteUrl(pathname: string): string {
|
||||
return new URL(pathname, getSiteUrl()).toString();
|
||||
}
|
||||
|
||||
export function buildLocaleAlternates(pathname: string) {
|
||||
const languages = Object.fromEntries(
|
||||
routing.locales.map((locale) => [locale, toAbsoluteUrl(getLocalizedPath(locale, pathname))]),
|
||||
) as Record<AppLocale, string>;
|
||||
|
||||
return {
|
||||
canonical: toAbsoluteUrl(getLocalizedPath(routing.defaultLocale, pathname)),
|
||||
languages: {
|
||||
...languages,
|
||||
"x-default": toAbsoluteUrl(getLocalizedPath(routing.defaultLocale, pathname)),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
type LocalizedMetadataInput = {
|
||||
locale: string;
|
||||
pathname: string;
|
||||
title: string;
|
||||
description: string;
|
||||
};
|
||||
|
||||
export function buildLocalizedMetadata({
|
||||
locale,
|
||||
pathname,
|
||||
title,
|
||||
description,
|
||||
}: LocalizedMetadataInput): Metadata {
|
||||
const localeKey = resolveLocale(locale);
|
||||
|
||||
return {
|
||||
title,
|
||||
description,
|
||||
alternates: buildLocaleAlternates(pathname),
|
||||
openGraph: {
|
||||
title,
|
||||
description,
|
||||
url: toAbsoluteUrl(getLocalizedPath(localeKey, pathname)),
|
||||
siteName: "moh-sass",
|
||||
locale: localeKey,
|
||||
type: "website",
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import { LayoutDashboard, ShieldAlert, SwatchBook, type LucideIcon } from "lucide-react";
|
||||
|
||||
type RootNavigationCopy = {
|
||||
overview: string;
|
||||
maintenance: string;
|
||||
uiKit: string;
|
||||
};
|
||||
|
||||
export type RootNavItem = {
|
||||
label: string;
|
||||
href: string;
|
||||
icon: LucideIcon;
|
||||
active?: boolean;
|
||||
};
|
||||
|
||||
export function getRootNavigation(
|
||||
copy: RootNavigationCopy,
|
||||
active: "overview" | "maintenance" | "ui-kit",
|
||||
): RootNavItem[] {
|
||||
return [
|
||||
{
|
||||
label: copy.overview,
|
||||
href: "/root",
|
||||
icon: LayoutDashboard,
|
||||
active: active === "overview",
|
||||
},
|
||||
{
|
||||
label: copy.maintenance,
|
||||
href: "/root/maintenance",
|
||||
icon: ShieldAlert,
|
||||
active: active === "maintenance",
|
||||
},
|
||||
{
|
||||
label: copy.uiKit,
|
||||
href: "/root/ui-kit",
|
||||
icon: SwatchBook,
|
||||
active: active === "ui-kit",
|
||||
},
|
||||
];
|
||||
}
|
||||
+25
-5
@@ -1,4 +1,4 @@
|
||||
export type AppLocale = "de" | "en";
|
||||
import type { AppLocale } from "@/lib/locale";
|
||||
|
||||
type LocalizedText = Record<AppLocale, string>;
|
||||
|
||||
@@ -24,14 +24,17 @@ export const portfolioItems: PortfolioItem[] = [
|
||||
title: {
|
||||
de: "Brand Redesign",
|
||||
en: "Brand Redesign",
|
||||
ar: "إعادة تصميم الهوية",
|
||||
},
|
||||
summary: {
|
||||
de: "Modernes Redesign fuer eine digitale Marke mit klarer Struktur.",
|
||||
en: "Modern redesign for a digital brand with a clear system.",
|
||||
ar: "إعادة تصميم حديثة لعلامة رقمية مع بنية واضحة.",
|
||||
},
|
||||
category: {
|
||||
de: "Branding",
|
||||
en: "Branding",
|
||||
ar: "الهوية",
|
||||
},
|
||||
year: "2025",
|
||||
},
|
||||
@@ -40,14 +43,17 @@ export const portfolioItems: PortfolioItem[] = [
|
||||
title: {
|
||||
de: "Commerce Relaunch",
|
||||
en: "Commerce Relaunch",
|
||||
ar: "إعادة إطلاق المتجر",
|
||||
},
|
||||
summary: {
|
||||
de: "Relaunch eines Shops mit Fokus auf Performance und Conversion.",
|
||||
en: "Store relaunch focused on performance and conversion.",
|
||||
ar: "إعادة إطلاق متجر مع تركيز على الأداء والتحويل.",
|
||||
},
|
||||
category: {
|
||||
de: "E-Commerce",
|
||||
en: "E-Commerce",
|
||||
ar: "التجارة الإلكترونية",
|
||||
},
|
||||
year: "2024",
|
||||
},
|
||||
@@ -56,14 +62,17 @@ export const portfolioItems: PortfolioItem[] = [
|
||||
title: {
|
||||
de: "SaaS Dashboard",
|
||||
en: "SaaS Dashboard",
|
||||
ar: "لوحة تحكم SaaS",
|
||||
},
|
||||
summary: {
|
||||
de: "Admin Dashboard fuer Teams mit klaren KPIs und Reports.",
|
||||
en: "Admin dashboard for teams with clear KPIs and reports.",
|
||||
ar: "لوحة تحكم إدارية للفرق مع مؤشرات وتقارير واضحة.",
|
||||
},
|
||||
category: {
|
||||
de: "Web App",
|
||||
en: "Web App",
|
||||
ar: "تطبيق ويب",
|
||||
},
|
||||
year: "2024",
|
||||
},
|
||||
@@ -72,14 +81,17 @@ export const portfolioItems: PortfolioItem[] = [
|
||||
title: {
|
||||
de: "Campaign Site",
|
||||
en: "Campaign Site",
|
||||
ar: "موقع حملة",
|
||||
},
|
||||
summary: {
|
||||
de: "Landing Seite fuer Produktkampagnen mit schneller Iteration.",
|
||||
en: "Landing experience for product campaigns and quick iteration.",
|
||||
ar: "صفحة هبوط لحملات المنتجات مع تنفيذ سريع.",
|
||||
},
|
||||
category: {
|
||||
de: "Marketing",
|
||||
en: "Marketing",
|
||||
ar: "التسويق",
|
||||
},
|
||||
year: "2023",
|
||||
},
|
||||
@@ -91,18 +103,22 @@ export const productItems: ProductItem[] = [
|
||||
name: {
|
||||
de: "Starter Kit",
|
||||
en: "Starter Kit",
|
||||
ar: "Starter Kit",
|
||||
},
|
||||
summary: {
|
||||
de: "Basis Paket fuer den schnellen Start von neuen Projekten.",
|
||||
en: "Base package for launching new projects quickly.",
|
||||
ar: "باقة أساسية لبدء المشاريع الجديدة بسرعة.",
|
||||
},
|
||||
segment: {
|
||||
de: "Small Teams",
|
||||
en: "Small Teams",
|
||||
ar: "الفرق الصغيرة",
|
||||
},
|
||||
price: {
|
||||
de: "ab 990 EUR",
|
||||
en: "from 990 EUR",
|
||||
ar: "ابتداءً من 990 EUR",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -110,18 +126,22 @@ export const productItems: ProductItem[] = [
|
||||
name: {
|
||||
de: "Growth Kit",
|
||||
en: "Growth Kit",
|
||||
ar: "Growth Kit",
|
||||
},
|
||||
summary: {
|
||||
de: "Skalierbares Paket fuer wachsende Produkte und Prozesse.",
|
||||
en: "Scalable package for growing products and processes.",
|
||||
ar: "باقة قابلة للتوسع للمنتجات والعمليات المتنامية.",
|
||||
},
|
||||
segment: {
|
||||
de: "Scaleups",
|
||||
en: "Scaleups",
|
||||
ar: "الشركات المتوسعة",
|
||||
},
|
||||
price: {
|
||||
de: "ab 2490 EUR",
|
||||
en: "from 2490 EUR",
|
||||
ar: "ابتداءً من 2490 EUR",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -129,26 +149,26 @@ export const productItems: ProductItem[] = [
|
||||
name: {
|
||||
de: "Enterprise Kit",
|
||||
en: "Enterprise Kit",
|
||||
ar: "Enterprise Kit",
|
||||
},
|
||||
summary: {
|
||||
de: "Massgeschneiderte Loesung fuer grosse Teams und komplexe Systeme.",
|
||||
en: "Tailored solution for large teams and complex systems.",
|
||||
ar: "حل مخصص للفرق الكبيرة والأنظمة المعقدة.",
|
||||
},
|
||||
segment: {
|
||||
de: "Enterprise",
|
||||
en: "Enterprise",
|
||||
ar: "المؤسسات",
|
||||
},
|
||||
price: {
|
||||
de: "auf Anfrage",
|
||||
en: "on request",
|
||||
ar: "عند الطلب",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export function resolveLocale(locale: string): AppLocale {
|
||||
return locale === "en" ? "en" : "de";
|
||||
}
|
||||
|
||||
export function pickText(text: LocalizedText, locale: AppLocale): string {
|
||||
return text[locale];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"navigation": {
|
||||
"home": "الرئيسية",
|
||||
"portfolio": "الأعمال",
|
||||
"products": "المنتجات",
|
||||
"about": "من أنا",
|
||||
"contact": "تواصل",
|
||||
"root": "Root",
|
||||
"openMenu": "فتح القائمة",
|
||||
"closeMenu": "إغلاق القائمة",
|
||||
"themeToggle": "تبديل المظهر"
|
||||
},
|
||||
"footer": {
|
||||
"copyright": "© {year} moh-sass. جميع الحقوق محفوظة."
|
||||
},
|
||||
"comingSoon": {
|
||||
"badge": "Coming Soon",
|
||||
"titleStart": "شيء",
|
||||
"titleAccent": "جديد",
|
||||
"titleEnd": "في الطريق.",
|
||||
"description": "الموقع حالياً في وضع الصيانة. عم أنهي المحتوى واللمسات الأخيرة قبل الإطلاق.",
|
||||
"note": "شكراً على صبرك. قريباً ستنطلق نسخة أوضح وأسرع وأقوى."
|
||||
},
|
||||
"homepage": {
|
||||
"heroKicker": "Digital Studio",
|
||||
"heroTitle": "مواقع ومنتجات تنطلق بسرعة.",
|
||||
"heroText": "هذه الصفحة الرئيسية تشكل قاعدة لانطلاقة تسويقية ومنتجية متعددة اللغات.",
|
||||
"portfolioTitle": "أعمال مميزة",
|
||||
"portfolioText": "منطقة تجريبية لعرض مشاريع مختارة.",
|
||||
"productsTitle": "منتجات مميزة",
|
||||
"productsText": "منطقة تجريبية لأهم العروض والمنتجات.",
|
||||
"ctaTitle": "جاهز للخطوة التالية؟",
|
||||
"ctaText": "فيك تراسلني لنحدد النطاق الأنسب لمشروعك.",
|
||||
"toPortfolio": "عرض الأعمال",
|
||||
"toProducts": "عرض المنتجات",
|
||||
"toContact": "تواصل معي",
|
||||
"heroCardTitle": "إطلاق سريع",
|
||||
"heroCardText": "هيكل ومحتوى ومكونات تساعد على نمو سريع وواضح."
|
||||
},
|
||||
"portfolioPage": {
|
||||
"title": "الأعمال",
|
||||
"intro": "مجموعة مشاريع مختارة مع تركيز على الوضوح والنتائج.",
|
||||
"open": "فتح المشروع"
|
||||
},
|
||||
"productsPage": {
|
||||
"title": "المنتجات",
|
||||
"intro": "باقات للفرق من البداية حتى التوسع.",
|
||||
"open": "فتح المنتج"
|
||||
},
|
||||
"aboutPage": {
|
||||
"title": "من أنا",
|
||||
"intro": "أبني تجارب رقمية واضحة للعلامات والمنتجات والفرق.",
|
||||
"valuesTitle": "كيف أعمل",
|
||||
"valueA": "الاستراتيجية أولاً",
|
||||
"valueAText": "كل مشروع يبدأ بهدف واضح ونطاق وأولويات محددة.",
|
||||
"valueB": "أنظمة نظيفة",
|
||||
"valueBText": "أعتمد على مكونات قابلة للصيانة وبنية واضحة.",
|
||||
"valueC": "تعاون قريب",
|
||||
"valueCText": "دورات قصيرة مع ملاحظات مباشرة طوال التنفيذ.",
|
||||
"processTitle": "آلية العمل",
|
||||
"processOne": "اكتشاف وتحديد الهدف",
|
||||
"processTwo": "تصميم ونمذجة أولية",
|
||||
"processThree": "بناء واختبار وإطلاق"
|
||||
},
|
||||
"contactPage": {
|
||||
"title": "تواصل",
|
||||
"intro": "ابعث لي هدفك باختصار وسأعود إليك بسرعة.",
|
||||
"name": "الاسم",
|
||||
"email": "البريد الإلكتروني",
|
||||
"message": "الرسالة",
|
||||
"submit": "إرسال",
|
||||
"preview": "فتح صفحة النجاح",
|
||||
"city": "برلين، ألمانيا"
|
||||
},
|
||||
"successPage": {
|
||||
"title": "شكراً على رسالتك",
|
||||
"text": "وصلني طلبك وسأرد عليك قريباً.",
|
||||
"home": "العودة للرئيسية",
|
||||
"contact": "العودة إلى التواصل"
|
||||
},
|
||||
"portfolioDetail": {
|
||||
"back": "العودة إلى الأعمال",
|
||||
"challenge": "التحدي",
|
||||
"solution": "الحل",
|
||||
"outcome": "النتيجة",
|
||||
"challengeText": "كان المشروع بحاجة إلى هيكل معلومات أوضح وأداء أسرع.",
|
||||
"solutionText": "تم بناء التصميم والمكونات والمحتوى ضمن نظام مرن ومترابط.",
|
||||
"outcomeText": "أصبح نشر المحتوى أسرع ووصول المستخدمين إلى أهدافهم أوضح."
|
||||
},
|
||||
"productDetail": {
|
||||
"back": "العودة إلى المنتجات",
|
||||
"included": "يشمل",
|
||||
"stepOne": "جلسة انطلاق وتوضيح النطاق",
|
||||
"stepTwo": "إعداد التصميم والمكونات",
|
||||
"stepThree": "تنفيذ وتسليم",
|
||||
"action": "تواصل لطلب عرض"
|
||||
}
|
||||
}
|
||||
+82
-6
@@ -3,20 +3,96 @@
|
||||
"home": "Start",
|
||||
"portfolio": "Portfolio",
|
||||
"products": "Produkte",
|
||||
"about": "Ueber uns",
|
||||
"about": "Ueber mich",
|
||||
"contact": "Kontakt",
|
||||
"root": "Root",
|
||||
"openMenu": "Menue oeffnen",
|
||||
"closeMenu": "Menue schliessen",
|
||||
"languagePlaceholder": "DE | EN"
|
||||
"themeToggle": "Theme wechseln"
|
||||
},
|
||||
"footer": {
|
||||
"copyright": "© {year} moh-sass. Alle Rechte vorbehalten."
|
||||
},
|
||||
"comingSoon": {
|
||||
"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."
|
||||
},
|
||||
"homepage": {
|
||||
"kicker": "Willkommen",
|
||||
"title": "Mehrsprachiger Next.js Start",
|
||||
"description": "Diese Startseite nutzt next-intl und ist fuer weitere Sprachen vorbereitet.",
|
||||
"sectionPlaceholder": "Diese Seite ist bereit fuer deinen Inhalt."
|
||||
"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."
|
||||
},
|
||||
"portfolioPage": {
|
||||
"title": "Portfolio",
|
||||
"intro": "Eine Auswahl von Projekten mit Fokus auf Klarheit und Ergebnis.",
|
||||
"open": "Projekt oeffnen"
|
||||
},
|
||||
"productsPage": {
|
||||
"title": "Produkte",
|
||||
"intro": "Pakete fuer Teams von Start bis Skalierung.",
|
||||
"open": "Produkt oeffnen"
|
||||
},
|
||||
"aboutPage": {
|
||||
"title": "Ueber mich",
|
||||
"intro": "Ich baue klare digitale Erlebnisse fuer Marken, Produkte und Teams.",
|
||||
"valuesTitle": "Wie ich arbeite",
|
||||
"valueA": "Strategie zuerst",
|
||||
"valueAText": "Jedes Projekt startet mit Zielbild, Scope und Prioritaeten.",
|
||||
"valueB": "Saubere Systeme",
|
||||
"valueBText": "Ich setze auf wartbare Komponenten und klare Strukturen.",
|
||||
"valueC": "Enge Zusammenarbeit",
|
||||
"valueCText": "Kurze Schleifen mit direktem Feedback im gesamten Ablauf.",
|
||||
"processTitle": "Mein Ablauf",
|
||||
"processOne": "Discovery und Zieldefinition",
|
||||
"processTwo": "Design und Prototyping",
|
||||
"processThree": "Build, Test und Launch"
|
||||
},
|
||||
"contactPage": {
|
||||
"title": "Kontakt",
|
||||
"intro": "Schreib mir kurz dein Ziel und ich melde mich zeitnah.",
|
||||
"name": "Name",
|
||||
"email": "E-Mail",
|
||||
"message": "Nachricht",
|
||||
"submit": "Senden",
|
||||
"preview": "Success Seite ansehen",
|
||||
"city": "Berlin, Deutschland"
|
||||
},
|
||||
"successPage": {
|
||||
"title": "Danke fuer deine Nachricht",
|
||||
"text": "Ich habe deine Anfrage erhalten und melde mich zeitnah.",
|
||||
"home": "Zur Startseite",
|
||||
"contact": "Zur Kontaktseite"
|
||||
},
|
||||
"portfolioDetail": {
|
||||
"back": "Zurueck zum Portfolio",
|
||||
"challenge": "Herausforderung",
|
||||
"solution": "Loesung",
|
||||
"outcome": "Ergebnis",
|
||||
"challengeText": "Das Projekt brauchte eine klare Informationsarchitektur und schnellere Ladezeiten.",
|
||||
"solutionText": "Ich habe Design, Komponenten und Content in einem modularen System aufgebaut.",
|
||||
"outcomeText": "Inhalte koennen schneller ausgerollt werden und Nutzer finden schneller zum Ziel."
|
||||
},
|
||||
"productDetail": {
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
||||
+81
-5
@@ -8,15 +8,91 @@
|
||||
"root": "Root",
|
||||
"openMenu": "Open menu",
|
||||
"closeMenu": "Close menu",
|
||||
"languagePlaceholder": "DE | EN"
|
||||
"themeToggle": "Toggle theme"
|
||||
},
|
||||
"footer": {
|
||||
"copyright": "© {year} moh-sass. All rights reserved."
|
||||
},
|
||||
"comingSoon": {
|
||||
"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."
|
||||
},
|
||||
"homepage": {
|
||||
"kicker": "Welcome",
|
||||
"title": "Modern multilingual starter",
|
||||
"description": "This homepage is wired with next-intl and ready for additional locales.",
|
||||
"sectionPlaceholder": "This page is ready for your content."
|
||||
"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 me",
|
||||
"heroCardTitle": "Fast rollout",
|
||||
"heroCardText": "Structure, content, and components for rapid growth."
|
||||
},
|
||||
"portfolioPage": {
|
||||
"title": "Portfolio",
|
||||
"intro": "Selected projects with a focus on clarity and outcomes.",
|
||||
"open": "Open project"
|
||||
},
|
||||
"productsPage": {
|
||||
"title": "Products",
|
||||
"intro": "Packages for teams from early stage to scale.",
|
||||
"open": "Open product"
|
||||
},
|
||||
"aboutPage": {
|
||||
"title": "About",
|
||||
"intro": "I build clear digital experiences for brands, products, and teams.",
|
||||
"valuesTitle": "How I work",
|
||||
"valueA": "Strategy first",
|
||||
"valueAText": "Each project starts with goals, scope, and priorities.",
|
||||
"valueB": "Clean systems",
|
||||
"valueBText": "I rely on maintainable components and clear structure.",
|
||||
"valueC": "Close collaboration",
|
||||
"valueCText": "Short loops with direct feedback across the full process.",
|
||||
"processTitle": "My process",
|
||||
"processOne": "Discovery and goal definition",
|
||||
"processTwo": "Design and prototyping",
|
||||
"processThree": "Build, test, and launch"
|
||||
},
|
||||
"contactPage": {
|
||||
"title": "Contact",
|
||||
"intro": "Share your goal and I will get back quickly.",
|
||||
"name": "Name",
|
||||
"email": "Email",
|
||||
"message": "Message",
|
||||
"submit": "Submit",
|
||||
"preview": "Open success page",
|
||||
"city": "Berlin, Germany"
|
||||
},
|
||||
"successPage": {
|
||||
"title": "Thank you for your message",
|
||||
"text": "I received your request and will reply shortly.",
|
||||
"home": "Go to homepage",
|
||||
"contact": "Back to contact"
|
||||
},
|
||||
"portfolioDetail": {
|
||||
"back": "Back to portfolio",
|
||||
"challenge": "Challenge",
|
||||
"solution": "Solution",
|
||||
"outcome": "Outcome",
|
||||
"challengeText": "The project needed clearer information architecture and faster performance.",
|
||||
"solutionText": "I built design, components, and content in a modular system.",
|
||||
"outcomeText": "Content ships faster and users reach goals more quickly."
|
||||
},
|
||||
"productDetail": {
|
||||
"back": "Back to products",
|
||||
"included": "Included",
|
||||
"stepOne": "Kickoff and scope clarity",
|
||||
"stepTwo": "Design and component setup",
|
||||
"stepThree": "Implementation and handover",
|
||||
"action": "Contact for proposal"
|
||||
}
|
||||
}
|
||||
|
||||
+9
-1
@@ -3,6 +3,7 @@ import { NextResponse } from "next/server";
|
||||
import type { NextRequest } from "next/server";
|
||||
|
||||
import { routing } from "./i18n/routing";
|
||||
import { getLocalizedPath } from "./lib/locale";
|
||||
|
||||
const intlMiddleware = createMiddleware(routing);
|
||||
const ADMIN_SESSION_COOKIE = "moh_admin_session";
|
||||
@@ -139,6 +140,13 @@ export default async function middleware(request: NextRequest) {
|
||||
const isRootBaseRoute = pathname === "/root" || pathname.startsWith("/root/");
|
||||
const isRootRoute = isRootBaseRoute;
|
||||
|
||||
if (pathname === "/de" || pathname.startsWith("/de/")) {
|
||||
const redirectUrl = request.nextUrl.clone();
|
||||
const nextPath = pathname.slice(3) || "/";
|
||||
redirectUrl.pathname = nextPath;
|
||||
return NextResponse.redirect(redirectUrl, 308);
|
||||
}
|
||||
|
||||
if (isRootRoute && isRootBasicAuthConfigured() && !isRootBasicAuthValid(request)) {
|
||||
return new NextResponse("Authentication required", {
|
||||
status: 401,
|
||||
@@ -164,7 +172,7 @@ export default async function middleware(request: NextRequest) {
|
||||
if (!isAdminAuthenticated) {
|
||||
const targetLocale = locale ?? routing.defaultLocale;
|
||||
const redirectUrl = request.nextUrl.clone();
|
||||
redirectUrl.pathname = `/${targetLocale}/coming-soon`;
|
||||
redirectUrl.pathname = getLocalizedPath(targetLocale, "/coming-soon");
|
||||
redirectUrl.search = "";
|
||||
return NextResponse.redirect(redirectUrl);
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
type AppShellProps = {
|
||||
sidebar: ReactNode;
|
||||
header: ReactNode;
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
export function AppShell({ sidebar, header, children, className }: AppShellProps) {
|
||||
return (
|
||||
<div className="min-h-screen bg-background">
|
||||
<div className="mx-auto flex w-full max-w-[1400px] gap-6 px-4 py-6 sm:px-6 lg:px-8">
|
||||
<aside className="hidden w-72 shrink-0 md:block">{sidebar}</aside>
|
||||
<div className={cn("flex min-w-0 flex-1 flex-col gap-6", className)}>
|
||||
{header}
|
||||
<main>{children}</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
|
||||
({ className, type, ...props }, ref) => {
|
||||
return (
|
||||
<input
|
||||
type={type}
|
||||
className={cn(
|
||||
"flex h-10 w-full rounded-[var(--radius-input)] border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
||||
className,
|
||||
)}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
},
|
||||
);
|
||||
Input.displayName = "Input";
|
||||
|
||||
export { Input };
|
||||
@@ -1,9 +0,0 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
function Label({ className, ...props }: React.LabelHTMLAttributes<HTMLLabelElement>) {
|
||||
return <label className={cn("text-sm font-medium text-foreground/90", className)} {...props} />;
|
||||
}
|
||||
|
||||
export { Label };
|
||||
@@ -1,21 +0,0 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const Textarea = React.forwardRef<HTMLTextAreaElement, React.ComponentProps<"textarea">>(
|
||||
({ className, ...props }, ref) => {
|
||||
return (
|
||||
<textarea
|
||||
className={cn(
|
||||
"flex min-h-[88px] w-full rounded-[var(--radius-input)] border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
||||
className,
|
||||
)}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
},
|
||||
);
|
||||
Textarea.displayName = "Textarea";
|
||||
|
||||
export { Textarea };
|
||||
+46
-5
@@ -13,10 +13,18 @@ const config: Config = {
|
||||
extend: {
|
||||
colors: {
|
||||
border: "hsl(var(--border))",
|
||||
"border-strong": "hsl(var(--border-strong))",
|
||||
input: "hsl(var(--input))",
|
||||
ring: "hsl(var(--ring))",
|
||||
background: "hsl(var(--background))",
|
||||
foreground: "hsl(var(--foreground))",
|
||||
surface: {
|
||||
1: "hsl(var(--surface-1))",
|
||||
2: "hsl(var(--surface-2))",
|
||||
3: "hsl(var(--surface-3))",
|
||||
inverse: "hsl(var(--surface-inverse))",
|
||||
"inverse-foreground": "hsl(var(--surface-inverse-foreground))",
|
||||
},
|
||||
primary: {
|
||||
DEFAULT: "hsl(var(--primary))",
|
||||
foreground: "hsl(var(--primary-foreground))",
|
||||
@@ -45,6 +53,16 @@ const config: Config = {
|
||||
DEFAULT: "hsl(var(--popover))",
|
||||
foreground: "hsl(var(--popover-foreground))",
|
||||
},
|
||||
brand: {
|
||||
primary: "hsl(var(--brand-primary))",
|
||||
secondary: "hsl(var(--brand-secondary))",
|
||||
},
|
||||
status: {
|
||||
success: "hsl(var(--status-success))",
|
||||
"success-soft": "hsl(var(--status-success-soft))",
|
||||
warning: "hsl(var(--status-warning))",
|
||||
"warning-soft": "hsl(var(--status-warning-soft))",
|
||||
},
|
||||
sidebar: {
|
||||
DEFAULT: "hsl(var(--sidebar-background))",
|
||||
foreground: "hsl(var(--sidebar-foreground))",
|
||||
@@ -57,11 +75,13 @@ const config: Config = {
|
||||
},
|
||||
},
|
||||
borderRadius: {
|
||||
lg: "var(--radius)",
|
||||
md: "var(--radius-input)",
|
||||
sm: "calc(var(--radius-input) - 2px)",
|
||||
card: "var(--radius-card)",
|
||||
sidebar: "var(--radius-sidebar)",
|
||||
sm: "var(--radius-nested)",
|
||||
md: "var(--radius-nested)",
|
||||
lg: "var(--radius-surface)",
|
||||
xl: "var(--radius-surface)",
|
||||
surface: "var(--radius-surface)",
|
||||
nested: "var(--radius-nested)",
|
||||
pill: "var(--radius-pill)",
|
||||
},
|
||||
boxShadow: {
|
||||
xs: "var(--shadow-xs)",
|
||||
@@ -69,10 +89,31 @@ const config: Config = {
|
||||
md: "var(--shadow-md)",
|
||||
lg: "var(--shadow-lg)",
|
||||
card: "var(--shadow-card)",
|
||||
panel: "var(--shadow-panel)",
|
||||
sidebar: "var(--shadow-sidebar)",
|
||||
},
|
||||
maxWidth: {
|
||||
narrow: "var(--container-narrow)",
|
||||
layout: "var(--container-default)",
|
||||
wide: "var(--container-wide)",
|
||||
admin: "var(--container-admin)",
|
||||
},
|
||||
height: {
|
||||
header: "var(--header-height)",
|
||||
},
|
||||
minHeight: {
|
||||
header: "var(--header-height)",
|
||||
},
|
||||
spacing: {
|
||||
section: "var(--section-space)",
|
||||
content: "var(--content-space)",
|
||||
},
|
||||
backdropBlur: {
|
||||
chrome: "18px",
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [animate],
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
Reference in New Issue
Block a user