diff --git a/src/renderer/component/fileCard/index.js b/src/renderer/component/fileCard/index.js index d210993d4..74017f40e 100644 --- a/src/renderer/component/fileCard/index.js +++ b/src/renderer/component/fileCard/index.js @@ -12,6 +12,7 @@ import { selectRewardContentClaimIds, makeSelectContentPositionForUri, } from 'redux/selectors/content'; +import { doClearContentHistoryUri } from 'redux/actions/content'; import { selectShowNsfw } from 'redux/selectors/settings'; import { selectPendingPublish } from 'redux/selectors/publish'; import FileCard from './view'; @@ -42,6 +43,7 @@ const select = (state, props) => { const perform = dispatch => ({ navigate: (path, params) => dispatch(doNavigate(path, params)), resolveUri: uri => dispatch(doResolveUri(uri)), + clearHistoryUri: uri => dispatch(doClearContentHistoryUri(uri)), }); export default connect( diff --git a/src/renderer/component/fileCard/view.jsx b/src/renderer/component/fileCard/view.jsx index 7d235d19f..16f2c3127 100644 --- a/src/renderer/component/fileCard/view.jsx +++ b/src/renderer/component/fileCard/view.jsx @@ -6,7 +6,6 @@ import type { Claim, Metadata } from 'types/claim'; import CardMedia from 'component/cardMedia'; import TruncatedText from 'component/common/truncated-text'; import Icon from 'component/common/icon'; -import FilePrice from 'component/filePrice'; import UriIndicator from 'component/uriIndicator'; import * as icons from 'constants/icons'; import classnames from 'classnames'; @@ -22,10 +21,10 @@ type Props = { rewardedContentClaimIds: Array, obscureNsfw: boolean, claimIsMine: boolean, - showPrice: boolean, pending?: boolean, position: ?number, lastViewed: ?number, + clearHistoryUri: string => void, /* eslint-disable react/no-unused-prop-types */ resolveUri: string => void, isResolvingUri: boolean, @@ -62,10 +61,10 @@ class FileCard extends React.PureComponent { rewardedContentClaimIds, obscureNsfw, claimIsMine, - showPrice, pending, position, lastViewed, + clearHistoryUri, } = this.props; const shouldHide = !claimIsMine && !pending && obscureNsfw && metadata && metadata.nsfw; @@ -111,7 +110,18 @@ class FileCard extends React.PureComponent { {position && } {lastViewed && ( -
{moment(lastViewed).from(moment())}
+
+ {moment(lastViewed).from(moment())} + {position && } + { + e.stopPropagation(); + clearHistoryUri(uri); + }} + > + + +
)}