mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
fix(subscription): hide strikethrough free label on device addon price
The per-device price line in the buy-devices modal showed a strikethrough 'Бесплатно' for users with a promo-group discount, because original_price_per_device_kopeks was missing in the API response and formatPrice(0) renders 'Бесплатно'. Now the strikethrough is rendered only when original_price_per_device_kopeks is present and non-zero, mirroring the existing guard on the total price block.
This commit is contained in:
@@ -1576,10 +1576,11 @@ export default function Subscription() {
|
|||||||
<div className="mb-2 text-sm text-dark-400">
|
<div className="mb-2 text-sm text-dark-400">
|
||||||
{/* Show original price with strikethrough if discount */}
|
{/* Show original price with strikethrough if discount */}
|
||||||
{devicePriceData.discount_percent &&
|
{devicePriceData.discount_percent &&
|
||||||
devicePriceData.discount_percent > 0 ? (
|
devicePriceData.discount_percent > 0 &&
|
||||||
|
devicePriceData.original_price_per_device_kopeks ? (
|
||||||
<span>
|
<span>
|
||||||
<span className="text-dark-500 line-through">
|
<span className="text-dark-500 line-through">
|
||||||
{formatPrice(devicePriceData.original_price_per_device_kopeks || 0)}
|
{formatPrice(devicePriceData.original_price_per_device_kopeks)}
|
||||||
</span>
|
</span>
|
||||||
<span className="mx-1">{devicePriceData.price_per_device_label}</span>
|
<span className="mx-1">{devicePriceData.price_per_device_label}</span>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user