Fix docker

This commit is contained in:
diyaa 2026-03-13 04:01:58 +01:00
parent c9e9ae6b90
commit 2b5e91377c
3 changed files with 8 additions and 5 deletions

View File

@ -20,5 +20,5 @@ export default function HomePage({ params }: { params: { locale: string } }) {
const locale = params.locale as Locale;
const dictionary = getDictionary(locale);
return <HeroSection locale={locale} home={dictionary.home} common={dictionary.common} />;
return <HeroSection locale={locale} home={dictionary.home} />;
}

View File

@ -1,15 +1,14 @@
import Link from "next/link";
import type { CommonContent, HomeContent, HomeVariantContent } from "@/content/types";
import type { HomeContent, HomeVariantContent } from "@/content/types";
import type { Locale } from "@/lib/i18n";
import { getEmailHref, getModeValue, isComingSoonMode } from "@/lib/site";
type HeroSectionProps = {
locale: Locale;
home: HomeContent;
common: CommonContent;
};
export default function HeroSection({ locale, home, common }: HeroSectionProps) {
export default function HeroSection({ locale, home }: HeroSectionProps) {
const activeHome: HomeVariantContent = getModeValue(home);
const emailHref = getEmailHref();

View File

@ -60,8 +60,12 @@ export function isComingSoonMode(): boolean {
return getSiteMode() === "coming-soon";
}
function getModeVariantKey(mode: SiteMode): keyof ModeVariants<unknown> {
return mode === "coming-soon" ? "comingSoon" : "full";
}
export function getModeValue<T>(variants: ModeVariants<T>): T {
return variants[getSiteMode()];
return variants[getModeVariantKey(getSiteMode())];
}
export function getLocalizedPath(pathname: string, locale: "ar" | "en"): string {