add refresh icon to <FileCard> when playback position exists
This commit is contained in:
parent
82252e6985
commit
287f1ac656
3 changed files with 11 additions and 1 deletions
|
@ -8,7 +8,10 @@ import {
|
|||
makeSelectClaimIsMine,
|
||||
} from 'lbry-redux';
|
||||
import { doNavigate } from 'redux/actions/navigation';
|
||||
import { selectRewardContentClaimIds } from 'redux/selectors/content';
|
||||
import {
|
||||
selectRewardContentClaimIds,
|
||||
makeSelectContentPositionForUri,
|
||||
} from 'redux/selectors/content';
|
||||
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||
import { selectPendingPublish } from 'redux/selectors/publish';
|
||||
import FileCard from './view';
|
||||
|
@ -32,6 +35,7 @@ const select = (state, props) => {
|
|||
rewardedContentClaimIds: selectRewardContentClaimIds(state, props),
|
||||
...fileCardInfo,
|
||||
pending: !!pendingPublish,
|
||||
position: makeSelectContentPositionForUri(props.uri)(state),
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ type Props = {
|
|||
claimIsMine: boolean,
|
||||
showPrice: boolean,
|
||||
pending?: boolean,
|
||||
position: ?number,
|
||||
/* eslint-disable react/no-unused-prop-types */
|
||||
resolveUri: string => void,
|
||||
isResolvingUri: boolean,
|
||||
|
@ -61,6 +62,7 @@ class FileCard extends React.PureComponent<Props> {
|
|||
claimIsMine,
|
||||
showPrice,
|
||||
pending,
|
||||
position,
|
||||
} = this.props;
|
||||
|
||||
const shouldHide = !claimIsMine && !pending && obscureNsfw && metadata && metadata.nsfw;
|
||||
|
@ -103,6 +105,7 @@ class FileCard extends React.PureComponent<Props> {
|
|||
{showPrice && <FilePrice hideFree uri={uri} />}
|
||||
{isRewardContent && <Icon iconColor="red" icon={icons.FEATURED} />}
|
||||
{fileInfo && <Icon icon={icons.LOCAL} />}
|
||||
{position && <Icon icon={icons.REFRESH} />}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
@ -33,6 +33,9 @@ export const selectRewardContentClaimIds = createSelector(
|
|||
|
||||
export const makeSelectContentPositionForUri = uri =>
|
||||
createSelector(selectState, makeSelectClaimForUri(uri), (state, claim) => {
|
||||
if (!claim) {
|
||||
return null;
|
||||
}
|
||||
const outpoint = `${claim.txid}:${claim.nout}`;
|
||||
const id = claim.claim_id;
|
||||
return state.positions[id] ? state.positions[id][outpoint] : null;
|
||||
|
|
Loading…
Add table
Reference in a new issue