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