do not display "PRICE"; return null when costInfo is undefined

This commit is contained in:
Travis Eden 2018-05-25 12:16:17 -04:00
parent ea4c7d9d15
commit 9e6270ad0e

View file

@ -35,20 +35,14 @@ class FilePrice extends React.PureComponent<Props> {
render() {
const { costInfo, showFullPrice } = this.props;
const isEstimate = costInfo ? !costInfo.includesData : false;
if (!costInfo) {
return <span className="credit-amount">PRICE</span>;
}
return (
return costInfo ? (
<CreditAmount
amount={costInfo.cost}
isEstimate={isEstimate}
isEstimate={!costInfo.includesData}
showFree
showFullPrice={showFullPrice}
/>
);
) : null;
}
}