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,
fetchClaims: (string, number) => void,
channelIsBlackListed: boolean,
defaultPageSize?: number,
defaultInfiniteScroll?: Boolean,
claim: ?Claim,
isAuthenticated: boolean,
};
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;
return (
@ -56,6 +68,8 @@ function ChannelContent(props: Props) {
<ClaimListDiscover
channelIds={[claim.claim_id]}
defaultOrderBy={CS.ORDER_BY_NEW}
pageSize={defaultPageSize}
infiniteScroll={defaultInfiniteScroll}
injectedItem={!isAuthenticated && IS_WEB && <Ads type="video" />}
/>
) : (

View file

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

View file

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