pproducts
This commit is contained in:
@@ -16,7 +16,6 @@ export default function Home() {
|
|||||||
<main>
|
<main>
|
||||||
<ShowCase images={HERO_IMAGES} />
|
<ShowCase images={HERO_IMAGES} />
|
||||||
<About />
|
<About />
|
||||||
feature.labelKey
|
|
||||||
<ProductsGrid />
|
<ProductsGrid />
|
||||||
<FAQ />
|
<FAQ />
|
||||||
<ContactForm />
|
<ContactForm />
|
||||||
|
|||||||
9
app/product/page.tsx
Normal file
9
app/product/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
export default function Page() {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -85,7 +85,7 @@ export function Footer() {
|
|||||||
<h4 className="font-semibold mb-4">{t.footer.common.contact}</h4>
|
<h4 className="font-semibold mb-4">{t.footer.common.contact}</h4>
|
||||||
<ul className="space-y-2 text-gray-400 text-sm">
|
<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.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>
|
<li className="text-[15px]">{t.footer.common.telegram}: @firma_support</li>
|
||||||
</ul>
|
</ul>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export function ProductCard({ product, onViewDetails }: ProductCardProps) {
|
|||||||
src={product.images[0]}
|
src={product.images[0]}
|
||||||
alt={product.nameKey}
|
alt={product.nameKey}
|
||||||
fill
|
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 className="absolute inset-0 bg-black/0 group-hover:bg-black/30 transition-colors" />
|
||||||
</div>
|
</div>
|
||||||
@@ -39,14 +39,14 @@ export function ProductCard({ product, onViewDetails }: ProductCardProps) {
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
{/* Specs Preview */}
|
{/* Specs Preview */}
|
||||||
<div className="mb-4 space-y-2">
|
{/* <div className="mb-4 space-y-2">
|
||||||
{product.specs.slice(0, 2).map((spec, idx) => (
|
{product.specs.slice(0, 2).map((spec, idx) => (
|
||||||
<div key={idx} className="flex justify-between text-sm">
|
<div key={idx} className="flex justify-between text-sm">
|
||||||
<span className="text-gray-600">{spec.key}:</span>
|
<span className="text-gray-600">{spec.key}:</span>
|
||||||
<span className="font-semibold text-gray-900">{spec.value}</span>
|
<span className="font-semibold text-gray-900">{spec.value}</span>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div> */}
|
||||||
|
|
||||||
{/* CTA Button */}
|
{/* CTA Button */}
|
||||||
<motion.button
|
<motion.button
|
||||||
@@ -55,7 +55,7 @@ export function ProductCard({ product, onViewDetails }: ProductCardProps) {
|
|||||||
onClick={() => onViewDetails(product.slug)}
|
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"
|
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} />
|
<ExternalLink size={16} />
|
||||||
</motion.button>
|
</motion.button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,10 +2,11 @@
|
|||||||
|
|
||||||
import { motion, AnimatePresence } from "framer-motion";
|
import { motion, AnimatePresence } from "framer-motion";
|
||||||
import { X, Download } from "lucide-react";
|
import { X, Download } from "lucide-react";
|
||||||
import { useTranslations } from "next-intl";
|
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { ProductViewer } from "./ProductViewer";
|
import { ProductViewer } from "./ProductViewer";
|
||||||
import type { Product } from "@/lib/products";
|
import type { Product } from "@/lib/products";
|
||||||
|
import { useLanguage } from "@/context/language-context";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
interface ProductModalProps {
|
interface ProductModalProps {
|
||||||
product: Product;
|
product: Product;
|
||||||
@@ -13,7 +14,7 @@ interface ProductModalProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function ProductModal({ product, onClose }: ProductModalProps) {
|
export function ProductModal({ product, onClose }: ProductModalProps) {
|
||||||
const t = useTranslations();
|
const { t } = useLanguage();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
@@ -34,7 +35,7 @@ export function ProductModal({ product, onClose }: ProductModalProps) {
|
|||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="sticky top-0 bg-white border-b border-gray-200 p-6 flex justify-between items-center">
|
<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">
|
<h2 className="text-2xl font-bold text-gray-900">
|
||||||
{t(product.nameKey)}
|
{product.nameKey}
|
||||||
</h2>
|
</h2>
|
||||||
<motion.button
|
<motion.button
|
||||||
whileHover={{ scale: 1.1 }}
|
whileHover={{ scale: 1.1 }}
|
||||||
@@ -56,34 +57,14 @@ export function ProductModal({ product, onClose }: ProductModalProps) {
|
|||||||
images={product.images}
|
images={product.images}
|
||||||
autoRotate={true}
|
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>
|
</div>
|
||||||
|
|
||||||
{/* Details */}
|
{/* Details */}
|
||||||
<div>
|
<div>
|
||||||
<p className="text-gray-600 mb-6">
|
<p className="text-gray-600 mb-6">
|
||||||
{product.longDescriptionKey
|
{product.longDescriptionKey
|
||||||
? t(product.longDescriptionKey)
|
? product.longDescriptionKey
|
||||||
: t(product.shortDescriptionKey)}
|
: product.shortDescriptionKey}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{/* Specifications */}
|
{/* Specifications */}
|
||||||
@@ -108,21 +89,16 @@ export function ProductModal({ product, onClose }: ProductModalProps) {
|
|||||||
|
|
||||||
{/* CTA Buttons */}
|
{/* CTA Buttons */}
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<motion.button
|
<Link href="#contact">
|
||||||
whileHover={{ scale: 1.05 }}
|
<motion.button
|
||||||
whileTap={{ scale: 0.95 }}
|
onClick={onClose}
|
||||||
className="w-full px-6 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 transition-colors"
|
whileHover={{ scale: 1.05 }}
|
||||||
>
|
whileTap={{ scale: 0.95 }}
|
||||||
{t("contact.send")}
|
className="w-full px-6 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 transition-colors"
|
||||||
</motion.button>
|
>
|
||||||
<motion.button
|
{t.contact.send}
|
||||||
whileHover={{ scale: 1.05 }}
|
</motion.button>
|
||||||
whileTap={{ scale: 0.95 }}
|
</Link>
|
||||||
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>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export function ProductViewer({
|
|||||||
src={primaryImage}
|
src={primaryImage}
|
||||||
alt="Product"
|
alt="Product"
|
||||||
fill
|
fill
|
||||||
className="object-cover"
|
className="object-contain"
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -8,11 +8,13 @@ import type { Product } from "@/lib/products";
|
|||||||
import { ProductModal } from "./ProductModal";
|
import { ProductModal } from "./ProductModal";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { useLanguage } from "@/context/language-context";
|
import { useLanguage } from "@/context/language-context";
|
||||||
|
import Link from "next/link";
|
||||||
|
import { ChevronsRight } from "lucide-react";
|
||||||
|
|
||||||
// hello everyone
|
// hello everyone
|
||||||
|
|
||||||
export function ProductsGrid() {
|
export function ProductsGrid() {
|
||||||
const {t} = useLanguage();
|
const { t } = useLanguage();
|
||||||
const products = getAllProducts();
|
const products = getAllProducts();
|
||||||
const [selectedProduct, setSelectedProduct] = useState<Product | null>(null);
|
const [selectedProduct, setSelectedProduct] = useState<Product | null>(null);
|
||||||
|
|
||||||
@@ -47,7 +49,7 @@ export function ProductsGrid() {
|
|||||||
className="object-cover"
|
className="object-cover"
|
||||||
/>
|
/>
|
||||||
</div>
|
</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">
|
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<motion.div
|
<motion.div
|
||||||
@@ -81,6 +83,14 @@ export function ProductsGrid() {
|
|||||||
))}
|
))}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
</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>
|
</section>
|
||||||
|
|
||||||
{/* Product Modal */}
|
{/* 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>
|
||||||
|
);
|
||||||
|
}
|
||||||
10
lib/allProducts.ts
Normal file
10
lib/allProducts.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
export const allProduct = async () => {
|
||||||
|
try{
|
||||||
|
const res = await axios.get('')
|
||||||
|
}catch(err){
|
||||||
|
console.log("all product error: ",err);
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -16,7 +16,7 @@ export const products: Product[] = [
|
|||||||
nameKey: "Schotchik Nasos",
|
nameKey: "Schotchik Nasos",
|
||||||
slug: "Yuqori sifatli schotchik nasos, benzin, dizel va kerosinni tashishda ishlatiladi.",
|
slug: "Yuqori sifatli schotchik nasos, benzin, dizel va kerosinni tashishda ishlatiladi.",
|
||||||
shortDescriptionKey: "Xavfsiz neft mahsulotlarini tashish uchun",
|
shortDescriptionKey: "Xavfsiz neft mahsulotlarini tashish uchun",
|
||||||
images: ["/images/pump-1.jpg", "/images/pump-1-alt.jpg"],
|
images: ["/product/product.jpg", "/images/pump-1-alt.jpg"],
|
||||||
specs: [
|
specs: [
|
||||||
{ key: "Flow Rate", value: "100 L/min" },
|
{ key: "Flow Rate", value: "100 L/min" },
|
||||||
{ key: "Pressure", value: "10 bar" },
|
{ key: "Pressure", value: "10 bar" },
|
||||||
@@ -29,7 +29,7 @@ export const products: Product[] = [
|
|||||||
nameKey: "Agregat Nasos",
|
nameKey: "Agregat Nasos",
|
||||||
slug: "Katta volumli neft mahsulotlarini tashishda o'rnatilgan.",
|
slug: "Katta volumli neft mahsulotlarini tashishda o'rnatilgan.",
|
||||||
shortDescriptionKey: "Kuchli va ishonchli aggregat nasos",
|
shortDescriptionKey: "Kuchli va ishonchli aggregat nasos",
|
||||||
images: ["/images/pump-2.jpg", "/images/pump-2-alt.jpg"],
|
images: ["/product/product1.jpg", "/images/pump-2-alt.jpg"],
|
||||||
specs: [
|
specs: [
|
||||||
{ key: "Flow Rate", value: "250 L/min" },
|
{ key: "Flow Rate", value: "250 L/min" },
|
||||||
{ key: "Pressure", value: "15 bar" },
|
{ key: "Pressure", value: "15 bar" },
|
||||||
@@ -42,7 +42,7 @@ export const products: Product[] = [
|
|||||||
nameKey: "СЦЛ 20/24",
|
nameKey: "СЦЛ 20/24",
|
||||||
slug:"Chuqurligi 20-24 metrda ishlaydigan professional nasos.",
|
slug:"Chuqurligi 20-24 metrda ishlaydigan professional nasos.",
|
||||||
shortDescriptionKey: "Professional kalibrli nasos",
|
shortDescriptionKey: "Professional kalibrli nasos",
|
||||||
images: ["/images/pump-3.jpg", "/images/pump-3-alt.jpg"],
|
images: ["/product/product2.jpg", "/images/pump-3-alt.jpg"],
|
||||||
specs: [
|
specs: [
|
||||||
{ key: "Depth Rating", value: "20-24 m" },
|
{ key: "Depth Rating", value: "20-24 m" },
|
||||||
{ key: "Flow Rate", value: "150 L/min" },
|
{ key: "Flow Rate", value: "150 L/min" },
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ export const translations = {
|
|||||||
description: "Chuqurligi 20-24 metrda ishlaydigan professional nasos.",
|
description: "Chuqurligi 20-24 metrda ishlaydigan professional nasos.",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
more: "Ko'proq ko'rish",
|
||||||
|
details: "Batafsil",
|
||||||
},
|
},
|
||||||
|
|
||||||
ru: {
|
ru: {
|
||||||
@@ -187,5 +189,7 @@ export const translations = {
|
|||||||
"Профессиональный насос, работающий на глубине 20-24 метра.",
|
"Профессиональный насос, работающий на глубине 20-24 метра.",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
more: "Смотреть больше",
|
||||||
|
details: "Подробнее",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user