pproducts
This commit is contained in:
@@ -85,7 +85,7 @@ export function Footer() {
|
||||
<h4 className="font-semibold mb-4">{t.footer.common.contact}</h4>
|
||||
<ul className="space-y-2 text-gray-400 text-sm">
|
||||
<li className="text-[15px]">{t.footer.common.email}: info@firma.uz</li>
|
||||
<li className="text-[15px]">{t.footer.common.phone}: +998 (99) 123-45-67</li>
|
||||
<li className="text-[15px]">{t.footer.common.phone}: +998 (99) 869-74-70</li>
|
||||
<li className="text-[15px]">{t.footer.common.telegram}: @firma_support</li>
|
||||
</ul>
|
||||
</motion.div>
|
||||
|
||||
@@ -24,7 +24,7 @@ export function ProductCard({ product, onViewDetails }: ProductCardProps) {
|
||||
src={product.images[0]}
|
||||
alt={product.nameKey}
|
||||
fill
|
||||
className="object-cover group-hover:scale-110 transition-transform duration-300"
|
||||
className="object-contain group-hover:scale-110 transition-transform duration-300"
|
||||
/>
|
||||
<div className="absolute inset-0 bg-black/0 group-hover:bg-black/30 transition-colors" />
|
||||
</div>
|
||||
@@ -39,14 +39,14 @@ export function ProductCard({ product, onViewDetails }: ProductCardProps) {
|
||||
</p>
|
||||
|
||||
{/* Specs Preview */}
|
||||
<div className="mb-4 space-y-2">
|
||||
{/* <div className="mb-4 space-y-2">
|
||||
{product.specs.slice(0, 2).map((spec, idx) => (
|
||||
<div key={idx} className="flex justify-between text-sm">
|
||||
<span className="text-gray-600">{spec.key}:</span>
|
||||
<span className="font-semibold text-gray-900">{spec.value}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div> */}
|
||||
|
||||
{/* CTA Button */}
|
||||
<motion.button
|
||||
@@ -55,7 +55,7 @@ export function ProductCard({ product, onViewDetails }: ProductCardProps) {
|
||||
onClick={() => onViewDetails(product.slug)}
|
||||
className="w-full flex items-center justify-center gap-2 px-4 py-2 bg-primary/80 text-white rounded-lg font-medium hover:bg-primary transition-colors"
|
||||
>
|
||||
Batafsil
|
||||
{t.details}
|
||||
<ExternalLink size={16} />
|
||||
</motion.button>
|
||||
</div>
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
|
||||
import { motion, AnimatePresence } from "framer-motion";
|
||||
import { X, Download } from "lucide-react";
|
||||
import { useTranslations } from "next-intl";
|
||||
import Image from "next/image";
|
||||
import { ProductViewer } from "./ProductViewer";
|
||||
import type { Product } from "@/lib/products";
|
||||
import { useLanguage } from "@/context/language-context";
|
||||
import Link from "next/link";
|
||||
|
||||
interface ProductModalProps {
|
||||
product: Product;
|
||||
@@ -13,7 +14,7 @@ interface ProductModalProps {
|
||||
}
|
||||
|
||||
export function ProductModal({ product, onClose }: ProductModalProps) {
|
||||
const t = useTranslations();
|
||||
const { t } = useLanguage();
|
||||
|
||||
return (
|
||||
<AnimatePresence>
|
||||
@@ -34,7 +35,7 @@ export function ProductModal({ product, onClose }: ProductModalProps) {
|
||||
{/* Header */}
|
||||
<div className="sticky top-0 bg-white border-b border-gray-200 p-6 flex justify-between items-center">
|
||||
<h2 className="text-2xl font-bold text-gray-900">
|
||||
{t(product.nameKey)}
|
||||
{product.nameKey}
|
||||
</h2>
|
||||
<motion.button
|
||||
whileHover={{ scale: 1.1 }}
|
||||
@@ -56,34 +57,14 @@ export function ProductModal({ product, onClose }: ProductModalProps) {
|
||||
images={product.images}
|
||||
autoRotate={true}
|
||||
/>
|
||||
|
||||
{/* Image Thumbnails */}
|
||||
{product.images.length > 1 && (
|
||||
<div className="mt-4 grid grid-cols-4 gap-2">
|
||||
{product.images.map((img, idx) => (
|
||||
<motion.div
|
||||
key={idx}
|
||||
whileHover={{ scale: 1.05 }}
|
||||
className="relative h-20 rounded cursor-pointer overflow-hidden bg-gray-100"
|
||||
>
|
||||
<Image
|
||||
src={img}
|
||||
alt={`${t(product.nameKey)} ${idx + 1}`}
|
||||
fill
|
||||
className="object-cover"
|
||||
/>
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Details */}
|
||||
<div>
|
||||
<p className="text-gray-600 mb-6">
|
||||
{product.longDescriptionKey
|
||||
? t(product.longDescriptionKey)
|
||||
: t(product.shortDescriptionKey)}
|
||||
? product.longDescriptionKey
|
||||
: product.shortDescriptionKey}
|
||||
</p>
|
||||
|
||||
{/* Specifications */}
|
||||
@@ -108,21 +89,16 @@ export function ProductModal({ product, onClose }: ProductModalProps) {
|
||||
|
||||
{/* CTA Buttons */}
|
||||
<div className="space-y-3">
|
||||
<motion.button
|
||||
whileHover={{ scale: 1.05 }}
|
||||
whileTap={{ scale: 0.95 }}
|
||||
className="w-full px-6 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 transition-colors"
|
||||
>
|
||||
{t("contact.send")}
|
||||
</motion.button>
|
||||
<motion.button
|
||||
whileHover={{ scale: 1.05 }}
|
||||
whileTap={{ scale: 0.95 }}
|
||||
className="w-full px-6 py-3 border border-blue-600 text-blue-600 rounded-lg font-semibold hover:bg-blue-50 transition-colors flex items-center justify-center gap-2"
|
||||
>
|
||||
<Download size={18} />
|
||||
Download Datasheet
|
||||
</motion.button>
|
||||
<Link href="#contact">
|
||||
<motion.button
|
||||
onClick={onClose}
|
||||
whileHover={{ scale: 1.05 }}
|
||||
whileTap={{ scale: 0.95 }}
|
||||
className="w-full px-6 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 transition-colors"
|
||||
>
|
||||
{t.contact.send}
|
||||
</motion.button>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -57,7 +57,7 @@ export function ProductViewer({
|
||||
src={primaryImage}
|
||||
alt="Product"
|
||||
fill
|
||||
className="object-cover"
|
||||
className="object-contain"
|
||||
/>
|
||||
</motion.div>
|
||||
) : (
|
||||
|
||||
@@ -8,11 +8,13 @@ import type { Product } from "@/lib/products";
|
||||
import { ProductModal } from "./ProductModal";
|
||||
import Image from "next/image";
|
||||
import { useLanguage } from "@/context/language-context";
|
||||
import Link from "next/link";
|
||||
import { ChevronsRight } from "lucide-react";
|
||||
|
||||
// hello everyone
|
||||
|
||||
export function ProductsGrid() {
|
||||
const {t} = useLanguage();
|
||||
const { t } = useLanguage();
|
||||
const products = getAllProducts();
|
||||
const [selectedProduct, setSelectedProduct] = useState<Product | null>(null);
|
||||
|
||||
@@ -47,7 +49,7 @@ export function ProductsGrid() {
|
||||
className="object-cover"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute w-full h-full top-0 left-0 bg-black opacity-25 -z-40"/>
|
||||
<div className="absolute w-full h-full top-0 left-0 bg-black opacity-25 -z-40" />
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
{/* Header */}
|
||||
<motion.div
|
||||
@@ -81,6 +83,14 @@ export function ProductsGrid() {
|
||||
))}
|
||||
</motion.div>
|
||||
</div>
|
||||
<div className="mt-10 w-full flex items-center justify-center">
|
||||
<Link
|
||||
href="/product"
|
||||
className="text-primary flex items-center gap-2 text-[18px] hover:bg-primary hover:text-white py-2 px-6 rounded-lg bg-[#ffffffb5] border mx-auto border-white"
|
||||
>
|
||||
{t.more} <ChevronsRight />
|
||||
</Link>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Product Modal */}
|
||||
|
||||
16
components/productsPage/products.tsx
Normal file
16
components/productsPage/products.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { allProduct } from "@/lib/allProducts";
|
||||
import React, { useEffect, useState } from "react";
|
||||
|
||||
export default function Products() {
|
||||
const [allProducts, setAllProducts] = useState<any>(null);
|
||||
useEffect(() => {
|
||||
const all = allProduct();
|
||||
all && Array.isArray(all) ? setAllProducts(all) : setAllProducts([]);
|
||||
setAllProducts;
|
||||
}, [allProducts]);
|
||||
return (
|
||||
<div>
|
||||
<div className="grid lg:grid-cols-3 sm:grid-cols-2 grid-cols-1 gap-4"></div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user