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

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