feat: Invited Link Displays Channel Content

This commit is contained in:
Mr. X 2020-04-22 17:37:09 +05:30 committed by Sean Yesmunt
parent 220994eeaa
commit 7893512e2b
3 changed files with 20 additions and 2 deletions

View file

@ -17,12 +17,24 @@ type Props = {
channelIsMine: boolean, channelIsMine: boolean,
fetchClaims: (string, number) => void, fetchClaims: (string, number) => void,
channelIsBlackListed: boolean, channelIsBlackListed: boolean,
defaultPageSize?: number,
defaultInfiniteScroll?: Boolean,
claim: ?Claim, claim: ?Claim,
isAuthenticated: boolean, isAuthenticated: boolean,
}; };
function ChannelContent(props: Props) { function ChannelContent(props: Props) {
const { uri, fetching, channelIsMine, channelIsBlocked, channelIsBlackListed, claim, isAuthenticated } = props; const {
uri,
fetching,
channelIsMine,
channelIsBlocked,
channelIsBlackListed,
claim,
isAuthenticated,
defaultPageSize = CS.PAGE_SIZE,
defaultInfiniteScroll = true,
} = props;
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0; const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
return ( return (
@ -56,6 +68,8 @@ function ChannelContent(props: Props) {
<ClaimListDiscover <ClaimListDiscover
channelIds={[claim.claim_id]} channelIds={[claim.claim_id]}
defaultOrderBy={CS.ORDER_BY_NEW} defaultOrderBy={CS.ORDER_BY_NEW}
pageSize={defaultPageSize}
infiniteScroll={defaultInfiniteScroll}
injectedItem={!isAuthenticated && IS_WEB && <Ads type="video" />} injectedItem={!isAuthenticated && IS_WEB && <Ads type="video" />}
/> />
) : ( ) : (

View file

@ -53,6 +53,7 @@ type Props = {
pageSize?: number, pageSize?: number,
followedTags?: Array<Tag>, followedTags?: Array<Tag>,
injectedItem: ?Node, injectedItem: ?Node,
infiniteScroll?: Boolean,
}; };
function ClaimListDiscover(props: Props) { function ClaimListDiscover(props: Props) {
@ -87,6 +88,7 @@ function ClaimListDiscover(props: Props) {
includeSupportAction, includeSupportAction,
repostedClaimId, repostedClaimId,
hideFilter, hideFilter,
infiniteScroll = true,
followedTags, followedTags,
injectedItem, injectedItem,
} = props; } = props;
@ -368,7 +370,7 @@ function ClaimListDiscover(props: Props) {
} }
function handleScrollBottom() { function handleScrollBottom() {
if (!loading) { if (!loading && infiniteScroll) {
setPage(page + 1); setPage(page + 1);
} }
} }

View file

@ -7,6 +7,7 @@ import Card from 'component/common/card';
import { buildURI, parseURI } from 'lbry-redux'; import { buildURI, parseURI } from 'lbry-redux';
import { rewards as REWARDS, ERRORS } from 'lbryinc'; import { rewards as REWARDS, ERRORS } from 'lbryinc';
import { formatLbryUrlForWeb } from 'util/url'; import { formatLbryUrlForWeb } from 'util/url';
import ChannelContent from 'component/channelContent';
type Props = { type Props = {
user: any, user: any,
@ -142,6 +143,7 @@ function Invited(props: Props) {
referrerIsChannel && ( referrerIsChannel && (
<div className="claim-preview--channel"> <div className="claim-preview--channel">
<ClaimPreview key={refUri} uri={refUri} actions={''} type={'small'} /> <ClaimPreview key={refUri} uri={refUri} actions={''} type={'small'} />
<ChannelContent uri={fullUri} defaultPageSize={5} defaultInfiniteScroll={false} />
</div> </div>
) )
} }