Merge pull request #272 from lbryio/file-tile-error

File tile error
This commit is contained in:
Jeremy Kauffman 2017-06-22 12:00:38 -04:00 committed by GitHub
commit f1f0c15548
2 changed files with 37 additions and 30 deletions

View file

@ -7,6 +7,14 @@ import FilePrice from "component/filePrice";
import UriIndicator from "component/uriIndicator"; import UriIndicator from "component/uriIndicator";
class FileCard extends React.PureComponent { class FileCard extends React.PureComponent {
constructor(props) {
super(props);
this.state = {
hovered: false,
};
}
componentWillMount() { componentWillMount() {
this.resolve(this.props); this.resolve(this.props);
} }
@ -89,21 +97,21 @@ class FileCard extends React.PureComponent {
<TruncatedText lines={2}>{description}</TruncatedText> <TruncatedText lines={2}>{description}</TruncatedText>
</div> </div>
</Link> </Link>
{obscureNsfw && this.state.hovered {obscureNsfw &&
? <div className="card-overlay"> this.state.hovered &&
<p> <div className="card-overlay">
{__( <p>
"This content is Not Safe For Work. To view adult content, please change your" {__(
)} "This content is Not Safe For Work. To view adult content, please change your"
{" "} )}
<Link {" "}
className="button-text" <Link
onClick={() => navigate("settings")} className="button-text"
label={__("Settings")} onClick={() => navigate("settings")}
/>. label={__("Settings")}
</p> />.
</div> </p>
: null} </div>}
</div> </div>
</section> </section>
); );

View file

@ -124,21 +124,20 @@ class FileTile extends React.PureComponent {
</div> </div>
</div> </div>
</Link> </Link>
{this.state.showNsfwHelp {this.state.showNsfwHelp &&
? <div className="card-overlay"> <div className="card-overlay">
<p> <p>
{__( {__(
"This content is Not Safe For Work. To view adult content, please change your" "This content is Not Safe For Work. To view adult content, please change your"
)} )}
{" "} {" "}
<Link <Link
className="button-text" className="button-text"
onClick={() => navigate("/settings")} onClick={() => navigate("/settings")}
label={__("Settings")} label={__("Settings")}
/>. />.
</p> </p>
</div> </div>}
: null}
</section> </section>
); );
} }