mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-28 16:01:26 +00:00
Make cost prop optional in <SearchResultRow />
This commit is contained in:
parent
a98c410403
commit
97496c33da
1 changed files with 8 additions and 5 deletions
|
@ -122,9 +122,11 @@ var SearchResultRow = React.createClass({
|
||||||
<a href={'/?show=' + this.props.name}><Thumbnail src={this.props.imgUrl} alt={'Photo for ' + (this.props.title || this.props.name)} style={searchRowImgStyle} /></a>
|
<a href={'/?show=' + this.props.name}><Thumbnail src={this.props.imgUrl} alt={'Photo for ' + (this.props.title || this.props.name)} style={searchRowImgStyle} /></a>
|
||||||
</div>
|
</div>
|
||||||
<div className="span9">
|
<div className="span9">
|
||||||
<span style={searchRowCostStyle}>
|
{'cost' in this.props
|
||||||
<CreditAmount amount={this.props.cost} isEstimate={!this.props.available}/>
|
? <span style={searchRowCostStyle}>
|
||||||
</span>
|
<CreditAmount amount={this.props.cost} isEstimate={!this.props.available}/>
|
||||||
|
</span>
|
||||||
|
: null}
|
||||||
<div className="meta"><a href={'/?show=' + this.props.name}>lbry://{this.props.name}</a></div>
|
<div className="meta"><a href={'/?show=' + this.props.name}>lbry://{this.props.name}</a></div>
|
||||||
<h3 style={titleStyle}>
|
<h3 style={titleStyle}>
|
||||||
<a href={'/?show=' + this.props.name}>
|
<a href={'/?show=' + this.props.name}>
|
||||||
|
@ -173,7 +175,7 @@ var FeaturedContentItem = React.createClass({
|
||||||
return {
|
return {
|
||||||
metadata: null,
|
metadata: null,
|
||||||
title: null,
|
title: null,
|
||||||
amount: 0.0,
|
cost: null,
|
||||||
overlayShowing: false,
|
overlayShowing: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -206,10 +208,11 @@ var FeaturedContentItem = React.createClass({
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const costProp = this.state.cost === null ? {} : {cost: this.state.cost}
|
||||||
return (<div style={featuredContentItemContainerStyle}>
|
return (<div style={featuredContentItemContainerStyle}>
|
||||||
<SearchResultRow name={this.props.name} title={this.state.title} imgUrl={this.state.metadata.thumbnail}
|
<SearchResultRow name={this.props.name} title={this.state.title} imgUrl={this.state.metadata.thumbnail}
|
||||||
description={this.state.metadata.description} mediaType={lbry.getMediaType(this.state.metadata.content_type)}
|
description={this.state.metadata.description} mediaType={lbry.getMediaType(this.state.metadata.content_type)}
|
||||||
cost={this.state.amount} nsfw={this.state.metadata.nsfw} available={this.state.available} compact />
|
nsfw={this.state.metadata.nsfw} compact {... costProp} />
|
||||||
</div>);
|
</div>);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue