hide filePrice if it's free

This commit is contained in:
Sean Yesmunt 2018-08-06 13:58:33 -04:00
parent 8b90a8421c
commit e1adc71f0a
4 changed files with 9 additions and 4 deletions

View file

@ -100,7 +100,7 @@ class FileCard extends React.PureComponent<Props> {
{pending ? <div>Pending...</div> : <UriIndicator uri={uri} link />}
</div>
<div className="card__file-properties">
{showPrice && <FilePrice uri={uri} />}
{showPrice && <FilePrice hideFree uri={uri} />}
{isRewardContent && <Icon iconColor="red" icon={icons.FEATURED} />}
{fileInfo && <Icon icon={icons.LOCAL} />}
</div>

View file

@ -13,6 +13,7 @@ type Props = {
filePage?: boolean,
inheritStyle?: boolean,
showLBC?: boolean,
hideFree?: boolean, // hide the file price if it's free
};
class FilePrice extends React.PureComponent<Props> {
@ -37,7 +38,11 @@ class FilePrice extends React.PureComponent<Props> {
};
render() {
const { costInfo, showFullPrice, filePage, inheritStyle, showLBC } = this.props;
const { costInfo, showFullPrice, filePage, inheritStyle, showLBC, hideFree } = this.props;
if (costInfo && !costInfo.cost && hideFree) {
return null;
}
return costInfo ? (
<CreditAmount

View file

@ -127,7 +127,7 @@ class FileTile extends React.PureComponent<Props> {
{isRewardContent && <Icon icon={icons.FEATURED} />}
{showLocal && isDownloaded && <Icon icon={icons.LOCAL} />}
</div>
<FilePrice uri={uri} />
<FilePrice hideFree uri={uri} />
{displayDescription && (
<div className="card__subtext card__subtext--small">
<TruncatedText lines={3}>{description}</TruncatedText>

View file

@ -169,7 +169,7 @@
align-items: center;
.icon {
margin: 0 0 0 $spacing-vertical * 1/3;
margin: $spacing-vertical * 1/3 $spacing-vertical * 1/3 0 0;
}
}