droplinked-editor-configs 1.9.4 → 1.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -7,11 +7,13 @@ import ProductGridLayout from './ProductGridLayout'
|
|
|
7
7
|
import useIsMobile from 'hooks/useIsMobile'
|
|
8
8
|
import useProducts from 'components/productGrid/hooks/useProducts'
|
|
9
9
|
import Text from 'components/ui/Text'
|
|
10
|
+
import { useProductFilters } from 'components/productGrid/hooks/useProductFilters'
|
|
10
11
|
|
|
11
12
|
function ProductGrid({ limit, isEditing }: { limit?: number; isEditing?: boolean }) {
|
|
12
13
|
const { isLoading, data, hasNextPage, fetchNextPage, isFetchingNextPage } = useProducts(limit)
|
|
13
14
|
const products: IHomePageProduct[] = data?.pages.flatMap(page => page?.data?.data || []) || []
|
|
14
15
|
const viewMode = useProductQueryStore(s => s.viewMode)
|
|
16
|
+
const searchTerm = useProductQueryStore(s => s.appliedProductQuery.search)
|
|
15
17
|
const isMobile = useIsMobile()
|
|
16
18
|
|
|
17
19
|
const renderSkeletons = () => {
|
|
@@ -29,7 +31,9 @@ function ProductGrid({ limit, isEditing }: { limit?: number; isEditing?: boolean
|
|
|
29
31
|
if (products.length === 0) return (
|
|
30
32
|
<ProductGridLayout>
|
|
31
33
|
<Text as="p" className="col-span-full text-center">
|
|
32
|
-
|
|
34
|
+
{searchTerm
|
|
35
|
+
? "No products found matching your search"
|
|
36
|
+
: "No products available. Please try again later."}
|
|
33
37
|
</Text>
|
|
34
38
|
</ProductGridLayout>
|
|
35
39
|
)
|
|
@@ -21,6 +21,9 @@ export default function ProductImageSlider({ product, isHovered, isEditing }: Pr
|
|
|
21
21
|
|
|
22
22
|
// Reorder images to show default image first
|
|
23
23
|
const orderedImages = [...images]
|
|
24
|
+
const fallbackImage =
|
|
25
|
+
'https://upload-file-droplinked.s3.amazonaws.com/4a7a9605254cc8d0b64a6b0ee1250c09aa8b476907b67fd9afc1a180f1b6ad17.png';
|
|
26
|
+
|
|
24
27
|
if (defaultImageIndex !== undefined && defaultImageIndex >= 0 && defaultImageIndex < images.length) {
|
|
25
28
|
const defaultImage = orderedImages[defaultImageIndex]
|
|
26
29
|
orderedImages.splice(defaultImageIndex, 1)
|
|
@@ -60,7 +63,7 @@ export default function ProductImageSlider({ product, isHovered, isEditing }: Pr
|
|
|
60
63
|
return (
|
|
61
64
|
<div className="relative overflow-hidden rounded-lg aspect-square cursor-pointer">
|
|
62
65
|
<img
|
|
63
|
-
src={sliderImages[0]?.thumbnail}
|
|
66
|
+
src={sliderImages[0]?.thumbnail || fallbackImage}
|
|
64
67
|
alt={sliderImages[0]?.alt || title}
|
|
65
68
|
onClick={handleImageClick}
|
|
66
69
|
className="w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-[1.04]"
|