diff --git a/src/components/Price.jsx b/src/components/Price.tsx similarity index 70% rename from src/components/Price.jsx rename to src/components/Price.tsx index 2832c2591..9c01a6b2a 100644 --- a/src/components/Price.jsx +++ b/src/components/Price.tsx @@ -1,9 +1,12 @@ -import PropTypes from 'prop-types'; import {FormattedMessage, FormattedNumber} from 'react-intl'; import {getBEMClassName} from 'utils'; -const Price = ({price = ''}) => { +export interface PriceProps { + price?: string | number; // the API serializes decimals to strings to not lose precision +} + +const Price: React.FC = ({price = '0'}) => { return (
@@ -11,7 +14,7 @@ const Price = ({price = ''}) => {
{ ); }; -Price.propTypes = { - price: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), -}; - export default Price;