@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
|
@@ -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
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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
|
);
|