so much discovery I can't take it #2617
5 changed files with 27 additions and 5 deletions
|
@ -29,7 +29,7 @@ const SEARCH_TIMES = [TIME_DAY, TIME_WEEK, TIME_MONTH, TIME_YEAR, TIME_ALL];
|
||||||
type Props = {
|
type Props = {
|
||||||
uris: Array<string>,
|
uris: Array<string>,
|
||||||
subscribedChannels: Array<Subscription>,
|
subscribedChannels: Array<Subscription>,
|
||||||
doClaimSearch: (number, {}) => void,
|
doClaimSearch: ({}) => void,
|
||||||
injectedItem: any,
|
injectedItem: any,
|
||||||
tags: Array<string>,
|
tags: Array<string>,
|
||||||
loading: boolean,
|
loading: boolean,
|
||||||
|
@ -87,7 +87,8 @@ function ClaimListDiscover(props: Props) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
doClaimSearch(20, options);
|
options.page_size = PAGE_SIZE;
|
||||||
|
doClaimSearch(options);
|
||||||
}, [personal, personalSort, typeSort, timeSort, doClaimSearch, page, tagsString, channelsIdString, showNsfw]);
|
}, [personal, personalSort, typeSort, timeSort, doClaimSearch, page, tagsString, channelsIdString, showNsfw]);
|
||||||
|
|
||||||
function getLabel(type) {
|
function getLabel(type) {
|
||||||
|
|
|
@ -11,6 +11,7 @@ import {
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
||||||
import { selectShowNsfw } from 'redux/selectors/settings';
|
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||||
|
import { makeSelectHasVisitedUri } from 'redux/selectors/content';
|
||||||
import ClaimPreview from './view';
|
import ClaimPreview from './view';
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
|
@ -24,6 +25,7 @@ const select = (state, props) => ({
|
||||||
nsfw: makeSelectClaimIsNsfw(props.uri)(state),
|
nsfw: makeSelectClaimIsNsfw(props.uri)(state),
|
||||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||||
filteredOutpoints: selectFilteredOutpoints(state),
|
filteredOutpoints: selectFilteredOutpoints(state),
|
||||||
|
hasVisitedUri: makeSelectHasVisitedUri(props.uri)(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
|
|
|
@ -29,6 +29,7 @@ type Props = {
|
||||||
nsfw: boolean,
|
nsfw: boolean,
|
||||||
placeholder: boolean,
|
placeholder: boolean,
|
||||||
type: string,
|
type: string,
|
||||||
|
hasVisitedUri: boolean,
|
||||||
blackListedOutpoints: Array<{
|
blackListedOutpoints: Array<{
|
||||||
txid: string,
|
txid: string,
|
||||||
nout: number,
|
nout: number,
|
||||||
|
@ -56,6 +57,7 @@ function ClaimPreview(props: Props) {
|
||||||
type,
|
type,
|
||||||
blackListedOutpoints,
|
blackListedOutpoints,
|
||||||
filteredOutpoints,
|
filteredOutpoints,
|
||||||
|
hasVisitedUri,
|
||||||
} = props;
|
} = props;
|
||||||
const haventFetched = claim === undefined;
|
const haventFetched = claim === undefined;
|
||||||
const abandoned = !isResolvingUri && !claim && !placeholder;
|
const abandoned = !isResolvingUri && !claim && !placeholder;
|
||||||
|
@ -65,7 +67,6 @@ function ClaimPreview(props: Props) {
|
||||||
let shouldHide = abandoned || (!claimIsMine && obscureNsfw && nsfw);
|
let shouldHide = abandoned || (!claimIsMine && obscureNsfw && nsfw);
|
||||||
|
|
||||||
// This will be replaced once blocking is done at the wallet server level
|
// This will be replaced once blocking is done at the wallet server level
|
||||||
|
|
||||||
if (claim && !shouldHide && blackListedOutpoints) {
|
if (claim && !shouldHide && blackListedOutpoints) {
|
||||||
shouldHide = blackListedOutpoints.some(outpoint => outpoint.txid === claim.txid && outpoint.nout === claim.nout);
|
shouldHide = blackListedOutpoints.some(outpoint => outpoint.txid === claim.txid && outpoint.nout === claim.nout);
|
||||||
}
|
}
|
||||||
|
@ -117,7 +118,8 @@ function ClaimPreview(props: Props) {
|
||||||
onContextMenu={handleContextMenu}
|
onContextMenu={handleContextMenu}
|
||||||
className={classnames('claim-preview', {
|
className={classnames('claim-preview', {
|
||||||
'claim-preview--large': type === 'large',
|
'claim-preview--large': type === 'large',
|
||||||
'claim-list__pending': pending,
|
'claim-preview--visited': hasVisitedUri,
|
||||||
|
'claim-preview--pending': pending,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{isChannel ? <ChannelThumbnail uri={uri} /> : <CardMedia thumbnail={thumbnail} />}
|
{isChannel ? <ChannelThumbnail uri={uri} /> : <CardMedia thumbnail={thumbnail} />}
|
||||||
|
|
|
@ -58,6 +58,12 @@ export const makeSelectHistoryForUri = (uri: string) =>
|
||||||
history => history.find(i => i.uri === uri)
|
history => history.find(i => i.uri === uri)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const makeSelectHasVisitedUri = (uri: string) =>
|
||||||
|
createSelector(
|
||||||
|
makeSelectHistoryForUri(uri),
|
||||||
|
history => Boolean(history)
|
||||||
|
);
|
||||||
|
|
||||||
export const selectRecentHistory = createSelector(
|
export const selectRecentHistory = createSelector(
|
||||||
selectHistory,
|
selectHistory,
|
||||||
history => {
|
history => {
|
||||||
|
|
|
@ -129,7 +129,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.claim-list__pending {
|
.claim-preview--visited {
|
||||||
|
// Still keep the normal styles on hover regardless of if they have visited the claim
|
||||||
|
&:not(:hover) {
|
||||||
|
color: lighten($lbry-black, 35%);
|
||||||
|
|
||||||
|
[data-mode='dark'] & {
|
||||||
|
color: darken($lbry-white, 35%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.claim-preview--pending {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue