update product details
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useState, useCallback } from 'react';
|
||||
import { useParams } from 'react-router';
|
||||
import { useParams } from 'next/navigation';
|
||||
import { ChevronDown, SlidersHorizontal } from 'lucide-react';
|
||||
import type { ShopifyCollection } from '@reacteditor/field-shopify';
|
||||
import {
|
||||
@@ -358,7 +358,9 @@ function buildProductFilters(active: ActiveFilters): ProductFilter[] {
|
||||
|
||||
export function CollectionView(props: CollectionProps) {
|
||||
const { collection: selected, showDescription, showCoverImage, customCoverImage, columns, limit, defaultSort } = props;
|
||||
const { handle: paramHandle } = useParams<{ handle?: string }>();
|
||||
const params = useParams();
|
||||
const paramHandle =
|
||||
typeof params?.handle === 'string' ? params.handle : undefined;
|
||||
const handle = selected?.handle ?? paramHandle ?? '';
|
||||
|
||||
const [sort, setSort] = useState<CollectionSortKey>(defaultSort);
|
||||
|
||||
Reference in New Issue
Block a user