Files
sass-mohfarawati/app/[locale]/coming-soon/page.tsx
T
Moh b2b90bd1bf
CI / quality (push) Waiting to run
STYLED - Trim coming-soon to title + countdown
- Remove the status badge, kicker, and description texts
- Keep only the title and the countdown (all locales)
2026-08-08 03:48:19 +02:00

94 lines
3.2 KiB
TypeScript

import type { Metadata } from "next";
import { unstable_noStore as noStore } from "next/cache";
import { getLocale, getTranslations } from "next-intl/server";
import { FloatingPreferences } from "@/components/layout/floating-preferences";
import { HeroContentMotion, HeroMotionItem, HeroShell, HeroTitle } from "@/components/layout/site-hero";
import { LaunchCountdown } from "@/components/site/launch-countdown";
import { getSiteSettings } from "@/lib/app-config";
import { buildLocalizedMetadata } from "@/lib/metadata";
import { resolveLocale } from "@/lib/locale";
// Target launch date for the countdown. Edit this single line to change it.
const LAUNCH_DATE_ISO = "2026-08-28T12:00:00Z";
type ComingSoonPageProps = {
params: Promise<{
locale: string;
}>;
};
export const dynamic = "force-dynamic";
export const revalidate = 0;
export async function generateMetadata({ params }: ComingSoonPageProps): Promise<Metadata> {
noStore();
await params;
const siteSettings = await getSiteSettings();
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
const t = await getTranslations({ locale: localeKey, namespace: "comingSoon" });
return await buildLocalizedMetadata({
locale: localeKey,
pathname: "/coming-soon",
title: siteSettings.locales[localeKey].siteName,
description: t("description"),
applyTitleTemplate: false,
});
}
export default async function ComingSoonPage({ params }: ComingSoonPageProps) {
noStore();
await params;
const siteSettings = await getSiteSettings();
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
const t = await getTranslations({ locale: localeKey, namespace: "comingSoon" });
const isArabic = localeKey === "ar";
const lines = [
{
text: t("titleLineOne"),
tone: "soft" as const,
align: isArabic ? ("center" as const) : ("start" as const),
},
{
text: t("titleLineTwo"),
tone: "default" as const,
align: isArabic ? ("center" as const) : ("end" as const),
},
{
text: t("titleLineThree"),
tone: "accent" as const,
align: isArabic ? ("center" as const) : ("start" as const),
},
];
return (
<div className="relative h-screen overflow-hidden">
<FloatingPreferences locale={localeKey} defaultLocale={siteSettings.defaultLocale} />
<HeroShell className="h-screen" showBridges>
<HeroContentMotion className="relative z-10 w-full">
<div className="mx-auto flex w-full max-w-[60rem] flex-col items-center text-center">
<HeroTitle locale={localeKey} lines={lines} className="mx-auto tracking-normal" />
<HeroMotionItem className="mt-12">
<LaunchCountdown
targetIso={LAUNCH_DATE_ISO}
arabic={isArabic}
launchedLabel={t("launched")}
labels={{
days: t("unitDays"),
hours: t("unitHours"),
minutes: t("unitMinutes"),
seconds: t("unitSeconds"),
}}
/>
</HeroMotionItem>
</div>
</HeroContentMotion>
</HeroShell>
</div>
);
}