From 0f8e20c21496fdc9293724e3ce2e7731586245ef Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 25 Aug 2020 14:55:17 -0300 Subject: [PATCH 1/2] Fix price not shown as free label when it is zero --- CHANGELOG.md | 2 ++ react/Price.tsx | 2 +- react/tsconfig.json | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f62643e..2bd14651 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Price not shown as "free" label when it is zero. ## [0.21.0] - 2020-07-29 ### Added diff --git a/react/Price.tsx b/react/Price.tsx index 477fe4b0..fb2ee1c9 100644 --- a/react/Price.tsx +++ b/react/Price.tsx @@ -53,7 +53,7 @@ const Price: StorefrontFunctionComponent = ({ id={`price-${item.id}`} className={`${handles.productPrice} div fw6 fw5-m`} > - {item.sellingPrice && ( + {item.sellingPrice != null && ( )} diff --git a/react/tsconfig.json b/react/tsconfig.json index 161872d3..51f909e8 100644 --- a/react/tsconfig.json +++ b/react/tsconfig.json @@ -13,8 +13,8 @@ "noImplicitAny": true, "noImplicitReturns": true, "noImplicitThis": true, - "noUnusedLocals": true, - "noUnusedParameters": true, + "noUnusedLocals": false, + "noUnusedParameters": false, "skipLibCheck": true, "sourceMap": true, "strictFunctionTypes": true, From 5631db842c0f1b05d8f04ef6f8e11d2851d528fb Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Wed, 26 Aug 2020 14:36:15 -0300 Subject: [PATCH 2/2] Unconditionally render formatted price --- react/Price.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/react/Price.tsx b/react/Price.tsx index fb2ee1c9..ac3f0738 100644 --- a/react/Price.tsx +++ b/react/Price.tsx @@ -53,9 +53,13 @@ const Price: StorefrontFunctionComponent = ({ id={`price-${item.id}`} className={`${handles.productPrice} div fw6 fw5-m`} > - {item.sellingPrice != null && ( - - )} + )