@lmnto/h-mall-shared 1.0.19 → 1.0.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lmnto/h-mall-shared",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "scripts": {
@@ -10,7 +10,9 @@ import {
10
10
  DEFAULT_CURRENCY,
11
11
  QUANTITY_ACTIONS,
12
12
  } from "../constants/app";
13
+ import { FeatureCodes } from "../constants/feature-flags";
13
14
  import { ROUTES } from "../constants/routes";
15
+ import { useMainContext } from "../contexts/MainWrapperContext";
14
16
  import { useCart } from "../hooks/useCart";
15
17
  import useCustomRouter from "../hooks/useCustomRouter";
16
18
  import { useGlobalDebounce } from "../hooks/useDebounce";
@@ -38,6 +40,9 @@ export default function CartDrawerComponent({
38
40
  }: CartDrawerComponentProps) {
39
41
  //
40
42
  const scopeT = _useScopedI18n("sharedComponents.cartDrawerComponent");
43
+ const { featureFlags } = useMainContext();
44
+ const isMembershipFeatureEnabled =
45
+ featureFlags?.[FeatureCodes.ENABLE_MEMBERSHIP_FEATURE]?.isActive;
41
46
 
42
47
  const pathname = usePathname();
43
48
  const { addToCart, removeProductFromCart, updateCartState } = useCart();
@@ -151,7 +156,7 @@ export default function CartDrawerComponent({
151
156
  {scopeT("category")}:{" "}
152
157
  {replaceForbiddenKeyword(cartProduct.product.category.name)}
153
158
  </Typography>
154
- {cartProduct.isAutoAdded && (
159
+ {isMembershipFeatureEnabled && cartProduct.isAutoAdded && (
155
160
  <Typography
156
161
  variant="small"
157
162
  className="text-xs font-medium text-orange-500"
@@ -13,4 +13,5 @@ export const FeatureCodes = {
13
13
  ORDER_V2_API: "order-v2-api",
14
14
  ENABLE_GEN_3_ORDER_INVOICE: "enable-gen-3-order-invoices",
15
15
  ENABLE_EXTENSION_FLOW: "enable-extension-flow",
16
+ ENABLE_MEMBERSHIP_FEATURE: "enable-membership-feature",
16
17
  };