diff --git a/CHANGELOG.md b/CHANGELOG.md index cfe5963..15dc0b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## Added + +- Show TBA in case of undefined or null price. + ## [0.1.0] - 2019-08-28 ## Added diff --git a/messages/context.json b/messages/context.json index 3c63954..b31e4ac 100644 --- a/messages/context.json +++ b/messages/context.json @@ -1,3 +1,4 @@ { - "store/price.Free": "FREE" + "store/price.Free": "FREE", + "store/price.TBA": "TBA" } diff --git a/messages/en.json b/messages/en.json index 3c63954..b31e4ac 100644 --- a/messages/en.json +++ b/messages/en.json @@ -1,3 +1,4 @@ { - "store/price.Free": "FREE" + "store/price.Free": "FREE", + "store/price.TBA": "TBA" } diff --git a/messages/es.json b/messages/es.json index de7e389..1f41c72 100644 --- a/messages/es.json +++ b/messages/es.json @@ -1,3 +1,4 @@ { - "store/price.Free": "GRATIS" + "store/price.Free": "GRATIS", + "store/price.TBA": "TBA" } diff --git a/messages/pt.json b/messages/pt.json index 2990376..a9ba287 100644 --- a/messages/pt.json +++ b/messages/pt.json @@ -1,3 +1,4 @@ { - "store/price.Free": "GRÁTIS" + "store/price.Free": "GRÁTIS", + "store/price.TBA": "TBA" } diff --git a/react/FormattedPrice.tsx b/react/FormattedPrice.tsx index 7d76bc3..0d23d34 100644 --- a/react/FormattedPrice.tsx +++ b/react/FormattedPrice.tsx @@ -1,19 +1,7 @@ import React, { FC, Fragment } from 'react' -import { - defineMessages, - injectIntl, - InjectedIntlProps, - FormattedMessage, -} from 'react-intl' +import { injectIntl, InjectedIntlProps, FormattedMessage } from 'react-intl' import { FormattedCurrency } from 'vtex.format-currency' -defineMessages({ - Free: { - id: 'store/price.Free', - defaultMessage: 'FREE', - }, -}) - const FormattedPrice: FC = ({ value, }) => { @@ -21,6 +9,8 @@ const FormattedPrice: FC = ({ {value === 0 ? ( + ) : value === null || value === undefined ? ( + ) : ( )}