@tapcart/mobile-components 0.4.0 → 0.4.2
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.
|
@@ -38,12 +38,12 @@ const useInfiniteScroll = ({ initialData, loadMoreProducts, queryVariables: quer
|
|
|
38
38
|
var _a, _b, _c, _d;
|
|
39
39
|
const searchParams = useSearchParams();
|
|
40
40
|
const sortStateFromParam = useCallback(() => {
|
|
41
|
-
return searchParams.get("sort")
|
|
41
|
+
return (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get("sort"))
|
|
42
42
|
? parseSort(searchParams.get("sort"))
|
|
43
43
|
: // we need to default to the sort option from the query variables so that the initial sort is correct
|
|
44
44
|
queryVariableProps.sortOption;
|
|
45
45
|
}, [queryVariableProps.sortOption, searchParams]);
|
|
46
|
-
const selectedFilters = searchParams.get("filters") || "[]";
|
|
46
|
+
const selectedFilters = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get("filters")) || "[]";
|
|
47
47
|
const queryVariables = useMemo(() => {
|
|
48
48
|
return Object.assign(Object.assign({}, queryVariableProps), { sortOption: sortStateFromParam(), filterCategories: reconcileFilters({
|
|
49
49
|
selectedFilters,
|
|
@@ -134,7 +134,7 @@ const CarouselDots = React.forwardRef((_a, ref) => {
|
|
|
134
134
|
const numberOfSlides = Math.min((api === null || api === void 0 ? void 0 : api.scrollSnapList().length) || 0, maxDots);
|
|
135
135
|
const currentSlide = Math.min((api === null || api === void 0 ? void 0 : api.selectedScrollSnap()) || 0, maxDots - 1);
|
|
136
136
|
if (numberOfSlides > 1) {
|
|
137
|
-
return (_jsx("div", Object.assign({ ref: ref, className: `flex justify-center ${props.className}` }, { children: Array.from({ length: numberOfSlides }, (_, i) => (_jsx(Button, { className: `mx-1 h-1.5 w-1.5 rounded-full p-0 ${i === currentSlide
|
|
137
|
+
return (_jsx("div", Object.assign({ ref: ref, className: `flex justify-center ${props.className}` }, { children: Array.from({ length: numberOfSlides }, (_, i) => (_jsx(Button, { className: `mx-1 h-1.5 w-1.5 rounded-full p-0 border-none ${i === currentSlide
|
|
138
138
|
? 'bg-coreColors-brandColorPrimary'
|
|
139
139
|
: 'bg-coreColors-brandColorPrimary opacity-50'}`, "aria-label": `Go to slide ${i + 1}`, onClick: () => api === null || api === void 0 ? void 0 : api.scrollTo(i) }, i))) })));
|
|
140
140
|
}
|
package/dist/styles.css
CHANGED