@lmnto/h-mall-shared 1.0.18 → 1.0.20

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.18",
3
+ "version": "1.0.20",
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"
@@ -7,6 +7,7 @@ import gen3BannerImage from "../../public/img/gen3-image.png";
7
7
  import smartPayChoseIcon from "../../public/img/smart-pay-chose.png";
8
8
  import smartPayEasyIcon from "../../public/img/smart-pay-easy.png";
9
9
  import smartPayPaymentIcon from "../../public/img/smart-pay-payment.png";
10
+ import { CATEGORY_FOR_SUBSCRIPTION } from "../constants/app";
10
11
  import { FeatureCodes } from "../constants/feature-flags";
11
12
  import { useMainContext } from "../contexts/MainWrapperContext";
12
13
  import CustomNextImage from "./CustomNextImage";
@@ -285,12 +286,14 @@ export default function HomeBanners({
285
286
  </div>
286
287
  )}
287
288
 
288
- <SubscriptionBanner
289
- callback={() => {
290
- onCategoryChange("license");
291
- }}
292
- isSubscriptionActive={isSubscriptionActive}
293
- />
289
+ {featureFlags?.[FeatureCodes.ENABLE_MEMBERSHIP_FEATURE]?.isActive && (
290
+ <SubscriptionBanner
291
+ callback={() => {
292
+ onCategoryChange(CATEGORY_FOR_SUBSCRIPTION);
293
+ }}
294
+ isSubscriptionActive={isSubscriptionActive}
295
+ />
296
+ )}
294
297
  </Carousel>
295
298
  </div>
296
299
  );
@@ -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
  };