This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import type { Metadata } from "next";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { getLocale, getTranslations } from "next-intl/server";
|
||||
|
||||
import { Container } from "@/components/layout/container";
|
||||
import { PageHero } from "@/components/layout/page-hero";
|
||||
import { AppCard } from "@/components/ui/app-card";
|
||||
import { FALLBACK_LOCALE, resolveLocale } from "@/lib/locale";
|
||||
import { getSiteSettings } from "@/lib/app-config";
|
||||
import { resolveLocale } from "@/lib/locale";
|
||||
import { buildLocalizedMetadata } from "@/lib/metadata";
|
||||
|
||||
type AboutPageProps = {
|
||||
@@ -16,8 +17,9 @@ type AboutPageProps = {
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function generateMetadata({ params }: AboutPageProps): Promise<Metadata> {
|
||||
const { locale } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
await params;
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "aboutPage" });
|
||||
|
||||
return await buildLocalizedMetadata({
|
||||
@@ -29,8 +31,9 @@ export async function generateMetadata({ params }: AboutPageProps): Promise<Meta
|
||||
}
|
||||
|
||||
export default async function AboutPage({ params }: AboutPageProps) {
|
||||
const { locale } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
await params;
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "aboutPage" });
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Mail, MapPin, Phone } from "lucide-react";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { getLocale, getTranslations } from "next-intl/server";
|
||||
|
||||
import { Container } from "@/components/layout/container";
|
||||
import { PageHero } from "@/components/layout/page-hero";
|
||||
@@ -8,7 +8,7 @@ import { MotionFade } from "@/components/motion-fade";
|
||||
import { ContactForm } from "@/components/site/contact-form";
|
||||
import { buildLocalizedMetadata } from "@/lib/metadata";
|
||||
import { getPublicContactProtectionSettings, getSiteSettings } from "@/lib/app-config";
|
||||
import { FALLBACK_LOCALE, getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
import { AppCard } from "@/components/ui/app-card";
|
||||
import { CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
|
||||
@@ -21,8 +21,9 @@ type ContactPageProps = {
|
||||
};
|
||||
|
||||
export async function generateMetadata({ params }: ContactPageProps): Promise<Metadata> {
|
||||
const { locale } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
await params;
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "contactPage" });
|
||||
|
||||
return await buildLocalizedMetadata({
|
||||
@@ -34,12 +35,12 @@ export async function generateMetadata({ params }: ContactPageProps): Promise<Me
|
||||
}
|
||||
|
||||
export default async function ContactPage({ params }: ContactPageProps) {
|
||||
const { locale } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
const [t, protection, siteSettings] = await Promise.all([
|
||||
await params;
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
const [t, protection] = await Promise.all([
|
||||
getTranslations({ locale: localeKey, namespace: "contactPage" }),
|
||||
getPublicContactProtectionSettings(),
|
||||
getSiteSettings(),
|
||||
]);
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { unstable_noStore as noStore } from "next/cache";
|
||||
import { getLocale } from "next-intl/server";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { SiteAmbientBackdrop } from "@/components/layout/site-ambient-backdrop";
|
||||
@@ -7,7 +8,7 @@ import { SiteFooter } from "@/components/layout/site-footer";
|
||||
import { SiteHeader } from "@/components/layout/site-header";
|
||||
import { isAdminAuthenticated } from "@/lib/admin-auth";
|
||||
import { getMaintenanceMode, getSiteSettings, getSiteSettingsMediaBindings } from "@/lib/app-config";
|
||||
import { FALLBACK_LOCALE, getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
|
||||
type SiteLayoutProps = {
|
||||
children: ReactNode;
|
||||
@@ -21,14 +22,13 @@ export const revalidate = 0;
|
||||
|
||||
export default async function SiteLayout({ children, params }: SiteLayoutProps) {
|
||||
noStore();
|
||||
const { locale } = await params;
|
||||
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
await params;
|
||||
const [maintenanceEnabled, mediaBindings, siteSettings] = await Promise.all([
|
||||
getMaintenanceMode(),
|
||||
getSiteSettingsMediaBindings(),
|
||||
getSiteSettings(),
|
||||
]);
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
const authenticated = await isAdminAuthenticated();
|
||||
|
||||
if (maintenanceEnabled && !authenticated) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
Search,
|
||||
} from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { getLocale, getTranslations } from "next-intl/server";
|
||||
|
||||
import { Container } from "@/components/layout/container";
|
||||
import { HomeHero } from "@/components/layout/home-hero";
|
||||
@@ -21,7 +21,7 @@ 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 { FALLBACK_LOCALE, getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
|
||||
type HomePageProps = {
|
||||
params: Promise<{
|
||||
@@ -42,12 +42,10 @@ const serviceIcons = [
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function generateMetadata({ params }: HomePageProps): Promise<Metadata> {
|
||||
const { locale } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
const [t, siteSettings] = await Promise.all([
|
||||
getTranslations({ locale: localeKey, namespace: "homepage" }),
|
||||
getSiteSettings(),
|
||||
]);
|
||||
await params;
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "homepage" });
|
||||
|
||||
return await buildLocalizedMetadata({
|
||||
locale: localeKey,
|
||||
@@ -59,12 +57,12 @@ export async function generateMetadata({ params }: HomePageProps): Promise<Metad
|
||||
}
|
||||
|
||||
export default async function HomePage({ params }: HomePageProps) {
|
||||
const { locale } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
const [t, marqueeSettings, siteSettings] = await Promise.all([
|
||||
await params;
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
const [t, marqueeSettings] = await Promise.all([
|
||||
getTranslations({ locale: localeKey, namespace: "homepage" }),
|
||||
getMarqueeSettings(),
|
||||
getSiteSettings(),
|
||||
]);
|
||||
const serviceItems = [
|
||||
t("serviceBrand"),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Metadata } from "next";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { getLocale, getTranslations } from "next-intl/server";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
import { Container } from "@/components/layout/container";
|
||||
@@ -7,7 +7,7 @@ import { PageHero } from "@/components/layout/page-hero";
|
||||
import { PortfolioProjectDetail } from "@/components/site/portfolio-project-detail";
|
||||
import { getSiteSettings } from "@/lib/app-config";
|
||||
import { buildLocalizedMetadata } from "@/lib/metadata";
|
||||
import { FALLBACK_LOCALE, resolveLocale } from "@/lib/locale";
|
||||
import { resolveLocale } from "@/lib/locale";
|
||||
import {
|
||||
getLocalizedValue,
|
||||
getPublishedPortfolioProjectBySlug,
|
||||
@@ -23,8 +23,9 @@ type PortfolioItemPageProps = {
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function generateMetadata({ params }: PortfolioItemPageProps): Promise<Metadata> {
|
||||
const { locale, slug } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
const { slug } = await params;
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
const item = await getPublishedPortfolioProjectBySlug(slug);
|
||||
|
||||
if (!item) {
|
||||
@@ -47,18 +48,16 @@ export async function generateMetadata({ params }: PortfolioItemPageProps): Prom
|
||||
export default async function PortfolioItemPage({
|
||||
params,
|
||||
}: PortfolioItemPageProps) {
|
||||
const { locale, slug } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
const { slug } = await params;
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
const item = await getPublishedPortfolioProjectBySlug(slug);
|
||||
|
||||
if (!item) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
const [t, siteSettings] = await Promise.all([
|
||||
getTranslations({ locale: localeKey, namespace: "portfolioDetail" }),
|
||||
getSiteSettings(),
|
||||
]);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "portfolioDetail" });
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Metadata } from "next";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { getLocale, getTranslations } from "next-intl/server";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
import { Container } from "@/components/layout/container";
|
||||
@@ -8,7 +8,7 @@ import { PortfolioCategoryFilter } from "@/components/site/portfolio-category-fi
|
||||
import { PortfolioProjectGrid } from "@/components/site/portfolio-project-grid";
|
||||
import { getSiteSettings } from "@/lib/app-config";
|
||||
import { buildLocalizedMetadata } from "@/lib/metadata";
|
||||
import { FALLBACK_LOCALE, resolveLocale } from "@/lib/locale";
|
||||
import { resolveLocale } from "@/lib/locale";
|
||||
import {
|
||||
getActivePortfolioCategories,
|
||||
getActivePortfolioCategoryBySlug,
|
||||
@@ -26,8 +26,9 @@ type PortfolioCategoryPageProps = {
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function generateMetadata({ params }: PortfolioCategoryPageProps): Promise<Metadata> {
|
||||
const { locale, slug } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
const { slug } = await params;
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "portfolioPage" });
|
||||
const category = await getActivePortfolioCategoryBySlug(slug);
|
||||
|
||||
@@ -51,15 +52,15 @@ export async function generateMetadata({ params }: PortfolioCategoryPageProps):
|
||||
export default async function PortfolioCategoryPage({
|
||||
params,
|
||||
}: PortfolioCategoryPageProps) {
|
||||
const { locale, slug } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
const [t, siteSettings, categories, category, projects] = await Promise.all([
|
||||
getTranslations({ locale: localeKey, namespace: "portfolioPage" }),
|
||||
const { slug } = await params;
|
||||
const [siteSettings, categories, category, projects] = await Promise.all([
|
||||
getSiteSettings(),
|
||||
getActivePortfolioCategories(),
|
||||
getActivePortfolioCategoryBySlug(slug),
|
||||
getPublishedPortfolioProjects({ categorySlug: slug }),
|
||||
]);
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "portfolioPage" });
|
||||
|
||||
if (!category) {
|
||||
notFound();
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { getLocale } from "next-intl/server";
|
||||
import { permanentRedirect } from "next/navigation";
|
||||
|
||||
import { getSiteSettings } from "@/lib/app-config";
|
||||
import { FALLBACK_LOCALE, getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
|
||||
type PortfolioCategoryIndexPageProps = {
|
||||
params: Promise<{
|
||||
@@ -12,9 +13,9 @@ type PortfolioCategoryIndexPageProps = {
|
||||
export default async function PortfolioCategoryIndexPage({
|
||||
params,
|
||||
}: PortfolioCategoryIndexPageProps) {
|
||||
const { locale } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
await params;
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
|
||||
permanentRedirect(getLocalizedPath(localeKey, "/portfolio", siteSettings.defaultLocale));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Metadata } from "next";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { getLocale, getTranslations } from "next-intl/server";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { Container } from "@/components/layout/container";
|
||||
@@ -8,7 +8,7 @@ import { PortfolioCategoryFilter } from "@/components/site/portfolio-category-fi
|
||||
import { PortfolioProjectGrid } from "@/components/site/portfolio-project-grid";
|
||||
import { getSiteSettings } from "@/lib/app-config";
|
||||
import { buildLocalizedMetadata } from "@/lib/metadata";
|
||||
import { FALLBACK_LOCALE, getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
import { getActivePortfolioCategories, getPublishedPortfolioProjects } from "@/lib/portfolio";
|
||||
|
||||
type PortfolioPageProps = {
|
||||
@@ -23,8 +23,9 @@ type PortfolioPageProps = {
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function generateMetadata({ params }: PortfolioPageProps): Promise<Metadata> {
|
||||
const { locale } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
await params;
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "portfolioPage" });
|
||||
|
||||
return await buildLocalizedMetadata({
|
||||
@@ -43,11 +44,9 @@ export default async function PortfolioPage({
|
||||
params,
|
||||
searchParams,
|
||||
]);
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
const [t, siteSettings] = await Promise.all([
|
||||
getTranslations({ locale: localeKey, namespace: "portfolioPage" }),
|
||||
getSiteSettings(),
|
||||
]);
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => locale), siteSettings.defaultLocale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "portfolioPage" });
|
||||
const selectedCategory = resolvedSearchParams?.category ?? "";
|
||||
|
||||
if (selectedCategory) {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import type { Metadata } from "next";
|
||||
import { CheckCircle2 } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { getLocale, getTranslations } from "next-intl/server";
|
||||
|
||||
import { Container } from "@/components/layout/container";
|
||||
import { MotionFade } from "@/components/motion-fade";
|
||||
import { HeroShell, HeroTitle } from "@/components/layout/site-hero";
|
||||
import { getSiteSettings } from "@/lib/app-config";
|
||||
import { buildLocalizedMetadata } from "@/lib/metadata";
|
||||
import { FALLBACK_LOCALE, getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
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";
|
||||
@@ -20,8 +20,9 @@ type SuccessPageProps = {
|
||||
};
|
||||
|
||||
export async function generateMetadata({ params }: SuccessPageProps): Promise<Metadata> {
|
||||
const { locale } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
await params;
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "successPage" });
|
||||
|
||||
return await buildLocalizedMetadata({
|
||||
@@ -33,12 +34,10 @@ export async function generateMetadata({ params }: SuccessPageProps): Promise<Me
|
||||
}
|
||||
|
||||
export default async function SuccessPage({ params }: SuccessPageProps) {
|
||||
const { locale } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
const [t, siteSettings] = await Promise.all([
|
||||
getTranslations({ locale: localeKey, namespace: "successPage" }),
|
||||
getSiteSettings(),
|
||||
]);
|
||||
await params;
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "successPage" });
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import type { Metadata } from "next";
|
||||
import { unstable_noStore as noStore } from "next/cache";
|
||||
import { Sparkles } from "lucide-react";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { getLocale, getTranslations } from "next-intl/server";
|
||||
|
||||
import { FloatingPreferences } from "@/components/layout/floating-preferences";
|
||||
import { MotionFade } from "@/components/motion-fade";
|
||||
import { HeroShell, HeroTitle } from "@/components/layout/site-hero";
|
||||
import { getSiteSettings } from "@/lib/app-config";
|
||||
import { buildLocalizedMetadata } from "@/lib/metadata";
|
||||
import { FALLBACK_LOCALE, resolveLocale } from "@/lib/locale";
|
||||
import { resolveLocale } from "@/lib/locale";
|
||||
|
||||
type ComingSoonPageProps = {
|
||||
params: Promise<{
|
||||
@@ -21,10 +21,10 @@ export const revalidate = 0;
|
||||
|
||||
export async function generateMetadata({ params }: ComingSoonPageProps): Promise<Metadata> {
|
||||
noStore();
|
||||
const { locale } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "comingSoon" });
|
||||
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,
|
||||
@@ -39,12 +39,10 @@ export default async function ComingSoonPage({
|
||||
params,
|
||||
}: ComingSoonPageProps) {
|
||||
noStore();
|
||||
const { locale } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
const [t, siteSettings] = await Promise.all([
|
||||
getTranslations({ locale: localeKey, namespace: "comingSoon" }),
|
||||
getSiteSettings(),
|
||||
]);
|
||||
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 = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user