text updated

This commit is contained in:
nabijonovdavronbek619@gmail.com
2026-02-19 11:11:26 +05:00
parent 9608ed23ac
commit afae7da68c
10 changed files with 103 additions and 56 deletions

View File

@@ -69,7 +69,7 @@ export function Navbar() {
href={`/${locale}/faq`}
className="font-unbounded uppercase text-white text-sm h-full flex items-center font-semibold hover:cursor-pointer hover:text-red-500 transition"
>
{t("navbar.faq")}
{locale === "ru" ? "ФАК" : "FAQ"}
</Link>
<Link
href={`/${locale}/services`}
@@ -187,7 +187,7 @@ export function Navbar() {
className="font-unbounded uppercase text-white text-base font-semibold hover:text-red-500 transition py-2"
onClick={() => setIsMobileMenuOpen(false)}
>
{t("navbar.faq")}
{locale === "ru" ? "ФАК" : "FAQ"}
</Link>
<Link
href={`/${locale}/services`}

View File

@@ -19,15 +19,13 @@ export function BannerSlider() {
const BANNER_DATA = [
{
image: "/images/homeBanner3.png",
title: "YONG'INGA QARSHI HIMOYA",
description:
"Biz yongin xavfsizligi tizimlarini ornatish va sertifikatlangan himoya vositalari savdosi boyicha professional xizmatlar korsatamiz.",
title: t("home.banner.title2"),
description: t("home.banner.description"),
},
{
image: "/images/homeBanner4.png",
title: "YONG'INGA QARSHI HIMOYA",
description:
"Biz yongin xavfsizligi tizimlarini ornatish va sertifikatlangan himoya vositalari savdosi boyicha professional xizmatlar korsatamiz.",
title: t("home.banner.title2"),
description: t("home.banner.description"),
},
];
return (

View File

@@ -7,6 +7,7 @@ import { useCategory } from "@/store/useCategory";
import { useSubCategory } from "@/store/useSubCategory";
import { useQuery } from "@tanstack/react-query";
import { Check, ChevronDown, ChevronUp } from "lucide-react";
import { useTranslations } from "next-intl";
import { useEffect, useState } from "react";
export default function Filter() {
@@ -18,6 +19,7 @@ export default function Filter() {
const subCategory = useSubCategory((state) => state.subCategory);
const setSubCategory = useSubCategory((state) => state.setSubCategory);
const clearSubCategory = useSubCategory((state) => state.clearSubCategory);
const t = useTranslations();
const [dataExpanded, setDataExpanded] = useState<boolean>(false);
const [numberExpanded, setNumberExpanded] = useState<boolean>(false);
@@ -211,7 +213,7 @@ export default function Filter() {
))
) : (
<p className="text-sm text-gray-300">
SubCategory topilmadi
{t("subcategory_not_found")}
</p>
)}
</div>
@@ -225,7 +227,7 @@ export default function Filter() {
{visibleSectionData && visibleSectionData.length > 0 && (
<div className="bg-gray-500 rounded-lg w-full">
<p className="bg-red-500 text-white p-2 font-semibold font-almarai text-lg rounded-t-lg">
Bo'lim
{t("section")}
</p>
<div className="lg:space-y-3 space-x-6 lg:p-2 p-5 flex lg:flex-col overflow-x-auto lg:overflow-x-hidden items-start justify-start w-full">
{visibleSectionData.map((item: any) => (

View File

@@ -2,17 +2,18 @@
import { useFilter } from "@/lib/filter-zustand";
import { X } from "lucide-react";
import { useTranslations } from "next-intl";
export default function FilterInfo() {
const filtered = useFilter((state) => state.filter);
const resetFilter = useFilter((state) => state.resetFilter);
const togleFilter = useFilter((state) => state.toggleFilter);
const t = useTranslations();
if (filtered.length === 0) {
return null;
}
return (
<div className="fixed bottom-13 left-5 z-10 bg-gray-500 p-3 rounded-lg space-y-3 max-w-70 w-full">
<p className="text-white ">Found: 20</p>
<div className="flex gap-1 flex-wrap">
{filtered &&
filtered.map((item) => (
@@ -28,7 +29,7 @@ export default function FilterInfo() {
))}
</div>
<button onClick={resetFilter} className="text-white underline ">
Clear all
{t("clear_all")}
</button>
</div>
);

View File

@@ -8,12 +8,14 @@ import "swiper/css/navigation";
import "swiper/css/pagination";
import "swiper/css/thumbs";
import Image from "next/image";
import { useTranslations } from "next-intl";
const navigationPrevEl = ".custom-swiper-prev";
const navigationNextEl = ".custom-swiper-next";
export function SliderComp({ imgs }: { imgs: string[] }) {
const [thumbsSwiper, setThumbsSwiper] = useState<SwiperType | null>(null);
const t = useTranslations();
// Agar rasm bo'lmasa
if (!imgs || imgs.length === 0) {
@@ -33,7 +35,7 @@ export function SliderComp({ imgs }: { imgs: string[] }) {
d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"
/>
</svg>
<p className="text-gray-500">Rasm mavjud emas</p>
<p className="text-gray-500">{t("image_not_found")}</p>
</div>
</div>
);
@@ -45,7 +47,10 @@ export function SliderComp({ imgs }: { imgs: string[] }) {
<div className="relative group">
<Swiper
modules={[Navigation, Pagination, Thumbs]}
thumbs={{ swiper: thumbsSwiper && !thumbsSwiper.destroyed ? thumbsSwiper : null }}
thumbs={{
swiper:
thumbsSwiper && !thumbsSwiper.destroyed ? thumbsSwiper : null,
}}
navigation={{
prevEl: navigationPrevEl,
nextEl: navigationNextEl,
@@ -79,21 +84,41 @@ export function SliderComp({ imgs }: { imgs: string[] }) {
<button
className={`${navigationPrevEl.replace(
".",
""
"",
)} absolute z-10 top-1/2 -translate-y-1/2 left-2 md:left-4 rounded-lg w-10 h-10 md:w-12 md:h-12 bg-red-700/90 hover:bg-red-800 text-white flex items-center justify-center transition opacity-0 group-hover:opacity-100 shadow-lg`}
>
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" />
<svg
className="w-6 h-6"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M15 19l-7-7 7-7"
/>
</svg>
</button>
<button
className={`${navigationNextEl.replace(
".",
""
"",
)} absolute z-10 top-1/2 -translate-y-1/2 right-2 md:right-4 rounded-lg w-10 h-10 md:w-12 md:h-12 bg-red-700/90 hover:bg-red-800 text-white flex items-center justify-center transition opacity-0 group-hover:opacity-100 shadow-lg`}
>
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
<svg
className="w-6 h-6"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M9 5l7 7-7 7"
/>
</svg>
</button>
</>
@@ -130,4 +155,4 @@ export function SliderComp({ imgs }: { imgs: string[] }) {
)}
</div>
);
}
}

View File

@@ -1,53 +1,54 @@
import DotAnimatsiya from "@/components/dot/DotAnimatsiya";
import FAQAccordion from "../faq/faqAccardion";
import { useTranslations } from "next-intl";
import FAQAccordion, { FAQItem } from "../faq/faqAccardion";
import { useLocale, useTranslations } from "next-intl";
export function ServiceFaq() {
const t = useTranslations();
const faqItems = [
{
id: "faq-1",
question: t("faq.question1.question"),
answer: t("faq.question1.answer"),
},
{
id: "faq-2",
question: t("faq.question2.question"),
answer: t("faq.question2.answer"),
},
{
id: "faq-3",
question: t("faq.question3.question"),
answer: t("faq.question3.answer"),
},
{
id: "faq-4",
question: t("faq.question4.question"),
answer: t("faq.question4.answer"),
},
{
id: "faq-5",
question: t("faq.question5.question"),
answer: t("faq.question5.answer"),
},
];
const locale = useLocale();
const faqItems: FAQItem[] = [
{
id: 1,
question: t("faq.question1.question"),
answer: t("faq.question1.answer"),
},
{
id: 2,
question: t("faq.question2.question"),
answer: t("faq.question2.answer"),
},
{
id: 3,
question: t("faq.question3.question"),
answer: t("faq.question3.answer"),
},
{
id: 4,
question: t("faq.question4.question"),
answer: t("faq.question4.answer"),
},
{
id: 5,
question: t("faq.question5.question"),
answer: t("faq.question5.answer"),
},
];
return (
<div className="bg-[#1e1d1c] py-20 pb-50 space-y-8">
{/* header */}
<div className="space-y-4 w-full ">
<div className="flex items-center gap-3 justify-center text-white text-xl">
<DotAnimatsiya /> FAQ
<DotAnimatsiya /> {locale === "ru" ? "ФАК" : "FAQ"}
</div>
<h1
className="text-center bg-linear-to-br from-white via-white/50 to-black
text-transparent bg-clip-text text-3xl font-bold uppercase leading-tight sm:text-4xl md:text-5xl lg:text-6xl"
>
General Questions
{t("faq.banner.topic")}
</h1>
</div>
{/* FAQ Section */}
<div className="md:col-span-2 max-w-6xl mx-auto w-full">
<div className="md:col-span-2 max-w-6xl mx-auto w-full px-2">
<FAQAccordion items={faqItems} />
</div>
</div>

View File

@@ -5,9 +5,11 @@ import { endPoints } from "@/request/links";
import { useQuery } from "@tanstack/react-query";
import { useCategory } from "@/store/useCategory";
import Card from "./card";
import { useTranslations } from "next-intl";
export function MainSubCategory() {
const category = useCategory((state) => state.category);
const t = useTranslations();
const { data, isLoading, error } = useQuery({
queryKey: ["subCategory"],
queryFn: () => httpClient(endPoints.subCategory.byId(category.id)),
@@ -27,7 +29,7 @@ export function MainSubCategory() {
if (error) {
return (
<div className="text-center text-red-500 py-10">
Ma'lumotlarni yuklashda xatolik yuz berdi
{t("loading_error")}
</div>
);
}
@@ -35,7 +37,7 @@ export function MainSubCategory() {
if (!data || data.length === 0) {
return (
<div className="text-center text-gray-400 py-10">
Mahsulotlar topilmadi
{t("products_not_found")}
</div>
);
}
@@ -43,7 +45,7 @@ export function MainSubCategory() {
<div className="grid lg:grid-cols-3 sm:grid-cols-2 grid-cols-1 gap-5">
{data.map((item: any) => (
<Card
key={item.id} // ✅ index o'rniga id ishlatish
key={item.id}
title={item.name}
image={item.image}
slug={item.slug}

View File

@@ -293,6 +293,12 @@
"succes": "sent!",
"loadingError": "An error occurred while loading data",
"productsNotFound": "Products not found",
"subcategory_not_found": "Subcategory not found",
"section": "Section",
"clear_all": "Clear all",
"image_not_found": "Image not available",
"loading_error": "An error occurred while loading data",
"products_not_found":"Products not found",
"priceModal": {
"title": "Get Price",
"product": {

View File

@@ -293,6 +293,12 @@
"succes": "Отправлено!",
"loadingError": "Произошла ошибка при загрузке данных",
"productsNotFound": "Товары не найдены",
"subcategory_not_found": "Подкатегория не найдена",
"section": "Раздел",
"clear_all": "Очистить всё",
"image_not_found": "Изображение отсутствует",
"loading_error": "Произошла ошибка при загрузке данных",
"products_not_found":"Товары не найдены",
"priceModal": {
"title": "Узнать цену",
"product": {

View File

@@ -293,6 +293,12 @@
"succes": "Yuborildi!",
"loadingError": "Ma'lumotlarni yuklashda xatolik yuz berdi",
"productsNotFound": "Mahsulotlar topilmadi",
"subcategory_not_found": "Subkategoriya topilmadi",
"section": "Bo'lim",
"clear_all":"Barchasini tozalash",
"image_not_found":"Rasm mavjud emas",
"loading_error": "Ma'lumotlarni yuklashda xatolik yuz berdi",
"products_not_found":"Mahsulotlar topilmadi",
"priceModal": {
"title": "Narxni bilish",
"product": {