do not display "PRICE"; return null when costInfo is undefined
This commit is contained in:
parent
ea4c7d9d15
commit
9e6270ad0e
1 changed files with 3 additions and 9 deletions
|
@ -35,20 +35,14 @@ class FilePrice extends React.PureComponent<Props> {
|
||||||
render() {
|
render() {
|
||||||
const { costInfo, showFullPrice } = this.props;
|
const { costInfo, showFullPrice } = this.props;
|
||||||
|
|
||||||
const isEstimate = costInfo ? !costInfo.includesData : false;
|
return costInfo ? (
|
||||||
|
|
||||||
if (!costInfo) {
|
|
||||||
return <span className="credit-amount">PRICE</span>;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CreditAmount
|
<CreditAmount
|
||||||
amount={costInfo.cost}
|
amount={costInfo.cost}
|
||||||
isEstimate={isEstimate}
|
isEstimate={!costInfo.includesData}
|
||||||
showFree
|
showFree
|
||||||
showFullPrice={showFullPrice}
|
showFullPrice={showFullPrice}
|
||||||
/>
|
/>
|
||||||
);
|
) : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue