loyalty: enhance card texts

This commit is contained in:
2026-01-14 00:09:49 +03:00
parent eb6ca34162
commit 2c7a8d369a
3 changed files with 28 additions and 26 deletions

View File

@@ -166,7 +166,9 @@
"address": "العنوان", "address": "العنوان",
"openingTimes": "ساعات العمل", "openingTimes": "ساعات العمل",
"customizable": "قابل للتخصيص", "customizable": "قابل للتخصيص",
"youHaveXEarnedRewardsReadyToRedeem": "🎉 لديك {{rewards}} مكافأة مستحقة للاستخدام!" "youHaveXEarnedRewardsReadyToRedeem": "🎉 لديك {{rewards}} مكافأة مستحقة للاستخدام!",
"justXMorePurchasesToUnlockYourFREEItem": "فقط {{cups}} أكثر للفتح الوجبة المجانية!",
"youreJustXCupsAwayFromYourNextReward": "🎉 أنت فقط {{cups}} أكثر للحصول على المكافأة التالية!"
}, },
"cart": { "cart": {
"addSpecialRequestOptional": "إضافة طلب خاص (اختياري)", "addSpecialRequestOptional": "إضافة طلب خاص (اختياري)",

View File

@@ -178,7 +178,9 @@
"address": "Address", "address": "Address",
"openingTimes": "Opening Times", "openingTimes": "Opening Times",
"customizable": "Customizable", "customizable": "Customizable",
"youHaveXEarnedRewardsReadyToRedeem": "🎉 You have {{rewards}} rewards ready to redeem!" "youHaveXEarnedRewardsReadyToRedeem": "🎉 You have {{rewards}} rewards ready to redeem!",
"justXMorePurchasesToUnlockYourFREEItem": "Just {{cups}} more purchases to unlock your FREE item!",
"youreJustXCupsAwayFromYourNextReward": "🎉 You're just {{cups}} cups away from your next reward!"
}, },
"cart": { "cart": {
"remainingToPay": "Remaining to Pay", "remainingToPay": "Remaining to Pay",

View File

@@ -115,27 +115,25 @@ const LoyaltyCard = () => {
paddingBottom: 12, paddingBottom: 12,
}} }}
> >
{Array.from({ length: loyaltyStamps }).map( {Array.from({ length: loyaltyStamps }).map((_, index) => {
(_, index) => { const currentPoints = customerLoyaltyPoints % loyaltyStamps;
const currentPoints = customerLoyaltyPoints % loyaltyStamps; const isCollected = index < currentPoints;
const isCollected = index < currentPoints; return (
return ( <Col key={index}>
<Col key={index}> <Image
<Image key={index}
key={index} className={styles.presentIconItem}
className={styles.presentIconItem} preview={false}
preview={false} width={40}
width={40} height={40}
height={40} src={restaurant?.loyalty_stamp_image}
src={restaurant?.loyalty_stamp_image} style={{
style={{ opacity: isCollected ? 1 : 0.4,
opacity: isCollected ? 1 : 0.4, }}
}} />
/> </Col>
</Col> );
); })}
},
)}
</div> </div>
<ProText <ProText
strong strong
@@ -150,11 +148,11 @@ const LoyaltyCard = () => {
}} }}
> >
{customerLoyaltyPoints < loyaltyStamps && {customerLoyaltyPoints < loyaltyStamps &&
t("rewardsAndLoyalty.youreJustXCupsAwayFromYourNextReward", { t("menu.justXMorePurchasesToUnlockYourFREEItem", {
cups: remainingToNextReward, cups: remainingToNextReward,
})} })}
{customerLoyaltyPoints >= loyaltyStamps && {customerLoyaltyPoints >= loyaltyStamps &&
t("rewardsAndLoyalty.youreJustXCupsAwayFromYourNextReward", { t("menu.youreJustXCupsAwayFromYourNextReward", {
cups: remainingToNextReward, cups: remainingToNextReward,
})} })}
</ProText> </ProText>