text updated
This commit is contained in:
@@ -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) => (
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user