diff --git a/ui/js/component/fileCard/view.jsx b/ui/js/component/fileCard/view.jsx index bf0901035..41e1b40a9 100644 --- a/ui/js/component/fileCard/view.jsx +++ b/ui/js/component/fileCard/view.jsx @@ -7,6 +7,14 @@ import FilePrice from "component/filePrice"; import UriIndicator from "component/uriIndicator"; class FileCard extends React.PureComponent { + constructor(props) { + super(props); + + this.state = { + hovered: false, + }; + } + componentWillMount() { this.resolve(this.props); } @@ -89,21 +97,21 @@ class FileCard extends React.PureComponent { {description} - {obscureNsfw && this.state.hovered - ?
-

- {__( - "This content is Not Safe For Work. To view adult content, please change your" - )} - {" "} - navigate("settings")} - label={__("Settings")} - />. -

-
- : null} + {obscureNsfw && + this.state.hovered && +
+

+ {__( + "This content is Not Safe For Work. To view adult content, please change your" + )} + {" "} + navigate("settings")} + label={__("Settings")} + />. +

+
} ); diff --git a/ui/js/component/fileTile/view.jsx b/ui/js/component/fileTile/view.jsx index d19ce0137..09a4363ad 100644 --- a/ui/js/component/fileTile/view.jsx +++ b/ui/js/component/fileTile/view.jsx @@ -124,21 +124,20 @@ class FileTile extends React.PureComponent { - {this.state.showNsfwHelp - ?
-

- {__( - "This content is Not Safe For Work. To view adult content, please change your" - )} - {" "} - navigate("/settings")} - label={__("Settings")} - />. -

-
- : null} + {this.state.showNsfwHelp && +
+

+ {__( + "This content is Not Safe For Work. To view adult content, please change your" + )} + {" "} + navigate("/settings")} + label={__("Settings")} + />. +

+
} ); }