fixed some ui, refactored code

This commit is contained in:
Jelaletdin12
2025-12-13 00:05:43 +05:00
parent 5085c0cffd
commit 633a3c9d47
30 changed files with 1274 additions and 923 deletions

View File

@@ -146,7 +146,7 @@ export default function CartPage() {
}
return (
<div className="container mx-auto px-6">
<div className="container mx-auto px-2 md:px-4 lg:px-6 mb-18">
<h1 className="text-3xl font-bold mb-6 pt-3">{t("cart")}</h1>
<div className="flex flex-col md:flex-row gap-6">

View File

@@ -31,6 +31,6 @@ export default async function CategoryPage(props: Props) {
const params = await props.params
const { slug } = params
const CategoryPageClient = (await import("../../../../features/category/components/CategoryClient")).default
const CategoryPageClient = (await import("../../../../features/category/components/CategoryPageClient")).default
return <CategoryPageClient params={params} />
}

View File

@@ -35,11 +35,10 @@ export default function FavoritesPage() {
}
return (
<div className="container mx-auto px-6
md:px-4 lg:px-6 pb-12 space-y-8 max-w-[1504px]
<div className="container mx-auto px-2 md:px-4 lg:px-6 pb-12 space-y-8 max-w-[1504px]
">
<h1 className="bg-white text-3xl p-4 font-bold mb-0 pb-6">{t("favorite_products")}</h1>
<div className="bg-white grid grid-cols-2 sm:grid-cols-3 rounded-lg md:grid-cols-4 lg:grid-cols-5 gap-3 p-4">
<div className="bg-white grid grid-cols-2 sm:grid-cols-3 rounded-b-lg md:grid-cols-4 lg:grid-cols-5 gap-3 p-4">
{favorites.map((favorite: Favorite) => {
const product = favorite.product;

View File

@@ -1,20 +1,43 @@
import type { Metadata } from "next"
import OrdersPageClient from "../../../features/orders/components/OrderPage"
import type { Metadata, ResolvingMetadata } from "next";
import OrdersPageClient from "../../../features/orders/components/OrderPage";
export const metadata: Metadata = {
title: "My Orders | E-Commerce",
description: "View your order history",
robots: "noindex, nofollow", // Private page
}
const metadataContent = {
tm: {
title: "Meniň Sargytlarym | Post shop",
description: "Sargytlaryňyzy görüň",
},
ru: {
title: "Мои Заказы | Пост-магазин",
description: "Просмотр истории заказов",
},
} as const;
interface PageProps {
params: Promise<{
locale: string
}>
params: {
locale: string;
};
}
export async function generateMetadata(
{ params }: PageProps,
parent: ResolvingMetadata
): Promise<Metadata> {
const locale = params.locale as keyof typeof metadataContent;
const content = metadataContent[locale] || metadataContent.ru;
return {
title: content.title,
description: content.description,
robots: {
index: false,
follow: false,
nocache: true,
},
};
}
export default async function OrdersPage({ params }: PageProps) {
const resolvedParams = await params
return <OrdersPageClient locale={resolvedParams.locale} />
return <OrdersPageClient locale={params.locale} />;
}

View File

@@ -1,7 +1,17 @@
import type { Metadata } from "next";
import HomePage from "@/features/home/components/HomePage";
export const revalidate = 300;
const META = {
ru: {
title: "Интернет магазин - Лучшие товары по низким ценам",
description: "Качественные товары с быстрой доставкой по всей стране",
},
tm: {
title: "Post shop - Iň gowy harytlar, amatly bahada",
description:
"Ýokary hilli harytlar. Elektronika, eşik, arassaçylyk, sport, kosmetika",
},
} as const;
export async function generateMetadata({
params,
@@ -9,19 +19,7 @@ export async function generateMetadata({
params: Promise<{ locale: string }>;
}): Promise<Metadata> {
const { locale } = await params;
const meta = {
ru: {
title: "Интернет магазин - Лучшие товары по низким ценам",
description: "Качественные товары с быстрой доставкой по всей стране",
},
tm: {
title: "Satym dükanı - Iň gowy harytlar aşak bahada",
description: "Suw harytly towarnama. Elektrika, eşik, ev we bag",
},
};
const { title, description } = meta[locale as keyof typeof meta] || meta.ru;
const { title, description } = META[locale as keyof typeof META] || META.ru;
return {
title,

View File

@@ -3,9 +3,8 @@ import { notFound } from "next/navigation";
import ProductPageContent from "../../../../features/products/components/ProductPageContent";
type Props = {
params: Promise<{ locale: string; slug: string }>;
params: { locale: string; slug: string };
};
export const revalidate = 3600; // ISR: Revalidate every hour
export async function generateMetadata({ params }: Props): Promise<Metadata> {