@fast-simon/shopify-hydrogen 1.0.4 → 1.0.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/README.md +186 -179
- package/dist/esnext/@types/Tab.d.ts +9 -9
- package/dist/esnext/@types/Tab.js +5 -5
- package/dist/esnext/@types/appServerProps.d.ts +12 -12
- package/dist/esnext/@types/appServerProps.js +1 -1
- package/dist/esnext/@types/articles.d.ts +12 -12
- package/dist/esnext/@types/articles.js +1 -1
- package/dist/esnext/@types/categories.d.ts +10 -10
- package/dist/esnext/@types/categories.js +1 -1
- package/dist/esnext/@types/currency.d.ts +1 -1
- package/dist/esnext/@types/currency.js +1 -1
- package/dist/esnext/@types/device.d.ts +1 -1
- package/dist/esnext/@types/device.js +1 -1
- package/dist/esnext/@types/editor.d.ts +418 -416
- package/dist/esnext/@types/editor.js +6 -6
- package/dist/esnext/@types/facets.d.ts +37 -37
- package/dist/esnext/@types/facets.js +16 -16
- package/dist/esnext/@types/ispOptions.d.ts +6 -6
- package/dist/esnext/@types/ispOptions.js +1 -1
- package/dist/esnext/@types/narrow.d.ts +7 -7
- package/dist/esnext/@types/narrow.js +1 -1
- package/dist/esnext/@types/product.d.ts +134 -134
- package/dist/esnext/@types/product.js +7 -7
- package/dist/esnext/@types/promoTile.d.ts +11 -11
- package/dist/esnext/@types/promoTile.js +1 -1
- package/dist/esnext/@types/results.d.ts +38 -36
- package/dist/esnext/@types/results.js +1 -1
- package/dist/esnext/@types/routing.d.ts +11 -11
- package/dist/esnext/@types/routing.js +1 -1
- package/dist/esnext/@types/siteSetup.d.ts +52 -52
- package/dist/esnext/@types/siteSetup.js +1 -1
- package/dist/esnext/@types/siteStatus.d.ts +5 -5
- package/dist/esnext/@types/siteStatus.js +1 -1
- package/dist/esnext/@types/sortBy.d.ts +12 -12
- package/dist/esnext/@types/sortBy.js +1 -1
- package/dist/esnext/@types/translations.d.ts +12 -12
- package/dist/esnext/@types/translations.js +6 -6
- package/dist/esnext/components/FastSimonApp.server.d.ts +9 -9
- package/dist/esnext/components/FastSimonApp.server.js +45 -45
- package/dist/esnext/components/FastSimonProvider.server.d.ts +10 -10
- package/dist/esnext/components/FastSimonProvider.server.js +9 -9
- package/dist/esnext/components/Filters/DesktopFilters/DesktopFilters.server.d.ts +8 -8
- package/dist/esnext/components/Filters/DesktopFilters/DesktopFilters.server.js +5 -5
- package/dist/esnext/components/Filters/FacetOption.client.d.ts +9 -9
- package/dist/esnext/components/Filters/FacetOption.client.js +39 -39
- package/dist/esnext/components/Filters/Filters.server.d.ts +12 -12
- package/dist/esnext/components/Filters/Filters.server.js +11 -11
- package/dist/esnext/components/Filters/FiltersList.server.d.ts +8 -8
- package/dist/esnext/components/Filters/FiltersList.server.js +11 -11
- package/dist/esnext/components/Filters/FiltersSkeleton.d.ts +3 -3
- package/dist/esnext/components/Filters/FiltersSkeleton.js +32 -32
- package/dist/esnext/components/Filters/MobileFilters/MobileFilters.client.d.ts +6 -6
- package/dist/esnext/components/Filters/MobileFilters/MobileFilters.client.js +20 -20
- package/dist/esnext/components/Filters/RemovableTags/RemovableTag.client.d.ts +8 -8
- package/dist/esnext/components/Filters/RemovableTags/RemovableTag.client.js +11 -11
- package/dist/esnext/components/Filters/RemovableTags/RemovableTags.client.d.ts +8 -8
- package/dist/esnext/components/Filters/RemovableTags/RemovableTags.client.js +51 -51
- package/dist/esnext/components/PageTitle/PageTitle.server.d.ts +7 -7
- package/dist/esnext/components/PageTitle/PageTitle.server.js +4 -4
- package/dist/esnext/components/Pagination/Pagination.client.d.ts +9 -9
- package/dist/esnext/components/Pagination/Pagination.client.js +43 -43
- package/dist/esnext/components/Pagination/utils.d.ts +1 -1
- package/dist/esnext/components/Pagination/utils.js +4 -4
- package/dist/esnext/components/ProductCard/ProductCard.d.ts +10 -10
- package/dist/esnext/components/ProductCard/ProductCard.js +31 -31
- package/dist/esnext/components/ProductCard/components/AddToCart/AddToCart.client.d.ts +10 -10
- package/dist/esnext/components/ProductCard/components/AddToCart/AddToCart.client.js +23 -23
- package/dist/esnext/components/ProductCard/components/Compare/Compare.d.ts +6 -6
- package/dist/esnext/components/ProductCard/components/Compare/Compare.js +6 -6
- package/dist/esnext/components/ProductCard/components/Info/ProductInfo.d.ts +9 -9
- package/dist/esnext/components/ProductCard/components/Info/ProductInfo.js +11 -11
- package/dist/esnext/components/ProductCard/components/Price/Price.d.ts +7 -7
- package/dist/esnext/components/ProductCard/components/Price/Price.js +6 -6
- package/dist/esnext/components/ProductCard/components/ProductImage/ProductImage.d.ts +8 -8
- package/dist/esnext/components/ProductCard/components/ProductImage/ProductImage.js +7 -7
- package/dist/esnext/components/ProductCard/components/Title/Title.d.ts +7 -7
- package/dist/esnext/components/ProductCard/components/Title/Title.js +4 -4
- package/dist/esnext/components/ProductGrid/ProductGrid.server.d.ts +10 -10
- package/dist/esnext/components/ProductGrid/ProductGrid.server.js +10 -10
- package/dist/esnext/components/ProductGrid/stylesUtil.d.ts +138 -138
- package/dist/esnext/components/ProductGrid/stylesUtil.js +122 -122
- package/dist/esnext/components/ResultsSummary/ResultsSummary.server.d.ts +7 -7
- package/dist/esnext/components/ResultsSummary/ResultsSummary.server.js +8 -8
- package/dist/esnext/components/SortBy/SortBy.client.d.ts +10 -10
- package/dist/esnext/components/SortBy/SortBy.client.js +8 -8
- package/dist/esnext/components/SortBy/components/DesktopSortBy.client.d.ts +8 -8
- package/dist/esnext/components/SortBy/components/DesktopSortBy.client.js +30 -30
- package/dist/esnext/components/SortBy/utils.d.ts +8 -8
- package/dist/esnext/components/SortBy/utils.js +28 -28
- package/dist/esnext/components/index.d.ts +2 -2
- package/dist/esnext/components/index.js +2 -2
- package/dist/esnext/context/setRoutingContext.d.ts +2 -2
- package/dist/esnext/context/setRoutingContext.js +14 -14
- package/dist/esnext/context/setSiteContext.d.ts +6 -6
- package/dist/esnext/context/setSiteContext.js +18 -18
- package/dist/esnext/hooks/ResizeDetect.client.d.ts +2 -2
- package/dist/esnext/hooks/ResizeDetect.client.js +6 -6
- package/dist/esnext/hooks/useClickOutside.d.ts +1 -1
- package/dist/esnext/hooks/useClickOutside.js +12 -12
- package/dist/esnext/hooks/useScreenSize.d.ts +1 -1
- package/dist/esnext/hooks/useScreenSize.js +19 -19
- package/dist/esnext/icons/DownArrowIcon.d.ts +9 -9
- package/dist/esnext/icons/DownArrowIcon.js +5 -5
- package/dist/esnext/icons/LeftArrowIcon.d.ts +8 -8
- package/dist/esnext/icons/LeftArrowIcon.js +5 -5
- package/dist/esnext/icons/RejectIcon.d.ts +8 -8
- package/dist/esnext/icons/RejectIcon.js +5 -5
- package/dist/esnext/icons/RightArrowIcon.d.ts +8 -8
- package/dist/esnext/icons/RightArrowIcon.js +5 -5
- package/dist/esnext/icons/Spinner.d.ts +11 -11
- package/dist/esnext/icons/Spinner.js +6 -6
- package/dist/esnext/index.d.ts +1 -1
- package/dist/esnext/index.js +1 -1
- package/dist/esnext/services/__tests__/categories_navigation.test.d.ts +1 -0
- package/dist/esnext/services/__tests__/categories_navigation.test.js +90 -0
- package/dist/esnext/services/categories_navigation.d.ts +69 -48
- package/dist/esnext/services/categories_navigation.js +53 -51
- package/dist/esnext/services/search.d.ts +47 -47
- package/dist/esnext/services/search.js +51 -51
- package/dist/esnext/services/site_setup.d.ts +7 -7
- package/dist/esnext/services/site_setup.js +69 -69
- package/dist/esnext/utils/DynamicStyle.d.ts +7 -7
- package/dist/esnext/utils/DynamicStyle.js +5 -5
- package/dist/esnext/utils/defaults.d.ts +8 -8
- package/dist/esnext/utils/defaults.js +9 -9
- package/dist/esnext/utils/getDynamicStylesVar.d.ts +1 -1
- package/dist/esnext/utils/getDynamicStylesVar.js +5 -5
- package/dist/esnext/utils/getRoutingState.d.ts +9 -9
- package/dist/esnext/utils/getRoutingState.js +13 -13
- package/dist/esnext/utils/makeServingRequests.d.ts +6 -6
- package/dist/esnext/utils/makeServingRequests.js +32 -32
- package/dist/node/plugin/extendOptimizeDeps.d.ts +2 -2
- package/dist/node/plugin/extendOptimizeDeps.js +14 -14
- package/dist/node/plugin/index.d.ts +3 -3
- package/dist/node/plugin/index.js +13 -13
- package/dist/node/plugin/injectCSS.d.ts +2 -2
- package/dist/node/plugin/injectCSS.js +25 -25
- package/dist/node/plugin/suppressWarnings.d.ts +2 -2
- package/dist/node/plugin/suppressWarnings.js +21 -21
- package/package.json +37 -34
- package/dist/esnext/styles/fast-simon.css +0 -622
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export function FastSkeleton() {
|
|
3
|
-
let rowsSizes = new Array(15);
|
|
4
|
-
let numOfRowsPerFacetArray = new Array(5);
|
|
5
|
-
for (let i = 0; i < 5; i++) {
|
|
6
|
-
numOfRowsPerFacetArray[i] = 0;
|
|
7
|
-
}
|
|
8
|
-
const getRandomInt = (min, max) => {
|
|
9
|
-
min = Math.ceil(min);
|
|
10
|
-
max = Math.floor(max);
|
|
11
|
-
return Math.floor(Math.random() * (max - min) + min);
|
|
12
|
-
};
|
|
13
|
-
const createItemsWidth = () => {
|
|
14
|
-
for (let i = 0; i < 15; i++) {
|
|
15
|
-
rowsSizes[i] = {};
|
|
16
|
-
for (let j = 0; j < 5; j++) {
|
|
17
|
-
rowsSizes[i][j] = {
|
|
18
|
-
height: j === 0 ? '18px' : '11px',
|
|
19
|
-
width: getRandomInt(j === 0 ? 70 : 33, j === 0 ? 100 : 70) + '%'
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
createItemsWidth();
|
|
25
|
-
setInterval(createItemsWidth, 1500);
|
|
26
|
-
return (React.createElement("div", { className: "fs-filters" }, rowsSizes.map(row => {
|
|
27
|
-
return (React.createElement("div", { className: "fs-vertical-filters-skeleton-section" }, numOfRowsPerFacetArray.map((rowItem, index) => {
|
|
28
|
-
return (React.createElement("div", { className: "row-skeleton", style: { width: `${row[index].width}`, height: `${row[index].height}` } }));
|
|
29
|
-
})));
|
|
30
|
-
})));
|
|
31
|
-
}
|
|
32
|
-
export default FastSkeleton;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export function FastSkeleton() {
|
|
3
|
+
let rowsSizes = new Array(15);
|
|
4
|
+
let numOfRowsPerFacetArray = new Array(5);
|
|
5
|
+
for (let i = 0; i < 5; i++) {
|
|
6
|
+
numOfRowsPerFacetArray[i] = 0;
|
|
7
|
+
}
|
|
8
|
+
const getRandomInt = (min, max) => {
|
|
9
|
+
min = Math.ceil(min);
|
|
10
|
+
max = Math.floor(max);
|
|
11
|
+
return Math.floor(Math.random() * (max - min) + min);
|
|
12
|
+
};
|
|
13
|
+
const createItemsWidth = () => {
|
|
14
|
+
for (let i = 0; i < 15; i++) {
|
|
15
|
+
rowsSizes[i] = {};
|
|
16
|
+
for (let j = 0; j < 5; j++) {
|
|
17
|
+
rowsSizes[i][j] = {
|
|
18
|
+
height: j === 0 ? '18px' : '11px',
|
|
19
|
+
width: getRandomInt(j === 0 ? 70 : 33, j === 0 ? 100 : 70) + '%'
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
createItemsWidth();
|
|
25
|
+
setInterval(createItemsWidth, 1500);
|
|
26
|
+
return (React.createElement("div", { className: "fs-filters" }, rowsSizes.map(row => {
|
|
27
|
+
return (React.createElement("div", { className: "fs-vertical-filters-skeleton-section" }, numOfRowsPerFacetArray.map((rowItem, index) => {
|
|
28
|
+
return (React.createElement("div", { className: "row-skeleton", style: { width: `${row[index].width}`, height: `${row[index].height}` } }));
|
|
29
|
+
})));
|
|
30
|
+
})));
|
|
31
|
+
}
|
|
32
|
+
export default FastSkeleton;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface Props {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
export declare function MobileFiltersClient({ children }: Props): React.JSX.Element;
|
|
6
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function MobileFiltersClient({ children }: Props): React.JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import React, { useRef, useState } from 'react';
|
|
2
|
-
import { useClickOutside } from "../../../hooks/useClickOutside";
|
|
3
|
-
export function MobileFiltersClient({ children }) {
|
|
4
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
5
|
-
const [isClosing, setIsClosing] = useState(false);
|
|
6
|
-
const filtersRef = useRef(null);
|
|
7
|
-
const onClickOutside = () => {
|
|
8
|
-
setIsClosing(true);
|
|
9
|
-
setTimeout(() => {
|
|
10
|
-
setIsOpen(false);
|
|
11
|
-
setIsClosing(false);
|
|
12
|
-
}, 450);
|
|
13
|
-
};
|
|
14
|
-
useClickOutside(filtersRef, onClickOutside);
|
|
15
|
-
return (React.createElement(React.Fragment, null,
|
|
16
|
-
React.createElement("div", { className: 'fs-mobile-filters-button', onClick: () => setIsOpen(true) }, "Filters"),
|
|
17
|
-
isOpen ?
|
|
18
|
-
React.createElement("div", { className: `fs-mobile-filters-wrapper` },
|
|
19
|
-
React.createElement("span", { ref: filtersRef, className: isClosing ? 'fs-filters-slider-close' : 'fs-filters-slider-open' }, children)) : null));
|
|
20
|
-
}
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import { useClickOutside } from "../../../hooks/useClickOutside";
|
|
3
|
+
export function MobileFiltersClient({ children }) {
|
|
4
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
5
|
+
const [isClosing, setIsClosing] = useState(false);
|
|
6
|
+
const filtersRef = useRef(null);
|
|
7
|
+
const onClickOutside = () => {
|
|
8
|
+
setIsClosing(true);
|
|
9
|
+
setTimeout(() => {
|
|
10
|
+
setIsOpen(false);
|
|
11
|
+
setIsClosing(false);
|
|
12
|
+
}, 450);
|
|
13
|
+
};
|
|
14
|
+
useClickOutside(filtersRef, onClickOutside);
|
|
15
|
+
return (React.createElement(React.Fragment, null,
|
|
16
|
+
React.createElement("div", { className: 'fs-mobile-filters-button', onClick: () => setIsOpen(true) }, "Filters"),
|
|
17
|
+
isOpen ?
|
|
18
|
+
React.createElement("div", { className: `fs-mobile-filters-wrapper` },
|
|
19
|
+
React.createElement("span", { ref: filtersRef, className: isClosing ? 'fs-filters-slider-close' : 'fs-filters-slider-open' }, children)) : null));
|
|
20
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface Props {
|
|
3
|
-
name: string;
|
|
4
|
-
value: string;
|
|
5
|
-
onRemove: (name: string, value: string) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare function RemovableTagClient({ name, value, onRemove }: Props): React.JSX.Element;
|
|
8
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string;
|
|
5
|
+
onRemove: (name: string, value: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function RemovableTagClient({ name, value, onRemove }: Props): React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { RejectIcon } from "../../../icons/RejectIcon";
|
|
3
|
-
export function RemovableTagClient({ name, value, onRemove }) {
|
|
4
|
-
const onRemoveClicked = () => {
|
|
5
|
-
onRemove(name, value);
|
|
6
|
-
};
|
|
7
|
-
return (React.createElement("div", { className: 'fs-removable-tag', onClick: onRemoveClicked },
|
|
8
|
-
React.createElement("span", { className: "removable-tag-text fs-removable-tag-text" }, value),
|
|
9
|
-
React.createElement("span", { className: "fs-removable-tag-remove-button", onClick: onRemoveClicked },
|
|
10
|
-
React.createElement(RejectIcon, { color: "gray" }))));
|
|
11
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RejectIcon } from "../../../icons/RejectIcon";
|
|
3
|
+
export function RemovableTagClient({ name, value, onRemove }) {
|
|
4
|
+
const onRemoveClicked = () => {
|
|
5
|
+
onRemove(name, value);
|
|
6
|
+
};
|
|
7
|
+
return (React.createElement("div", { className: 'fs-removable-tag', onClick: onRemoveClicked },
|
|
8
|
+
React.createElement("span", { className: "removable-tag-text fs-removable-tag-text" }, value),
|
|
9
|
+
React.createElement("span", { className: "fs-removable-tag-remove-button", onClick: onRemoveClicked },
|
|
10
|
+
React.createElement(RejectIcon, { color: "gray" }))));
|
|
11
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { RemovableTagsSettings } from "../../../@types/editor";
|
|
3
|
-
interface Props {
|
|
4
|
-
narrowString?: string;
|
|
5
|
-
removableTagsSettings: RemovableTagsSettings;
|
|
6
|
-
}
|
|
7
|
-
export declare function RemovableTagsClient({ narrowString, removableTagsSettings }: Props): React.JSX.Element;
|
|
8
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RemovableTagsSettings } from "../../../@types/editor";
|
|
3
|
+
interface Props {
|
|
4
|
+
narrowString?: string;
|
|
5
|
+
removableTagsSettings: RemovableTagsSettings;
|
|
6
|
+
}
|
|
7
|
+
export declare function RemovableTagsClient({ narrowString, removableTagsSettings }: Props): React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { Narrow } from "@fast-simon/utilities";
|
|
3
|
-
import { RemovableTagClient } from "./RemovableTag.client";
|
|
4
|
-
import { useNavigate, useServerProps, useUrl } from "@shopify/hydrogen";
|
|
5
|
-
import { Defaults } from "../../../utils/defaults";
|
|
6
|
-
import { DynamicStyle } from "../../../utils/DynamicStyle";
|
|
7
|
-
export function RemovableTagsClient({ narrowString, removableTagsSettings }) {
|
|
8
|
-
const [narrow, setNarrow] = useState(Narrow.parseNarrow(narrowString || ''));
|
|
9
|
-
const [items, setItems] = useState(Object.entries(narrow));
|
|
10
|
-
//const [size, setSize] = useState(items.reduce((p, [name, values]) => p + values.size, 0)); TODO: use size to show clear all button
|
|
11
|
-
const url = useUrl();
|
|
12
|
-
const { setServerProps, serverProps } = useServerProps();
|
|
13
|
-
const navigation = useNavigate();
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
const newNarrow = Narrow.parseNarrow(narrowString || '');
|
|
16
|
-
setNarrow(narrow);
|
|
17
|
-
const newItems = Object.entries(newNarrow);
|
|
18
|
-
setItems(newItems);
|
|
19
|
-
//setSize(newItems.reduce((p, [name, values]) => p + values.size, 0)) TODO: use size to show clear all button
|
|
20
|
-
}, [narrowString]);
|
|
21
|
-
const onRemoveClick = (name, value) => {
|
|
22
|
-
const newNarrow = Narrow.updateNarrow(Narrow.parseNarrow(narrowString || ''), name, value);
|
|
23
|
-
setNarrow(newNarrow);
|
|
24
|
-
setItems(Object.entries(newNarrow));
|
|
25
|
-
let dumpedNarrow = Narrow.dumpNarrow(newNarrow);
|
|
26
|
-
url.searchParams.delete('page');
|
|
27
|
-
if (dumpedNarrow) {
|
|
28
|
-
url.searchParams.set('filters', dumpedNarrow);
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
url.searchParams.delete('filters');
|
|
32
|
-
}
|
|
33
|
-
navigation(url.href);
|
|
34
|
-
setServerProps(Defaults.fastSimonProps, { ...serverProps?.[Defaults.fastSimonProps], page: 1, narrowString: dumpedNarrow });
|
|
35
|
-
};
|
|
36
|
-
const removeNarrow = useCallback(onRemoveClick, [items]);
|
|
37
|
-
const dynamicStyles = {
|
|
38
|
-
'border': removableTagsSettings?.border,
|
|
39
|
-
'box-shadow': removableTagsSettings?.shadow,
|
|
40
|
-
'border-radius': removableTagsSettings?.borderRadius,
|
|
41
|
-
'font-family': removableTagsSettings?.font.font,
|
|
42
|
-
'color': removableTagsSettings?.color,
|
|
43
|
-
'letter-spacing': removableTagsSettings?.font.letterSpacing,
|
|
44
|
-
'font-size': removableTagsSettings?.font.fontSize,
|
|
45
|
-
'font-weight': removableTagsSettings?.font.fontWeight,
|
|
46
|
-
'background-color': removableTagsSettings?.backgroundColor,
|
|
47
|
-
};
|
|
48
|
-
return (React.createElement(React.Fragment, null,
|
|
49
|
-
React.createElement(DynamicStyle, { styles: dynamicStyles, className: 'fs-removable-tag' }),
|
|
50
|
-
React.createElement("div", { className: 'fs-removable-tags-container' }, items.map(([name, values]) => Array.from(values).map(value => (React.createElement(RemovableTagClient, { key: `removable_tag_${name}_${value}`, name: name, value: value, onRemove: removeNarrow })))))));
|
|
51
|
-
}
|
|
1
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { Narrow } from "@fast-simon/utilities";
|
|
3
|
+
import { RemovableTagClient } from "./RemovableTag.client";
|
|
4
|
+
import { useNavigate, useServerProps, useUrl } from "@shopify/hydrogen";
|
|
5
|
+
import { Defaults } from "../../../utils/defaults";
|
|
6
|
+
import { DynamicStyle } from "../../../utils/DynamicStyle";
|
|
7
|
+
export function RemovableTagsClient({ narrowString, removableTagsSettings }) {
|
|
8
|
+
const [narrow, setNarrow] = useState(Narrow.parseNarrow(narrowString || ''));
|
|
9
|
+
const [items, setItems] = useState(Object.entries(narrow));
|
|
10
|
+
//const [size, setSize] = useState(items.reduce((p, [name, values]) => p + values.size, 0)); TODO: use size to show clear all button
|
|
11
|
+
const url = useUrl();
|
|
12
|
+
const { setServerProps, serverProps } = useServerProps();
|
|
13
|
+
const navigation = useNavigate();
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const newNarrow = Narrow.parseNarrow(narrowString || '');
|
|
16
|
+
setNarrow(narrow);
|
|
17
|
+
const newItems = Object.entries(newNarrow);
|
|
18
|
+
setItems(newItems);
|
|
19
|
+
//setSize(newItems.reduce((p, [name, values]) => p + values.size, 0)) TODO: use size to show clear all button
|
|
20
|
+
}, [narrowString]);
|
|
21
|
+
const onRemoveClick = (name, value) => {
|
|
22
|
+
const newNarrow = Narrow.updateNarrow(Narrow.parseNarrow(narrowString || ''), name, value);
|
|
23
|
+
setNarrow(newNarrow);
|
|
24
|
+
setItems(Object.entries(newNarrow));
|
|
25
|
+
let dumpedNarrow = Narrow.dumpNarrow(newNarrow);
|
|
26
|
+
url.searchParams.delete('page');
|
|
27
|
+
if (dumpedNarrow) {
|
|
28
|
+
url.searchParams.set('filters', dumpedNarrow);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
url.searchParams.delete('filters');
|
|
32
|
+
}
|
|
33
|
+
navigation(url.href);
|
|
34
|
+
setServerProps(Defaults.fastSimonProps, { ...serverProps?.[Defaults.fastSimonProps], page: 1, narrowString: dumpedNarrow });
|
|
35
|
+
};
|
|
36
|
+
const removeNarrow = useCallback(onRemoveClick, [items]);
|
|
37
|
+
const dynamicStyles = {
|
|
38
|
+
'border': removableTagsSettings?.border,
|
|
39
|
+
'box-shadow': removableTagsSettings?.shadow,
|
|
40
|
+
'border-radius': removableTagsSettings?.borderRadius,
|
|
41
|
+
'font-family': removableTagsSettings?.font.font,
|
|
42
|
+
'color': removableTagsSettings?.color,
|
|
43
|
+
'letter-spacing': removableTagsSettings?.font.letterSpacing,
|
|
44
|
+
'font-size': removableTagsSettings?.font.fontSize,
|
|
45
|
+
'font-weight': removableTagsSettings?.font.fontWeight,
|
|
46
|
+
'background-color': removableTagsSettings?.backgroundColor,
|
|
47
|
+
};
|
|
48
|
+
return (React.createElement(React.Fragment, null,
|
|
49
|
+
React.createElement(DynamicStyle, { styles: dynamicStyles, className: 'fs-removable-tag' }),
|
|
50
|
+
React.createElement("div", { className: 'fs-removable-tags-container' }, items.map(([name, values]) => Array.from(values).map(value => (React.createElement(RemovableTagClient, { key: `removable_tag_${name}_${value}`, name: name, value: value, onRemove: removeNarrow })))))));
|
|
51
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface Props {
|
|
3
|
-
searchTerm?: string | null;
|
|
4
|
-
categoryName?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function PageTitleServer({ searchTerm, categoryName }: Props): React.JSX.Element;
|
|
7
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
searchTerm?: string | null;
|
|
4
|
+
categoryName?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function PageTitleServer({ searchTerm, categoryName }: Props): React.JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export function PageTitleServer({ searchTerm, categoryName }) {
|
|
3
|
-
return (React.createElement("div", { className: 'fs-page-title' }, searchTerm ? `Search results for ${searchTerm}` : categoryName));
|
|
4
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export function PageTitleServer({ searchTerm, categoryName }) {
|
|
3
|
+
return (React.createElement("div", { className: 'fs-page-title' }, searchTerm ? `Search results for ${searchTerm}` : categoryName));
|
|
4
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Pagination as PaginationType } from "../../@types/editor";
|
|
3
|
-
interface Props {
|
|
4
|
-
currentPage: number;
|
|
5
|
-
paginationSettings: PaginationType;
|
|
6
|
-
totalPages: number;
|
|
7
|
-
}
|
|
8
|
-
export declare function Pagination({ currentPage, paginationSettings, totalPages }: Props): React.JSX.Element;
|
|
9
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Pagination as PaginationType } from "../../@types/editor";
|
|
3
|
+
interface Props {
|
|
4
|
+
currentPage: number;
|
|
5
|
+
paginationSettings: PaginationType;
|
|
6
|
+
totalPages: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function Pagination({ currentPage, paginationSettings, totalPages }: Props): React.JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useNavigate, useServerProps, useUrl } from "@shopify/hydrogen";
|
|
3
|
-
import { Defaults } from "../../utils/defaults";
|
|
4
|
-
import { getPageURL } from "./utils";
|
|
5
|
-
import { LeftArrowIcon } from "../../icons/LeftArrowIcon";
|
|
6
|
-
import { RightArrowIcon } from "../../icons/RightArrowIcon";
|
|
7
|
-
export function Pagination({ currentPage, paginationSettings, totalPages }) {
|
|
8
|
-
const { setServerProps, serverProps } = useServerProps();
|
|
9
|
-
const navigation = useNavigate();
|
|
10
|
-
const url = useUrl();
|
|
11
|
-
const goTo = (event, pageNum) => {
|
|
12
|
-
event.preventDefault();
|
|
13
|
-
url.searchParams.set('page', String(pageNum));
|
|
14
|
-
navigation(url.href);
|
|
15
|
-
setServerProps(Defaults.fastSimonProps, { ...serverProps?.[Defaults.fastSimonProps], page: pageNum });
|
|
16
|
-
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
17
|
-
};
|
|
18
|
-
const totalOfPagesArray = [...Array.from(Array(totalPages).keys())].map(i => i + 1);
|
|
19
|
-
return (React.createElement("div", { className: "pagination-wrapper" },
|
|
20
|
-
currentPage > 1 ?
|
|
21
|
-
React.createElement("span", { className: "arrow-button-wrapper", onClick: (event) => goTo(event, currentPage - 1) },
|
|
22
|
-
React.createElement("a", { className: "arrow-button", href: getPageURL(currentPage - 1, url) },
|
|
23
|
-
React.createElement(LeftArrowIcon, null))) : null,
|
|
24
|
-
React.createElement("span", { className: "center-pages-wrapper" }, totalOfPagesArray.map(pageNumber => {
|
|
25
|
-
if (pageNumber === 2 && currentPage > 4) {
|
|
26
|
-
return React.createElement("span", { key: `three-dots-left`, className: "page-number-item three-dots-item" }, "...");
|
|
27
|
-
}
|
|
28
|
-
if (pageNumber === currentPage) {
|
|
29
|
-
return React.createElement("a", { key: `page_num_${pageNumber}`, className: "page-number-item page-number-item-selected", href: getPageURL(pageNumber, url), onClick: (event) => goTo(event, pageNumber) }, pageNumber);
|
|
30
|
-
}
|
|
31
|
-
else if (pageNumber === currentPage + 1 || pageNumber === currentPage + 2 || pageNumber === currentPage - 1 || pageNumber === currentPage - 2 || pageNumber === totalPages || pageNumber === 1) {
|
|
32
|
-
return React.createElement("a", { key: `page_num_${pageNumber}`, className: "page-number-item", href: getPageURL(pageNumber, url), onClick: (event) => goTo(event, pageNumber) }, pageNumber);
|
|
33
|
-
}
|
|
34
|
-
if (currentPage < totalPages - 3 && pageNumber === totalPages - 1) {
|
|
35
|
-
return React.createElement("span", { key: `three-dots-right`, className: "page-number-item three-dots-item" }, "...");
|
|
36
|
-
}
|
|
37
|
-
return React.createElement(React.Fragment, null);
|
|
38
|
-
})),
|
|
39
|
-
currentPage < totalPages ?
|
|
40
|
-
React.createElement("span", { className: "arrow-button-wrapper", onClick: (event) => goTo(event, currentPage + 1) },
|
|
41
|
-
React.createElement("a", { className: "arrow-button", href: getPageURL(currentPage + 1, url) },
|
|
42
|
-
React.createElement(RightArrowIcon, null))) : null));
|
|
43
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useNavigate, useServerProps, useUrl } from "@shopify/hydrogen";
|
|
3
|
+
import { Defaults } from "../../utils/defaults";
|
|
4
|
+
import { getPageURL } from "./utils";
|
|
5
|
+
import { LeftArrowIcon } from "../../icons/LeftArrowIcon";
|
|
6
|
+
import { RightArrowIcon } from "../../icons/RightArrowIcon";
|
|
7
|
+
export function Pagination({ currentPage, paginationSettings, totalPages }) {
|
|
8
|
+
const { setServerProps, serverProps } = useServerProps();
|
|
9
|
+
const navigation = useNavigate();
|
|
10
|
+
const url = useUrl();
|
|
11
|
+
const goTo = (event, pageNum) => {
|
|
12
|
+
event.preventDefault();
|
|
13
|
+
url.searchParams.set('page', String(pageNum));
|
|
14
|
+
navigation(url.href);
|
|
15
|
+
setServerProps(Defaults.fastSimonProps, { ...serverProps?.[Defaults.fastSimonProps], page: pageNum });
|
|
16
|
+
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
17
|
+
};
|
|
18
|
+
const totalOfPagesArray = [...Array.from(Array(totalPages).keys())].map(i => i + 1);
|
|
19
|
+
return (React.createElement("div", { className: "pagination-wrapper" },
|
|
20
|
+
currentPage > 1 ?
|
|
21
|
+
React.createElement("span", { className: "arrow-button-wrapper", onClick: (event) => goTo(event, currentPage - 1) },
|
|
22
|
+
React.createElement("a", { className: "arrow-button", href: getPageURL(currentPage - 1, url) },
|
|
23
|
+
React.createElement(LeftArrowIcon, null))) : null,
|
|
24
|
+
React.createElement("span", { className: "center-pages-wrapper" }, totalOfPagesArray.map(pageNumber => {
|
|
25
|
+
if (pageNumber === 2 && currentPage > 4) {
|
|
26
|
+
return React.createElement("span", { key: `three-dots-left`, className: "page-number-item three-dots-item" }, "...");
|
|
27
|
+
}
|
|
28
|
+
if (pageNumber === currentPage) {
|
|
29
|
+
return React.createElement("a", { key: `page_num_${pageNumber}`, className: "page-number-item page-number-item-selected", href: getPageURL(pageNumber, url), onClick: (event) => goTo(event, pageNumber) }, pageNumber);
|
|
30
|
+
}
|
|
31
|
+
else if (pageNumber === currentPage + 1 || pageNumber === currentPage + 2 || pageNumber === currentPage - 1 || pageNumber === currentPage - 2 || pageNumber === totalPages || pageNumber === 1) {
|
|
32
|
+
return React.createElement("a", { key: `page_num_${pageNumber}`, className: "page-number-item", href: getPageURL(pageNumber, url), onClick: (event) => goTo(event, pageNumber) }, pageNumber);
|
|
33
|
+
}
|
|
34
|
+
if (currentPage < totalPages - 3 && pageNumber === totalPages - 1) {
|
|
35
|
+
return React.createElement("span", { key: `three-dots-right`, className: "page-number-item three-dots-item" }, "...");
|
|
36
|
+
}
|
|
37
|
+
return React.createElement(React.Fragment, null);
|
|
38
|
+
})),
|
|
39
|
+
currentPage < totalPages ?
|
|
40
|
+
React.createElement("span", { className: "arrow-button-wrapper", onClick: (event) => goTo(event, currentPage + 1) },
|
|
41
|
+
React.createElement("a", { className: "arrow-button", href: getPageURL(currentPage + 1, url) },
|
|
42
|
+
React.createElement(RightArrowIcon, null))) : null));
|
|
43
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getPageURL(page: number, url: URL): string;
|
|
1
|
+
export declare function getPageURL(page: number, url: URL): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function getPageURL(page, url) {
|
|
2
|
-
url.searchParams.set('page', String(page));
|
|
3
|
-
return url.href;
|
|
4
|
-
}
|
|
1
|
+
export function getPageURL(page, url) {
|
|
2
|
+
url.searchParams.set('page', String(page));
|
|
3
|
+
return url.href;
|
|
4
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ProductSettings } from "../../@types/editor";
|
|
3
|
-
import { ServerProduct } from "../../@types/product";
|
|
4
|
-
interface Props {
|
|
5
|
-
productData: ServerProduct;
|
|
6
|
-
productSettings: ProductSettings;
|
|
7
|
-
index: number;
|
|
8
|
-
}
|
|
9
|
-
export declare function ProductCard({ productData, productSettings, index }: Props): React.JSX.Element;
|
|
10
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ProductSettings } from "../../@types/editor";
|
|
3
|
+
import { ServerProduct } from "../../@types/product";
|
|
4
|
+
interface Props {
|
|
5
|
+
productData: ServerProduct;
|
|
6
|
+
productSettings: ProductSettings;
|
|
7
|
+
index: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function ProductCard({ productData, productSettings, index }: Props): React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ProductImage } from "./components/ProductImage/ProductImage";
|
|
3
|
-
import { AddToCartClient } from "./components/AddToCart/AddToCart.client";
|
|
4
|
-
import { ProductInfo } from "./components/Info/ProductInfo";
|
|
5
|
-
export function ProductCard({ productData, productSettings, index }) {
|
|
6
|
-
const shopifyVariantNodes = productData.vra.map(variant => {
|
|
7
|
-
return {
|
|
8
|
-
id: `gid://shopify/ProductVariant/${variant[0]}`,
|
|
9
|
-
priceV2: { amount: productData.p, currencyCode: 'USD' },
|
|
10
|
-
compareAtPriceV2: null,
|
|
11
|
-
image: {
|
|
12
|
-
url: productData.t
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
if (!shopifyVariantNodes.length) {
|
|
17
|
-
shopifyVariantNodes.push({
|
|
18
|
-
id: `gid://shopify/ProductVariant/${productData.id}`,
|
|
19
|
-
priceV2: { amount: productData.p, currencyCode: 'USD' },
|
|
20
|
-
compareAtPriceV2: null,
|
|
21
|
-
image: {
|
|
22
|
-
url: productData.t
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return (React.createElement(React.Fragment, null,
|
|
27
|
-
React.createElement("div", { className: "fs-product-card" },
|
|
28
|
-
React.createElement(ProductImage, { imageURL: productData.t, redirectURL: productData.u, index: index }),
|
|
29
|
-
React.createElement(ProductInfo, { productSettings: productSettings, productData: productData }),
|
|
30
|
-
React.createElement(AddToCartClient, { variantId: String(productData.id), variantNodes: shopifyVariantNodes, addToCartSettings: productSettings.addToCart }))));
|
|
31
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ProductImage } from "./components/ProductImage/ProductImage";
|
|
3
|
+
import { AddToCartClient } from "./components/AddToCart/AddToCart.client";
|
|
4
|
+
import { ProductInfo } from "./components/Info/ProductInfo";
|
|
5
|
+
export function ProductCard({ productData, productSettings, index }) {
|
|
6
|
+
const shopifyVariantNodes = productData.vra.map(variant => {
|
|
7
|
+
return {
|
|
8
|
+
id: `gid://shopify/ProductVariant/${variant[0]}`,
|
|
9
|
+
priceV2: { amount: productData.p, currencyCode: 'USD' },
|
|
10
|
+
compareAtPriceV2: null,
|
|
11
|
+
image: {
|
|
12
|
+
url: productData.t
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
if (!shopifyVariantNodes.length) {
|
|
17
|
+
shopifyVariantNodes.push({
|
|
18
|
+
id: `gid://shopify/ProductVariant/${productData.id}`,
|
|
19
|
+
priceV2: { amount: productData.p, currencyCode: 'USD' },
|
|
20
|
+
compareAtPriceV2: null,
|
|
21
|
+
image: {
|
|
22
|
+
url: productData.t
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return (React.createElement(React.Fragment, null,
|
|
27
|
+
React.createElement("div", { className: "fs-product-card" },
|
|
28
|
+
React.createElement(ProductImage, { imageURL: productData.t, redirectURL: productData.u, index: index }),
|
|
29
|
+
React.createElement(ProductInfo, { productSettings: productSettings, productData: productData }),
|
|
30
|
+
React.createElement(AddToCartClient, { variantId: String(productData.id), variantNodes: shopifyVariantNodes, addToCartSettings: productSettings.addToCart }))));
|
|
31
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ProductAddToCartSettings } from "../../../../@types/editor";
|
|
3
|
-
interface Props {
|
|
4
|
-
variantId: string;
|
|
5
|
-
quantity?: number;
|
|
6
|
-
variantNodes?: any;
|
|
7
|
-
addToCartSettings: ProductAddToCartSettings;
|
|
8
|
-
}
|
|
9
|
-
export declare function AddToCartClient({ variantId, quantity, variantNodes, addToCartSettings }: Props): React.JSX.Element;
|
|
10
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ProductAddToCartSettings } from "../../../../@types/editor";
|
|
3
|
+
interface Props {
|
|
4
|
+
variantId: string;
|
|
5
|
+
quantity?: number;
|
|
6
|
+
variantNodes?: any;
|
|
7
|
+
addToCartSettings: ProductAddToCartSettings;
|
|
8
|
+
}
|
|
9
|
+
export declare function AddToCartClient({ variantId, quantity, variantNodes, addToCartSettings }: Props): React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { AddToCartButton, ProductOptionsProvider } from '@shopify/hydrogen';
|
|
3
|
-
import { useCart } from "@shopify/hydrogen";
|
|
4
|
-
import { Spinner } from "../../../../icons/Spinner";
|
|
5
|
-
export function AddToCartClient({ variantId, quantity = 1, variantNodes, addToCartSettings }) {
|
|
6
|
-
const { status } = useCart();
|
|
7
|
-
const [addingProduct, setAddingProduct] = useState(false);
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
if (status === 'idle') {
|
|
10
|
-
if (addingProduct) {
|
|
11
|
-
window.dispatchEvent(new CustomEvent('fs-custom-events-product-added'));
|
|
12
|
-
}
|
|
13
|
-
setAddingProduct(false);
|
|
14
|
-
}
|
|
15
|
-
}, [status]);
|
|
16
|
-
const onButtonClick = () => {
|
|
17
|
-
setAddingProduct(true);
|
|
18
|
-
};
|
|
19
|
-
return (React.createElement(ProductOptionsProvider, { data: variantNodes },
|
|
20
|
-
React.createElement(AddToCartButton, { variantId: variantNodes[0].id, quantity: quantity, accessibleAddingToCartLabel: "Adding item to your cart", onClick: onButtonClick, className: 'fs-product-add-to-cart' }, addingProduct ? React.createElement("div", { className: 'fs-adding-product' },
|
|
21
|
-
React.createElement(Spinner, { color: addToCartSettings.color }),
|
|
22
|
-
" Adding...") : React.createElement("div", null, addToCartSettings.text))));
|
|
23
|
-
}
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { AddToCartButton, ProductOptionsProvider } from '@shopify/hydrogen';
|
|
3
|
+
import { useCart } from "@shopify/hydrogen";
|
|
4
|
+
import { Spinner } from "../../../../icons/Spinner";
|
|
5
|
+
export function AddToCartClient({ variantId, quantity = 1, variantNodes, addToCartSettings }) {
|
|
6
|
+
const { status } = useCart();
|
|
7
|
+
const [addingProduct, setAddingProduct] = useState(false);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (status === 'idle') {
|
|
10
|
+
if (addingProduct) {
|
|
11
|
+
window.dispatchEvent(new CustomEvent('fs-custom-events-product-added'));
|
|
12
|
+
}
|
|
13
|
+
setAddingProduct(false);
|
|
14
|
+
}
|
|
15
|
+
}, [status]);
|
|
16
|
+
const onButtonClick = () => {
|
|
17
|
+
setAddingProduct(true);
|
|
18
|
+
};
|
|
19
|
+
return (React.createElement(ProductOptionsProvider, { data: variantNodes },
|
|
20
|
+
React.createElement(AddToCartButton, { variantId: variantNodes[0].id, quantity: quantity, accessibleAddingToCartLabel: "Adding item to your cart", onClick: onButtonClick, className: 'fs-product-add-to-cart' }, addingProduct ? React.createElement("div", { className: 'fs-adding-product' },
|
|
21
|
+
React.createElement(Spinner, { color: addToCartSettings.color }),
|
|
22
|
+
" Adding...") : React.createElement("div", null, addToCartSettings.text))));
|
|
23
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface Props {
|
|
3
|
-
compare: string;
|
|
4
|
-
}
|
|
5
|
-
export declare function Compare({ compare }: Props): React.JSX.Element;
|
|
6
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
compare: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function Compare({ compare }: Props): React.JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export function Compare({ compare }) {
|
|
3
|
-
return (React.createElement("div", { className: "fs-product-card-compare" },
|
|
4
|
-
"$",
|
|
5
|
-
compare));
|
|
6
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export function Compare({ compare }) {
|
|
3
|
+
return (React.createElement("div", { className: "fs-product-card-compare" },
|
|
4
|
+
"$",
|
|
5
|
+
compare));
|
|
6
|
+
}
|