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.
@@ -291,6 +291,7 @@ export interface IShop {
291
291
  tokenBasedPricing: ITokenBasedPricing;
292
292
  launchDate: string | null;
293
293
  hasBlog: boolean;
294
+ url: string;
294
295
  }
295
296
  export interface IWallet {
296
297
  name: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "droplinked-editor-configs",
3
3
  "private": false,
4
- "version": "1.8.8",
4
+ "version": "1.9.0",
5
5
  "type": "module",
6
6
  "main": "dist/droplinked-editor.umd.js",
7
7
  "module": "dist/droplinked-editor.es.js",
@@ -23,4 +23,5 @@ export interface IHomePageProduct {
23
23
  discountRuleset: boolean;
24
24
  gatedRuleset: boolean;
25
25
  nftRecording: any;
26
+ defaultImageIndex?: number;
26
27
  }
@@ -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.name),
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.name],
30
- queryFn: ({ pageParam = 1 }) => getShopBlogsService(`${shop.name}?page=${pageParam}&limit=10`),
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: { name } } } = useAppStore()
21
- const { id } = user?.[name]?.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
- const sliderImages = images.slice(0, 3)
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,
@@ -6,7 +6,7 @@ export function useProductFilters() {
6
6
  const { states: { shop } } = useAppStore()
7
7
 
8
8
  return useQuery({
9
- queryFn: () => getAvailableProductFilters(shop.name),
9
+ queryFn: () => getAvailableProductFilters(shop.url),
10
10
  refetchOnWindowFocus: false
11
11
  })
12
12
  }
@@ -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: { name, currency: { conversionRateToUSD } } } } = useAppStore()
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", name, appliedProductQuery, customLimit],
18
+ queryKey: ["PRODUCTS", url, appliedProductQuery, customLimit],
19
19
  queryFn: ({ pageParam = 1 }) => getProductsService({
20
20
  page: pageParam,
21
- shopName: name,
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: { description } } } = useAppStore()
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
- {description || 'Store Name'}
34
+ {name || 'Store Name'}
35
35
  </Text>
36
36
 
37
37
  {/* Social Media Icons */}
@@ -4,5 +4,5 @@ type UseCustomParamsHook = () => { shopName: string }
4
4
 
5
5
  export const useCustomParams: UseCustomParamsHook = () => {
6
6
  const { states: { shop } } = useAppStore()
7
- return { shopName: shop.name }
7
+ return { shopName: shop.url }
8
8
  }
@@ -308,6 +308,7 @@ export interface IShop {
308
308
  tokenBasedPricing: ITokenBasedPricing;
309
309
  launchDate: string | null;
310
310
  hasBlog: boolean;
311
+ url: string;
311
312
  }
312
313
 
313
314
  export interface IWallet {