mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-31 17:31:27 +00:00
add delete icons to <FileCard>
This commit is contained in:
parent
245f5929c8
commit
00c488799f
2 changed files with 16 additions and 4 deletions
|
@ -12,6 +12,7 @@ import {
|
||||||
selectRewardContentClaimIds,
|
selectRewardContentClaimIds,
|
||||||
makeSelectContentPositionForUri,
|
makeSelectContentPositionForUri,
|
||||||
} from 'redux/selectors/content';
|
} from 'redux/selectors/content';
|
||||||
|
import { doClearContentHistoryUri } from 'redux/actions/content';
|
||||||
import { selectShowNsfw } from 'redux/selectors/settings';
|
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||||
import { selectPendingPublish } from 'redux/selectors/publish';
|
import { selectPendingPublish } from 'redux/selectors/publish';
|
||||||
import FileCard from './view';
|
import FileCard from './view';
|
||||||
|
@ -42,6 +43,7 @@ const select = (state, props) => {
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
navigate: (path, params) => dispatch(doNavigate(path, params)),
|
navigate: (path, params) => dispatch(doNavigate(path, params)),
|
||||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||||
|
clearHistoryUri: uri => dispatch(doClearContentHistoryUri(uri)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
|
|
|
@ -6,7 +6,6 @@ import type { Claim, Metadata } from 'types/claim';
|
||||||
import CardMedia from 'component/cardMedia';
|
import CardMedia from 'component/cardMedia';
|
||||||
import TruncatedText from 'component/common/truncated-text';
|
import TruncatedText from 'component/common/truncated-text';
|
||||||
import Icon from 'component/common/icon';
|
import Icon from 'component/common/icon';
|
||||||
import FilePrice from 'component/filePrice';
|
|
||||||
import UriIndicator from 'component/uriIndicator';
|
import UriIndicator from 'component/uriIndicator';
|
||||||
import * as icons from 'constants/icons';
|
import * as icons from 'constants/icons';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
@ -22,10 +21,10 @@ type Props = {
|
||||||
rewardedContentClaimIds: Array<string>,
|
rewardedContentClaimIds: Array<string>,
|
||||||
obscureNsfw: boolean,
|
obscureNsfw: boolean,
|
||||||
claimIsMine: boolean,
|
claimIsMine: boolean,
|
||||||
showPrice: boolean,
|
|
||||||
pending?: boolean,
|
pending?: boolean,
|
||||||
position: ?number,
|
position: ?number,
|
||||||
lastViewed: ?number,
|
lastViewed: ?number,
|
||||||
|
clearHistoryUri: string => void,
|
||||||
/* eslint-disable react/no-unused-prop-types */
|
/* eslint-disable react/no-unused-prop-types */
|
||||||
resolveUri: string => void,
|
resolveUri: string => void,
|
||||||
isResolvingUri: boolean,
|
isResolvingUri: boolean,
|
||||||
|
@ -62,10 +61,10 @@ class FileCard extends React.PureComponent<Props> {
|
||||||
rewardedContentClaimIds,
|
rewardedContentClaimIds,
|
||||||
obscureNsfw,
|
obscureNsfw,
|
||||||
claimIsMine,
|
claimIsMine,
|
||||||
showPrice,
|
|
||||||
pending,
|
pending,
|
||||||
position,
|
position,
|
||||||
lastViewed,
|
lastViewed,
|
||||||
|
clearHistoryUri,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const shouldHide = !claimIsMine && !pending && obscureNsfw && metadata && metadata.nsfw;
|
const shouldHide = !claimIsMine && !pending && obscureNsfw && metadata && metadata.nsfw;
|
||||||
|
@ -111,7 +110,18 @@ class FileCard extends React.PureComponent<Props> {
|
||||||
{position && <Icon icon={icons.REFRESH} />}
|
{position && <Icon icon={icons.REFRESH} />}
|
||||||
</div>
|
</div>
|
||||||
{lastViewed && (
|
{lastViewed && (
|
||||||
<div className="card__subtitle">{moment(lastViewed).from(moment())}</div>
|
<div className="card__subtitle">
|
||||||
|
{moment(lastViewed).from(moment())}
|
||||||
|
{position && <Icon icon={icons.REFRESH} />}
|
||||||
|
<span
|
||||||
|
onClick={e => {
|
||||||
|
e.stopPropagation();
|
||||||
|
clearHistoryUri(uri);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Icon icon={icons.CLOSE} iconColor="red" />
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Add table
Reference in a new issue