debug for build
This commit is contained in:
@@ -4,16 +4,21 @@ import Breadcrumb from '@/components/layout/breadcrumb';
|
|||||||
import { IBreadcrumbItem } from '@/components/layout/breadcrumb/breadcrumb';
|
import { IBreadcrumbItem } from '@/components/layout/breadcrumb/breadcrumb';
|
||||||
import ContentGenerator from '@/components/layout/contentGenerator';
|
import ContentGenerator from '@/components/layout/contentGenerator';
|
||||||
import InnerPageBanner from '@/components/layout/innerPages/banner';
|
import InnerPageBanner from '@/components/layout/innerPages/banner';
|
||||||
import { ILayoutLocaleParams } from '@/models/layout';
|
import { IPageParams } from '@/models/layout';
|
||||||
import { getPost } from '@/services/blog';
|
import { getPost } from '@/services/blog';
|
||||||
import { getTranslations } from 'next-intl/server';
|
import { getTranslations } from 'next-intl/server';
|
||||||
|
|
||||||
interface IPageParams extends ILayoutLocaleParams {
|
interface IParams {
|
||||||
id: string;
|
id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function generateMetadata({ params }: { params: IPageParams }) {
|
export async function generateMetadata({
|
||||||
const { id: postId, locale } = await params;
|
params,
|
||||||
|
}: {
|
||||||
|
params: IPageParams<IParams>;
|
||||||
|
}) {
|
||||||
|
const paramsData = await params;
|
||||||
|
const { id: postId, locale } = paramsData;
|
||||||
const t = await getTranslations({ locale });
|
const t = await getTranslations({ locale });
|
||||||
const postData = await getPost(postId);
|
const postData = await getPost(postId);
|
||||||
|
|
||||||
@@ -23,7 +28,11 @@ export async function generateMetadata({ params }: { params: IPageParams }) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function PostPage({ params }: { params: IPageParams }) {
|
export default async function PostPage({
|
||||||
|
params,
|
||||||
|
}: {
|
||||||
|
params: IPageParams<IParams>;
|
||||||
|
}) {
|
||||||
const paramsData = await params;
|
const paramsData = await params;
|
||||||
const t = await getTranslations({ locale: paramsData.locale });
|
const t = await getTranslations({ locale: paramsData.locale });
|
||||||
|
|
||||||
|
|||||||
@@ -4,15 +4,19 @@ import Breadcrumb from '@/components/layout/breadcrumb';
|
|||||||
import { IBreadcrumbItem } from '@/components/layout/breadcrumb/breadcrumb';
|
import { IBreadcrumbItem } from '@/components/layout/breadcrumb/breadcrumb';
|
||||||
import ContentGenerator from '@/components/layout/contentGenerator';
|
import ContentGenerator from '@/components/layout/contentGenerator';
|
||||||
import InnerPageBanner from '@/components/layout/innerPages/banner';
|
import InnerPageBanner from '@/components/layout/innerPages/banner';
|
||||||
import { ILayoutLocaleParams } from '@/models/layout';
|
import { ILayoutLocaleParams, IPageParams } from '@/models/layout';
|
||||||
import { getProject } from '@/services/projects';
|
import { getProject } from '@/services/projects';
|
||||||
import { getTranslations } from 'next-intl/server';
|
import { getTranslations } from 'next-intl/server';
|
||||||
|
|
||||||
interface IPageParams extends ILayoutLocaleParams {
|
interface IParams {
|
||||||
id: string;
|
id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function generateMetadata({ params }: { params: IPageParams }) {
|
export async function generateMetadata({
|
||||||
|
params,
|
||||||
|
}: {
|
||||||
|
params: IPageParams<IParams>;
|
||||||
|
}) {
|
||||||
const { id: projectId, locale } = await params;
|
const { id: projectId, locale } = await params;
|
||||||
const t = await getTranslations({ locale });
|
const t = await getTranslations({ locale });
|
||||||
const project = await getProject(projectId);
|
const project = await getProject(projectId);
|
||||||
@@ -23,7 +27,11 @@ export async function generateMetadata({ params }: { params: IPageParams }) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function ProjectPage({ params }: { params: IPageParams }) {
|
export default async function ProjectPage({
|
||||||
|
params,
|
||||||
|
}: {
|
||||||
|
params: IPageParams<IParams>;
|
||||||
|
}) {
|
||||||
const paramsData = await params;
|
const paramsData = await params;
|
||||||
const t = await getTranslations({ locale: paramsData.locale });
|
const t = await getTranslations({ locale: paramsData.locale });
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export const productsRelatedByCategory = {
|
|||||||
export function generateProductsForCategory(
|
export function generateProductsForCategory(
|
||||||
categoryId: string,
|
categoryId: string,
|
||||||
): IProductCardProps[] {
|
): IProductCardProps[] {
|
||||||
|
// @ts-ignore
|
||||||
const relatedProducts = (productsRelatedByCategory[categoryId] ||
|
const relatedProducts = (productsRelatedByCategory[categoryId] ||
|
||||||
[]) as IProductCardProps[];
|
[]) as IProductCardProps[];
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { productCategoriesData } from './data';
|
|||||||
import { productsRelatedByCategory } from './[id]/products/data';
|
import { productsRelatedByCategory } from './[id]/products/data';
|
||||||
|
|
||||||
const getTypesCount = (categoryId: string) =>
|
const getTypesCount = (categoryId: string) =>
|
||||||
|
// @ts-ignore
|
||||||
productsRelatedByCategory[categoryId]?.length || 0;
|
productsRelatedByCategory[categoryId]?.length || 0;
|
||||||
|
|
||||||
const setRelatedLocaleData = (productCategory: APIProductCategoryEntity) => ({
|
const setRelatedLocaleData = (productCategory: APIProductCategoryEntity) => ({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { IProductCardProps } from './productCard.d';
|
import type { IProductCardProps } from './productCard.d';
|
||||||
|
|
||||||
export default function ProductCard({
|
export default function ProductCard({
|
||||||
title,
|
model,
|
||||||
imageSrc,
|
imageSrc,
|
||||||
size,
|
size,
|
||||||
}: IProductCardProps) {
|
}: IProductCardProps) {
|
||||||
@@ -10,11 +10,11 @@ export default function ProductCard({
|
|||||||
<div className="aspect-square w-full">
|
<div className="aspect-square w-full">
|
||||||
<img
|
<img
|
||||||
src={imageSrc}
|
src={imageSrc}
|
||||||
alt={title}
|
alt={model}
|
||||||
className="h-full w-full object-cover"
|
className="h-full w-full object-cover"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<h3 className="mt-4 mb-10 text-xl font-bold text-gray-500">{title}</h3>
|
<h3 className="mt-4 mb-10 text-xl font-bold text-gray-500">{model}</h3>
|
||||||
<span className="text-base font-normal text-gray-300">{size}</span>
|
<span className="text-base font-normal text-gray-300">{size}</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user