Merge pull request #1431 from miikkatu/remove-price-placeholder

Remove price placeholder during thumbnail loading
This commit is contained in:
Sean Yesmunt 2018-05-02 23:55:43 -04:00 committed by GitHub
commit 5519428c68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 15 deletions

View file

@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
### Changed
* Add flair to snackbar ([#1313](https://github.com/lbryio/lbry-app/pull/1313))
* Remove price placeholder during thumbnail loading ([#1431](https://github.com/lbryio/lbry-app/pull/1431))
### Fixed
* Black screen on macOS after maximizing LBRY and then closing ([#1235](https://github.com/lbryio/lbry-app/pull/1235))

View file

@ -16,29 +16,17 @@ class FilePrice extends React.PureComponent<Props> {
showFullPrice: false,
};
componentWillMount() {
this.fetchCost(this.props);
}
componentWillReceiveProps(nextProps: Props) {
this.fetchCost(nextProps);
}
fetchCost = (props: Props) => {
const { costInfo, fetchCostInfo, uri, fetching, claim } = props;
render() {
const { claim, costInfo, fetchCostInfo, fetching, showFullPrice, uri } = this.props;
if (costInfo === undefined && !fetching && claim) {
fetchCostInfo(uri);
}
};
render() {
const { costInfo, showFullPrice } = this.props;
const isEstimate = costInfo ? !costInfo.includesData : false;
if (!costInfo) {
return <span className="credit-amount">PRICE</span>;
return null;
}
return (