pinning
This commit is contained in:
parent
f2cd9f372e
commit
ed0387d94a
4 changed files with 13 additions and 9 deletions
2
flow-typed/homepage.js
vendored
2
flow-typed/homepage.js
vendored
|
@ -17,7 +17,7 @@ declare type RowDataItem = {
|
||||||
help?: any,
|
help?: any,
|
||||||
icon?: string,
|
icon?: string,
|
||||||
extra?: any,
|
extra?: any,
|
||||||
pinUrls?: Array<string>,
|
pinnedUrls?: Array<string>,
|
||||||
options?: {
|
options?: {
|
||||||
channelIds?: Array<string>,
|
channelIds?: Array<string>,
|
||||||
limitClaimsPerChannel?: number,
|
limitClaimsPerChannel?: number,
|
||||||
|
|
|
@ -114,7 +114,6 @@ type Props = {
|
||||||
renderProperties?: (Claim) => ?Node,
|
renderProperties?: (Claim) => ?Node,
|
||||||
liveLivestreamsFirst?: boolean,
|
liveLivestreamsFirst?: boolean,
|
||||||
livestreamMap?: { [string]: any },
|
livestreamMap?: { [string]: any },
|
||||||
pin?: boolean,
|
|
||||||
pinUrls?: Array<string>,
|
pinUrls?: Array<string>,
|
||||||
showNoSourceClaims?: boolean,
|
showNoSourceClaims?: boolean,
|
||||||
};
|
};
|
||||||
|
@ -147,7 +146,6 @@ function ClaimTilesDiscover(props: Props) {
|
||||||
mutedUris,
|
mutedUris,
|
||||||
liveLivestreamsFirst,
|
liveLivestreamsFirst,
|
||||||
livestreamMap,
|
livestreamMap,
|
||||||
pin,
|
|
||||||
pinUrls,
|
pinUrls,
|
||||||
prefixUris,
|
prefixUris,
|
||||||
showNoSourceClaims,
|
showNoSourceClaims,
|
||||||
|
@ -291,9 +289,9 @@ function ClaimTilesDiscover(props: Props) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const modifiedUris = uris ? uris.slice() : [];
|
const modifiedUris = uris ? uris.slice() : [];
|
||||||
const fixUris = pinUrls || ['lbry://@AlisonMorrow#6/LBRY#8'];
|
const fixUris = pinUrls || [];
|
||||||
|
|
||||||
if (pin && modifiedUris && modifiedUris.length > 2 && window.location.pathname === '/') {
|
if (pinUrls && modifiedUris && modifiedUris.length > 2 && window.location.pathname === '/') {
|
||||||
fixUris.forEach((fixUri) => {
|
fixUris.forEach((fixUri) => {
|
||||||
if (modifiedUris.indexOf(fixUri) !== -1) {
|
if (modifiedUris.indexOf(fixUri) !== -1) {
|
||||||
modifiedUris.splice(modifiedUris.indexOf(fixUri), 1);
|
modifiedUris.splice(modifiedUris.indexOf(fixUri), 1);
|
||||||
|
@ -308,7 +306,13 @@ function ClaimTilesDiscover(props: Props) {
|
||||||
<ul className="claim-grid">
|
<ul className="claim-grid">
|
||||||
{modifiedUris && modifiedUris.length
|
{modifiedUris && modifiedUris.length
|
||||||
? modifiedUris.map((uri, index) => (
|
? modifiedUris.map((uri, index) => (
|
||||||
<ClaimPreviewTile key={uri} uri={uri} properties={renderProperties} live={resolveLive(index)} />
|
<ClaimPreviewTile
|
||||||
|
showNoSourceClaims={hasNoSource || showNoSourceClaims}
|
||||||
|
key={uri}
|
||||||
|
uri={uri}
|
||||||
|
properties={renderProperties}
|
||||||
|
live={resolveLive(index)}
|
||||||
|
/>
|
||||||
))
|
))
|
||||||
: new Array(pageSize)
|
: new Array(pageSize)
|
||||||
.fill(1)
|
.fill(1)
|
||||||
|
|
|
@ -62,7 +62,6 @@ function HomePage(props: Props) {
|
||||||
showNoSourceClaims={ENABLE_NO_SOURCE_CLAIMS}
|
showNoSourceClaims={ENABLE_NO_SOURCE_CLAIMS}
|
||||||
hasSource
|
hasSource
|
||||||
pinUrls={pinUrls}
|
pinUrls={pinUrls}
|
||||||
pin={route === `/$/${PAGES.GENERAL}`} // use pinUrls here
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -145,12 +144,12 @@ function HomePage(props: Props) {
|
||||||
{/* @if TARGET='web' */}
|
{/* @if TARGET='web' */}
|
||||||
{SIMPLE_SITE && <Meme />}
|
{SIMPLE_SITE && <Meme />}
|
||||||
{/* @endif */}
|
{/* @endif */}
|
||||||
{rowData.map(({ title, route, link, icon, help, pinUrls, options = {} }, index) => {
|
{rowData.map(({ title, route, link, icon, help, pinnedUrls: pinUrls, options = {} }, index) => {
|
||||||
// add pins here
|
// add pins here
|
||||||
return getRowElements(title, route, link, icon, help, options, index, pinUrls);
|
return getRowElements(title, route, link, icon, help, options, index, pinUrls);
|
||||||
})}
|
})}
|
||||||
{/* @if TARGET='web' */}
|
{/* @if TARGET='web' */}
|
||||||
<Pixel type={'retargeting'} />
|
<Pixel type={'retargeting'} />
|
||||||
{/* @endif */}
|
{/* @endif */}
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
|
|
|
@ -106,6 +106,7 @@ export const getHomepageRowForCat = (cat: HomepageCat) => {
|
||||||
route: cat.name ? `/$/${cat.name}` : undefined,
|
route: cat.name ? `/$/${cat.name}` : undefined,
|
||||||
icon: cat.icon || '', // some default
|
icon: cat.icon || '', // some default
|
||||||
title: cat.label,
|
title: cat.label,
|
||||||
|
pinnedUrls: cat.pinnedUrls,
|
||||||
options: {
|
options: {
|
||||||
claimType: cat.claimType || 'stream',
|
claimType: cat.claimType || 'stream',
|
||||||
channelIds: cat.channelIds,
|
channelIds: cat.channelIds,
|
||||||
|
|
Loading…
Reference in a new issue