From 83e9e61053e86b72794b445039a58acc24338d76 Mon Sep 17 00:00:00 2001 From: Haris Spahija Date: Thu, 21 Nov 2019 13:34:08 +0100 Subject: [PATCH] feat: added text overrides on MiniCartSummary Signed-off-by: Haris Spahija --- .../MiniCartSummary/v1/MiniCartSummary.js | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/package/src/components/MiniCartSummary/v1/MiniCartSummary.js b/package/src/components/MiniCartSummary/v1/MiniCartSummary.js index e854b0d5b..b48d5fb2c 100644 --- a/package/src/components/MiniCartSummary/v1/MiniCartSummary.js +++ b/package/src/components/MiniCartSummary/v1/MiniCartSummary.js @@ -44,29 +44,42 @@ class MiniCartSummary extends Component { /** * The computed taxes for items in the cart. */ - displayTax: PropTypes.string + displayTax: PropTypes.string, + /** + * The text for the "Tax" label text. + */ + taxLabelText: PropTypes.string, + /** + * The text for the "Subtotal" label text. + */ + subtotalLabelText: PropTypes.string, }; + static defaultProps = { + taxLabelText: "Tax", + subtotalLabelText: "Subtotal", + } + renderTax = () => { - const { displayTax } = this.props; + const { displayTax, taxLabelText } = this.props; return ( - Tax + {taxLabelText} {displayTax} ); }; render() { - const { className, displaySubtotal, displayTax } = this.props; + const { className, displaySubtotal, displayTax, subtotalLabelText } = this.props; const taxes = displayTax && this.renderTax(); return ( - + {displaySubtotal} {taxes}
Subtotal{subtotalLabelText}