@lmnto/h-mall-shared 1.0.23 → 1.0.24
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
|
@@ -23,6 +23,8 @@ export default function HomeBanners({
|
|
|
23
23
|
onCategoryChange,
|
|
24
24
|
}) {
|
|
25
25
|
const { featureFlags } = useMainContext();
|
|
26
|
+
const isMembershipFeatureEnabled =
|
|
27
|
+
featureFlags?.[FeatureCodes.ENABLE_MEMBERSHIP_FEATURE]?.isActive;
|
|
26
28
|
|
|
27
29
|
const renderNote = () => {
|
|
28
30
|
return (
|
|
@@ -291,6 +293,7 @@ export default function HomeBanners({
|
|
|
291
293
|
onCategoryChange(CATEGORY_FOR_SUBSCRIPTION);
|
|
292
294
|
}}
|
|
293
295
|
isSubscriptionActive={isSubscriptionActive}
|
|
296
|
+
isMembershipFeatureEnabled={isMembershipFeatureEnabled}
|
|
294
297
|
/>
|
|
295
298
|
</Carousel>
|
|
296
299
|
</div>
|
|
@@ -8,18 +8,20 @@ import { useMemo } from "react";
|
|
|
8
8
|
|
|
9
9
|
export type SubscriptionBannerProps = {
|
|
10
10
|
isSubscriptionActive: boolean;
|
|
11
|
+
isMembershipFeatureEnabled?: boolean;
|
|
11
12
|
callback: () => void;
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
export default function SubscriptionBanner({
|
|
15
16
|
isSubscriptionActive,
|
|
17
|
+
isMembershipFeatureEnabled = true,
|
|
16
18
|
callback,
|
|
17
19
|
}: SubscriptionBannerProps) {
|
|
18
20
|
const scopeT = _useScopedI18n("products.subscriptionBanner");
|
|
19
21
|
const { user } = useUserStore();
|
|
20
22
|
|
|
21
23
|
const renderBanner = useMemo(() => {
|
|
22
|
-
if (isSubscriptionActive)
|
|
24
|
+
if (isSubscriptionActive) {
|
|
23
25
|
return (
|
|
24
26
|
<div className="justify-between rounded-xl h-[200px] sm:h-[150px] p-[5%] lg:p-[2%] subscriptionBanner">
|
|
25
27
|
<div className="w-full md:w-5/6 lg:w-3/4 xl:w-2/3">
|
|
@@ -39,6 +41,30 @@ export default function SubscriptionBanner({
|
|
|
39
41
|
</div>
|
|
40
42
|
</div>
|
|
41
43
|
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (!isMembershipFeatureEnabled) {
|
|
47
|
+
return (
|
|
48
|
+
<div className="justify-between rounded-xl h-[200px] sm:h-[150px] p-[5%] lg:p-[2%] subscriptionBanner">
|
|
49
|
+
<div className="w-full md:w-5/6 lg:w-3/4 xl:w-2/3">
|
|
50
|
+
<Typography
|
|
51
|
+
variant="h6"
|
|
52
|
+
className="font-medium text-sm text-black-500 mb-1"
|
|
53
|
+
>
|
|
54
|
+
{scopeT("welcome")}
|
|
55
|
+
</Typography>
|
|
56
|
+
|
|
57
|
+
<Typography
|
|
58
|
+
variant="h3"
|
|
59
|
+
className="font-semibold text-sm md:text-base text-black-500"
|
|
60
|
+
>
|
|
61
|
+
{scopeT("membershipFeatureUnavailableWelcome")}
|
|
62
|
+
</Typography>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
42
68
|
return (
|
|
43
69
|
<div className="justify-between rounded-xl h-[200px] p-[5%] lg:p-[2%] subscriptionBannerBuy">
|
|
44
70
|
<div className="w-full md:w-5/6 lg:w-3/4 xl:w-2/3">
|
|
@@ -57,14 +83,12 @@ export default function SubscriptionBanner({
|
|
|
57
83
|
{scopeT("subscriptionActivationPending")}
|
|
58
84
|
</Typography>
|
|
59
85
|
) : (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
</Typography>
|
|
67
|
-
</>
|
|
86
|
+
<Typography
|
|
87
|
+
variant="h2"
|
|
88
|
+
className="font-semibold text-sm md:text-base text-black-500"
|
|
89
|
+
>
|
|
90
|
+
{scopeT("inactiveSubscription")} 🚀
|
|
91
|
+
</Typography>
|
|
68
92
|
)}
|
|
69
93
|
<ButtonCustom
|
|
70
94
|
onClick={callback}
|
|
@@ -77,7 +101,13 @@ export default function SubscriptionBanner({
|
|
|
77
101
|
</div>
|
|
78
102
|
</div>
|
|
79
103
|
);
|
|
80
|
-
}, [
|
|
104
|
+
}, [
|
|
105
|
+
isSubscriptionActive,
|
|
106
|
+
isMembershipFeatureEnabled,
|
|
107
|
+
callback,
|
|
108
|
+
scopeT,
|
|
109
|
+
user,
|
|
110
|
+
]);
|
|
81
111
|
|
|
82
112
|
return <>{renderBanner}</>;
|
|
83
113
|
}
|
|
@@ -59,6 +59,8 @@ export default {
|
|
|
59
59
|
buySubscriptionBtn: "Buy Subscription",
|
|
60
60
|
subscriptionActivationPending:
|
|
61
61
|
"Subscription activation still in progress. Please check back later or contact support.",
|
|
62
|
+
membershipFeatureUnavailableWelcome:
|
|
63
|
+
"Welcome to H Mall! Explore our products and discover what we have to offer.",
|
|
62
64
|
},
|
|
63
65
|
quantityComponent: {
|
|
64
66
|
quantity: "Quantity",
|
|
@@ -56,6 +56,10 @@ export default {
|
|
|
56
56
|
inactiveSubscription:
|
|
57
57
|
"Sblocca vantaggi esclusivi rinnovando il tuo abbonamento oggi",
|
|
58
58
|
buySubscriptionBtn: "Acquista abbonamento",
|
|
59
|
+
subscriptionActivationPending:
|
|
60
|
+
"Attivazione dell'abbonamento ancora in corso. Riprova più tardi o contatta l'assistenza.",
|
|
61
|
+
membershipFeatureUnavailableWelcome:
|
|
62
|
+
"Benvenuto su H Mall! Esplora i nostri prodotti e scopri cosa abbiamo da offrire.",
|
|
59
63
|
},
|
|
60
64
|
quantityComponent: {
|
|
61
65
|
quantity: "Quantità",
|