Recon 7 6 b (#6418)

* changes

* clean

* showNoSourceClaims
This commit is contained in:
jessopb 2021-07-07 14:21:11 -04:00 committed by GitHub
parent 0ef61fc575
commit be879ae90a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 25 additions and 15 deletions

View file

@ -4,12 +4,12 @@ declare type HomepageObject = {
options: any, options: any,
route: string, route: string,
title: string, title: string,
} };
declare type HomepageData = { declare type HomepageData = {
[string]: HomepageObject, [string]: HomepageObject,
default: any => any, default: any => any,
} };
declare type RowDataItem = { declare type RowDataItem = {
title: any, title: any,
@ -19,6 +19,7 @@ declare type RowDataItem = {
extra?: any, extra?: any,
options?: { options?: {
channelIds?: Array<string>, channelIds?: Array<string>,
limitClaimsPerChannel?: number,
pageSize: number, pageSize: number,
}, },
route?: string, route?: string,

View file

@ -1,5 +1,5 @@
// @flow // @flow
import { SHOW_ADS } from 'config'; import { SHOW_ADS, ENABLE_NO_SOURCE_CLAIMS } from 'config';
import * as CS from 'constants/claim_search'; import * as CS from 'constants/claim_search';
import * as ICONS from 'constants/icons'; import * as ICONS from 'constants/icons';
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
@ -136,6 +136,7 @@ function ChannelContent(props: Props) {
{!channelIsMine && claimsInChannel > 0 && <HiddenNsfwClaims uri={uri} />} {!channelIsMine && claimsInChannel > 0 && <HiddenNsfwClaims uri={uri} />}
<ClaimListDiscover <ClaimListDiscover
showNoSourceClaims={ENABLE_NO_SOURCE_CLAIMS}
defaultFreshness={CS.FRESH_ALL} defaultFreshness={CS.FRESH_ALL}
showHiddenByUser={viewHiddenChannels} showHiddenByUser={viewHiddenChannels}
forceShowReposts forceShowReposts

View file

@ -45,7 +45,7 @@ type Props = {
livestreamMap?: { [string]: any }, livestreamMap?: { [string]: any },
searchOptions?: any, searchOptions?: any,
collectionId?: string, collectionId?: string,
hideLivestreamClaims?: boolean, showNoSourceClaims?: boolean,
}; };
export default function ClaimList(props: Props) { export default function ClaimList(props: Props) {
@ -77,7 +77,7 @@ export default function ClaimList(props: Props) {
livestreamMap, livestreamMap,
searchOptions, searchOptions,
collectionId, collectionId,
hideLivestreamClaims, showNoSourceClaims,
} = props; } = props;
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW); const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW);
@ -137,7 +137,7 @@ export default function ClaimList(props: Props) {
properties={renderProperties} properties={renderProperties}
live={resolveLive(index)} live={resolveLive(index)}
collectionId={collectionId} collectionId={collectionId}
hideLivestreamClaims={hideLivestreamClaims} showNoSourceClaims={showNoSourceClaims}
/> />
))} ))}
{!timedOut && urisLength === 0 && !loading && <div className="empty main--empty">{empty || noResultMsg}</div>} {!timedOut && urisLength === 0 && !loading && <div className="empty main--empty">{empty || noResultMsg}</div>}
@ -198,7 +198,7 @@ export default function ClaimList(props: Props) {
showUserBlocked={showHiddenByUser} showUserBlocked={showHiddenByUser}
showHiddenByUser={showHiddenByUser} showHiddenByUser={showHiddenByUser}
collectionId={collectionId} collectionId={collectionId}
hideLivestreamClaims={hideLivestreamClaims} showNoSourceClaims={showNoSourceClaims}
customShouldHide={(claim: StreamClaim) => { customShouldHide={(claim: StreamClaim) => {
// Hack to hide spee.ch thumbnail publishes // Hack to hide spee.ch thumbnail publishes
// If it meets these requirements, it was probably uploaded here: // If it meets these requirements, it was probably uploaded here:

View file

@ -72,6 +72,7 @@ type Props = {
liveLivestreamsFirst?: boolean, liveLivestreamsFirst?: boolean,
livestreamMap?: { [string]: any }, livestreamMap?: { [string]: any },
hasSource?: boolean, hasSource?: boolean,
showNoSourceClaims?: boolean,
isChannel?: boolean, isChannel?: boolean,
empty?: string, empty?: string,
}; };
@ -129,6 +130,7 @@ function ClaimListDiscover(props: Props) {
livestreamMap, livestreamMap,
hasSource, hasSource,
isChannel = false, isChannel = false,
showNoSourceClaims,
empty, empty,
} = props; } = props;
const didNavigateForward = history.action === 'PUSH'; const didNavigateForward = history.action === 'PUSH';
@ -512,6 +514,7 @@ function ClaimListDiscover(props: Props) {
liveLivestreamsFirst={liveLivestreamsFirst} liveLivestreamsFirst={liveLivestreamsFirst}
livestreamMap={livestreamMap} livestreamMap={livestreamMap}
searchOptions={options} searchOptions={options}
showNoSourceClaims={showNoSourceClaims}
empty={empty} empty={empty}
/> />
{loading && ( {loading && (
@ -546,6 +549,7 @@ function ClaimListDiscover(props: Props) {
liveLivestreamsFirst={liveLivestreamsFirst} liveLivestreamsFirst={liveLivestreamsFirst}
livestreamMap={livestreamMap} livestreamMap={livestreamMap}
searchOptions={options} searchOptions={options}
showNoSourceClaims={showNoSourceClaims}
empty={empty} empty={empty}
/> />
{loading && {loading &&

View file

@ -44,6 +44,8 @@ type Props = {
properties?: (Claim) => void, properties?: (Claim) => void,
live?: boolean, live?: boolean,
collectionId?: string, collectionId?: string,
showNoSourceClaims?: boolean,
isLivestream: boolean,
}; };
function ClaimPreviewTile(props: Props) { function ClaimPreviewTile(props: Props) {
@ -66,6 +68,8 @@ function ClaimPreviewTile(props: Props) {
showHiddenByUser, showHiddenByUser,
properties, properties,
live, live,
showNoSourceClaims,
isLivestream,
collectionId, collectionId,
} = props; } = props;
const isRepost = claim && claim.repost_channel_url; const isRepost = claim && claim.repost_channel_url;
@ -149,7 +153,7 @@ function ClaimPreviewTile(props: Props) {
shouldHide = blockedChannelUris.some((blockedUri) => blockedUri === claim.permanent_url); shouldHide = blockedChannelUris.some((blockedUri) => blockedUri === claim.permanent_url);
} }
if (shouldHide) { if (shouldHide || (isLivestream && !showNoSourceClaims)) {
return null; return null;
} }

View file

@ -37,7 +37,7 @@ export function prioritizeActiveLivestreams(
// for that channel actually point to the same source). // for that channel actually point to the same source).
// 2. 'liveChannelIds' needs to be pruned after being accounted for, // 2. 'liveChannelIds' needs to be pruned after being accounted for,
// otherwise all livestream-claims will be "live" (we'll only take the // otherwise all livestream-claims will be "live" (we'll only take the
// latest one as "live"). // latest one as "live" ).
return ( return (
claim && claim &&
claim.value_type === 'stream' && claim.value_type === 'stream' &&
@ -145,7 +145,7 @@ function ClaimTilesDiscover(props: Props) {
mutedUris, mutedUris,
liveLivestreamsFirst, liveLivestreamsFirst,
livestreamMap, livestreamMap,
// pin, // pin, // let's pin from /web folder
prefixUris, prefixUris,
} = props; } = props;
@ -240,7 +240,7 @@ function ClaimTilesDiscover(props: Props) {
const isLoading = fetchingClaimSearchByQuery[mainSearchKey]; const isLoading = fetchingClaimSearchByQuery[mainSearchKey];
if (liveLivestreamsFirst && livestreamMap) { if (liveLivestreamsFirst && livestreamMap && !isLoading) {
prioritizeActiveLivestreams(uris, liveUris, livestreamMap, claimsByUri, claimSearchByQuery, options); prioritizeActiveLivestreams(uris, liveUris, livestreamMap, claimsByUri, claimSearchByQuery, options);
} }

View file

@ -123,7 +123,7 @@ class SelectThumbnail extends React.PureComponent<Props> {
<FileSelector <FileSelector
currentPath={thumbnailPath} currentPath={thumbnailPath}
label={__('Thumbnail')} label={__('Thumbnail')}
placeholder={__('Choose a thumbnail')} placeholder={__('Choose an enticing thumbnail')}
accept={accept} accept={accept}
onFileChosen={(file) => openModal(MODALS.CONFIRM_THUMBNAIL_UPLOAD, { file })} onFileChosen={(file) => openModal(MODALS.CONFIRM_THUMBNAIL_UPLOAD, { file })}
/> />

View file

@ -9,7 +9,7 @@ import Icon from 'component/common/icon';
import NotificationBubble from 'component/notificationBubble'; import NotificationBubble from 'component/notificationBubble';
import I18nMessage from 'component/i18nMessage'; import I18nMessage from 'component/i18nMessage';
import ChannelThumbnail from 'component/channelThumbnail'; import ChannelThumbnail from 'component/channelThumbnail';
import { PINNED_LABEL_1, PINNED_URI_1, PINNED_URI_2, PINNED_LABEL_2, SIMPLE_SITE, DOMAIN } from 'config'; import { PINNED_LABEL_1, PINNED_URI_1, PINNED_URI_2, PINNED_LABEL_2, SIMPLE_SITE, DOMAIN, ENABLE_UI_NOTIFICATIONS } from 'config';
// @if TARGET='app' // @if TARGET='app'
import { IS_MAC } from 'component/app/view'; import { IS_MAC } from 'component/app/view';
// @endif // @endif
@ -213,7 +213,7 @@ function SideNavigation(props: Props) {
}); });
} }
const notificationsEnabled = user && user.experimental_ui; const notificationsEnabled = ENABLE_UI_NOTIFICATIONS || (user && user.experimental_ui);
const isAuthenticated = Boolean(email); const isAuthenticated = Boolean(email);
// SIDE LINKS: FOLLOWING, HOME, [FULL,] [EXTRA] // SIDE LINKS: FOLLOWING, HOME, [FULL,] [EXTRA]
let SIDE_LINKS: Array<SideNavLink> = []; let SIDE_LINKS: Array<SideNavLink> = [];

View file

@ -6,8 +6,8 @@ import {
makeSelectNotificationsDisabled, makeSelectNotificationsDisabled,
} from 'redux/selectors/subscriptions'; } from 'redux/selectors/subscriptions';
import { makeSelectPermanentUrlForUri } from 'lbry-redux'; import { makeSelectPermanentUrlForUri } from 'lbry-redux';
import { doToast } from 'redux/actions/notifications';
import { selectUser } from 'redux/selectors/user'; import { selectUser } from 'redux/selectors/user';
import { doToast } from 'redux/actions/notifications';
import SubscribeButton from './view'; import SubscribeButton from './view';
const select = (state, props) => ({ const select = (state, props) => ({