@sledge-app/react-instant-search 0.0.100 → 0.0.101
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.
|
@@ -2441,7 +2441,22 @@ const ScrollArea = ({ children, isLoading = false, className = "", withCorner =
|
|
|
2441
2441
|
};
|
|
2442
2442
|
const SkeletonLoading$1 = "";
|
|
2443
2443
|
const SkeletonItem = ({ width, height, rounded, color, style = {}, className = "", ...otherProps }) => {
|
|
2444
|
-
|
|
2444
|
+
const [isLoading, setIsLoading] = React__default.useState(true);
|
|
2445
|
+
const [dataSettings, setDataSettings] = React__default.useState({});
|
|
2446
|
+
const { enable, colors } = (dataSettings == null ? void 0 : dataSettings.skeleton) || {};
|
|
2447
|
+
const { main_color } = colors || {};
|
|
2448
|
+
const handleSettings = () => {
|
|
2449
|
+
let response;
|
|
2450
|
+
response = JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.GENERAL_SETTING) || "");
|
|
2451
|
+
if (!response)
|
|
2452
|
+
return;
|
|
2453
|
+
setIsLoading(false);
|
|
2454
|
+
setDataSettings(response);
|
|
2455
|
+
};
|
|
2456
|
+
React__default.useEffect(() => {
|
|
2457
|
+
handleSettings();
|
|
2458
|
+
}, []);
|
|
2459
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !isLoading && enable ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2445
2460
|
"div",
|
|
2446
2461
|
{
|
|
2447
2462
|
className: `sledge__skeleton-item sledge__skeleton-item-animation ${className}`,
|
|
@@ -2450,16 +2465,16 @@ const SkeletonItem = ({ width, height, rounded, color, style = {}, className = "
|
|
|
2450
2465
|
width,
|
|
2451
2466
|
height
|
|
2452
2467
|
},
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2468
|
+
...main_color && {
|
|
2469
|
+
background: main_color
|
|
2470
|
+
},
|
|
2456
2471
|
...style
|
|
2457
2472
|
},
|
|
2458
2473
|
"data-skeleton-rounded": rounded,
|
|
2459
2474
|
"data-skeleton-color": color,
|
|
2460
2475
|
...otherProps
|
|
2461
2476
|
}
|
|
2462
|
-
);
|
|
2477
|
+
) : null });
|
|
2463
2478
|
};
|
|
2464
2479
|
const SkeletonProductGrid = ({ count, type }) => {
|
|
2465
2480
|
let components = [];
|