droplinked-editor-configs 1.8.8 → 1.9.0
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/dist/apis/product/interface.d.ts +1 -0
- package/dist/droplinked-editor.es.js +1750 -1745
- package/dist/droplinked-editor.umd.js +64 -64
- package/dist/lib/stores/app/interfaces.d.ts +1 -0
- package/package.json +1 -1
- package/src/apis/product/interface.ts +1 -0
- package/src/components/blog-posts/hooks/useBlogs.ts +3 -3
- package/src/components/header/Sidebar.tsx +2 -2
- package/src/components/productGrid/components/ProductGrid/Slider/ProductImageSlider.tsx +10 -2
- package/src/components/productGrid/hooks/useProductFilters.ts +1 -1
- package/src/components/productGrid/hooks/useProducts.ts +3 -3
- package/src/components/ui/timer.tsx +0 -1
- package/src/configured-components/hero-section/variants/cover/StoreInfoSection.tsx +2 -2
- package/src/hooks/useCustomParams.ts +1 -1
- package/src/lib/stores/app/interfaces.ts +1 -0
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ export default function useBlogs() {
|
|
|
8
8
|
// Regular query for featured and recent blogs
|
|
9
9
|
const { data, isFetching } = useQuery({
|
|
10
10
|
queryKey: 'shop-blogs',
|
|
11
|
-
queryFn: () => getShopBlogsService(shop.
|
|
11
|
+
queryFn: () => getShopBlogsService(shop.url),
|
|
12
12
|
select(data) {
|
|
13
13
|
return {
|
|
14
14
|
featured: data.data.featured,
|
|
@@ -26,8 +26,8 @@ export default function useBlogs() {
|
|
|
26
26
|
hasNextPage,
|
|
27
27
|
isFetching: isMoreToDiscoverFetching
|
|
28
28
|
} = useInfiniteQuery({
|
|
29
|
-
queryKey: ['more-to-discover-blogs', shop.
|
|
30
|
-
queryFn: ({ pageParam = 1 }) => getShopBlogsService(`${shop.
|
|
29
|
+
queryKey: ['more-to-discover-blogs', shop.url],
|
|
30
|
+
queryFn: ({ pageParam = 1 }) => getShopBlogsService(`${shop.url}?page=${pageParam}&limit=10`),
|
|
31
31
|
getNextPageParam: (lastPage) => {
|
|
32
32
|
const moreToDiscover = lastPage.data.moreToDiscover
|
|
33
33
|
return moreToDiscover.hasNextPage ? moreToDiscover.nextPage : undefined
|
|
@@ -17,8 +17,8 @@ interface Props {
|
|
|
17
17
|
|
|
18
18
|
function Sidebar({ iconColor, linkManagement, ProfileDropdownWrapper }: Props) {
|
|
19
19
|
const { isOpen, onOpen, onClose } = useDisclosure()
|
|
20
|
-
const { states: { user, shop: {
|
|
21
|
-
const { id } = user?.[
|
|
20
|
+
const { states: { user, shop: { url } } } = useAppStore()
|
|
21
|
+
const { id } = user?.[url]?.user || {}
|
|
22
22
|
const { shopDesign: { backgroundBody } } = useThemeInfo()
|
|
23
23
|
const [isLargerThan768] = useMediaQuery('(min-width: 768px)')
|
|
24
24
|
const { defineMultiStyleConfig } = createMultiStyleConfigHelpers(parts.keys)
|
|
@@ -15,10 +15,18 @@ interface Props {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export default function ProductImageSlider({ product, isHovered, isEditing }: Props) {
|
|
18
|
-
const { images, title, slug } = product
|
|
18
|
+
const { images, title, slug, defaultImageIndex } = product
|
|
19
19
|
const { navigate } = useCustomNavigate()
|
|
20
20
|
const [currentIndex, setCurrentIndex] = useState(0)
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
// Reorder images to show default image first
|
|
23
|
+
const orderedImages = [...images]
|
|
24
|
+
if (defaultImageIndex !== undefined && defaultImageIndex >= 0 && defaultImageIndex < images.length) {
|
|
25
|
+
const defaultImage = orderedImages[defaultImageIndex]
|
|
26
|
+
orderedImages.splice(defaultImageIndex, 1)
|
|
27
|
+
orderedImages.unshift(defaultImage)
|
|
28
|
+
}
|
|
29
|
+
const sliderImages = orderedImages.slice(0, 3)
|
|
22
30
|
|
|
23
31
|
const [sliderRef, instanceRef] = useKeenSlider<HTMLDivElement>({
|
|
24
32
|
loop: true,
|
|
@@ -4,7 +4,7 @@ import useProductQueryStore from 'lib/stores/productQueryStore/productQueryStore
|
|
|
4
4
|
import { useInfiniteQuery } from 'react-query'
|
|
5
5
|
|
|
6
6
|
export default function useProducts(customLimit?: number) {
|
|
7
|
-
const { states: { shop: {
|
|
7
|
+
const { states: { shop: { url, currency: { conversionRateToUSD } } } } = useAppStore()
|
|
8
8
|
const appliedProductQuery = useProductQueryStore(s => s.appliedProductQuery)
|
|
9
9
|
const { minPrice, maxPrice } = appliedProductQuery
|
|
10
10
|
|
|
@@ -15,10 +15,10 @@ export default function useProducts(customLimit?: number) {
|
|
|
15
15
|
const limit = customLimit ? Math.min(customLimit, 4) : 15
|
|
16
16
|
|
|
17
17
|
return useInfiniteQuery({
|
|
18
|
-
queryKey: ["PRODUCTS",
|
|
18
|
+
queryKey: ["PRODUCTS", url, appliedProductQuery, customLimit],
|
|
19
19
|
queryFn: ({ pageParam = 1 }) => getProductsService({
|
|
20
20
|
page: pageParam,
|
|
21
|
-
shopName:
|
|
21
|
+
shopName: url,
|
|
22
22
|
limit,
|
|
23
23
|
...appliedProductQuery,
|
|
24
24
|
...(convertedMinPrice && { minPrice: convertedMinPrice }),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Box, Flex, FlexProps, GridProps, TextProps, Text } from '@chakra-ui/react'
|
|
2
2
|
import AppIcons from 'assets/icons/appIcons'
|
|
3
3
|
import useThemeInfo from 'hooks/useThemeInfo';
|
|
4
|
-
import useAppStore from 'lib/stores/app/appStore'
|
|
5
4
|
import { useEffect, useState } from 'react'
|
|
6
5
|
|
|
7
6
|
|
|
@@ -18,7 +18,7 @@ interface Props {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export default function StoreInfoSection({ socialChannels, imagePlaceholder, logo }: Props) {
|
|
21
|
-
const { states: { shop: {
|
|
21
|
+
const { states: { shop: { name } } } = useAppStore()
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
24
|
<section className="relative z-10">
|
|
@@ -31,7 +31,7 @@ export default function StoreInfoSection({ socialChannels, imagePlaceholder, log
|
|
|
31
31
|
<div className="ml-4 sm:ml-0 flex w-full flex-col gap-4 md:ml-40 mt-16 md:mt-2 md:flex-row sm:justify-between">
|
|
32
32
|
{/* Store Name */}
|
|
33
33
|
<Text className="text-ellipsis whitespace-nowrap text-xl font-bold sm:text-2xl">
|
|
34
|
-
{
|
|
34
|
+
{name || 'Store Name'}
|
|
35
35
|
</Text>
|
|
36
36
|
|
|
37
37
|
{/* Social Media Icons */}
|