@sledge-app/react-instant-search 0.0.103 → 0.0.105

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.
@@ -886,7 +886,7 @@ const BadgeRoot = (props) => {
886
886
  React__default.useEffect(() => {
887
887
  if (!isRenderAppWishlist)
888
888
  return;
889
- handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING) || "");
889
+ handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING) || null);
890
890
  }, [isRenderAppWishlist, triggerRenderMultipleComponent]);
891
891
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: React__default.Children.count(children) && React__default.Children.map(
892
892
  children,
@@ -1116,7 +1116,7 @@ const Trigger = (props) => {
1116
1116
  handleCheckWishlist();
1117
1117
  };
1118
1118
  }
1119
- handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING) || "");
1119
+ handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING) || null);
1120
1120
  }, [isRenderAppWishlist]);
1121
1121
  React__default.useEffect(() => {
1122
1122
  setIsRequiredLogin(sledgeAnonymId && is_required_login);
@@ -1645,7 +1645,7 @@ const Rating = (props) => {
1645
1645
  let isProductIdChanged = Boolean(previousState && (previousState == null ? void 0 : previousState.productId) !== productId);
1646
1646
  if (isProductIdChanged)
1647
1647
  setIsFirstLoading(true);
1648
- handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING) || "");
1648
+ handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING) || null);
1649
1649
  }, [isRenderAppProductReview, productId]);
1650
1650
  React__default.useEffect(() => {
1651
1651
  var _a2, _b2, _c, _d;
@@ -2413,22 +2413,19 @@ const ScrollArea = ({ children, isLoading = false, className = "", withCorner =
2413
2413
  };
2414
2414
  const SkeletonLoading$1 = "";
2415
2415
  const SkeletonItem = ({ width, height, rounded, color, style = {}, className = "", ...otherProps }) => {
2416
- const [isLoading, setIsLoading] = React__default.useState(true);
2416
+ var _a, _b, _c, _d, _e;
2417
2417
  const [dataSettings, setDataSettings] = React__default.useState({});
2418
- const { enable, colors } = (dataSettings == null ? void 0 : dataSettings.skeleton) || {};
2419
- const { main_color } = colors || {};
2420
- const handleSettings = () => {
2418
+ const handleSettings = async (LOCAL_STORAGE_GENERAL_SETTING) => {
2421
2419
  let response;
2422
- response = JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.GENERAL_SETTING) || "");
2420
+ response = JSON.parse(LOCAL_STORAGE_GENERAL_SETTING);
2423
2421
  if (!response)
2424
2422
  return;
2425
- setIsLoading(false);
2426
2423
  setDataSettings(response);
2427
2424
  };
2428
2425
  React__default.useEffect(() => {
2429
- handleSettings();
2426
+ handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.GENERAL_SETTING) || null);
2430
2427
  }, []);
2431
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !isLoading && enable ? /* @__PURE__ */ jsxRuntimeExports.jsx(
2428
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: ((_a = dataSettings == null ? void 0 : dataSettings.skeleton) == null ? void 0 : _a.enable) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
2432
2429
  "div",
2433
2430
  {
2434
2431
  className: `sledge__skeleton-item sledge__skeleton-item-animation ${className}`,
@@ -2437,8 +2434,8 @@ const SkeletonItem = ({ width, height, rounded, color, style = {}, className = "
2437
2434
  width,
2438
2435
  height
2439
2436
  },
2440
- ...main_color && {
2441
- background: main_color
2437
+ ...((_c = (_b = dataSettings == null ? void 0 : dataSettings.skeleton) == null ? void 0 : _b.colors) == null ? void 0 : _c.main_color) && {
2438
+ background: (_e = (_d = dataSettings == null ? void 0 : dataSettings.skeleton) == null ? void 0 : _d.colors) == null ? void 0 : _e.main_color
2442
2439
  },
2443
2440
  ...style
2444
2441
  },
@@ -2914,7 +2911,7 @@ const SearchIconWidgetPopup = () => {
2914
2911
  });
2915
2912
  };
2916
2913
  }
2917
- handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING) || "");
2914
+ handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING) || null);
2918
2915
  }, [isRenderAppInstantSearch]);
2919
2916
  React__default.useEffect(() => {
2920
2917
  showInfo ? document.body.classList.add("sledge__open-popup-state") : document.body.classList.remove("sledge__open-popup-state");
@@ -3268,7 +3265,7 @@ const SearchResultWidget = (props) => {
3268
3265
  return;
3269
3266
  const searchParams2 = new URLSearchParams(document.location.search);
3270
3267
  setKeyword((searchParams2 == null ? void 0 : searchParams2.get(queryKeyword)) || "");
3271
- handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING) || "");
3268
+ handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING) || null);
3272
3269
  }, [isRenderAppInstantSearch]);
3273
3270
  React__default.useEffect(() => {
3274
3271
  if (Boolean(previousState && (previousState == null ? void 0 : previousState.keyword) !== keyword) && layoutType === "default") {
@@ -4494,7 +4491,7 @@ const SearchWidget = (props) => {
4494
4491
  React__default.useEffect(() => {
4495
4492
  if (!isRenderAppInstantSearch)
4496
4493
  return;
4497
- handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING) || "");
4494
+ handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING) || null);
4498
4495
  }, [keyword]);
4499
4496
  React__default.useEffect(() => {
4500
4497
  if (Boolean(previousState && (previousState == null ? void 0 : previousState.keyword) !== keyword)) {