// @flow import * as ICONS from 'constants/icons'; import * as PAGES from 'constants/pages'; import { SITE_NAME, SIMPLE_SITE, DOMAIN } from 'config'; import React from 'react'; import Page from 'component/page'; import Button from 'component/button'; import ClaimTilesDiscover from 'component/claimTilesDiscover'; import ClaimPreviewTile from 'component/claimPreviewTile'; import Icon from 'component/common/icon'; import I18nMessage from 'component/i18nMessage'; import LbcSymbol from 'component/common/lbc-symbol'; import WaitUntilOnPage from 'component/common/wait-until-on-page'; import useGetLivestreams from 'effects/use-get-livestreams'; // @if TARGET='web' import Pixel from 'web/component/pixel'; // @endif type Props = { authenticated: boolean, followedTags: Array, subscribedChannels: Array, showNsfw: boolean, homepageData: any, }; function HomePage(props: Props) { const { followedTags, subscribedChannels, authenticated, showNsfw, homepageData } = props; const showPersonalizedChannels = (authenticated || !IS_WEB) && subscribedChannels && subscribedChannels.length > 0; const showPersonalizedTags = (authenticated || !IS_WEB) && followedTags && followedTags.length > 0; const showIndividualTags = showPersonalizedTags && followedTags.length < 5; const { default: getHomepage } = homepageData; const { livestreamMap } = useGetLivestreams(); const rowData: Array = getHomepage( authenticated, showPersonalizedChannels, showPersonalizedTags, subscribedChannels, followedTags, showIndividualTags, showNsfw ); function getRowElements(title, route, link, icon, help, options, index) { const tilePlaceholder = (
    {new Array(options.pageSize || 8).fill(1).map((x, i) => ( ))}
); const claimTiles = ; return (
{index !== 0 && title && typeof title === 'string' && (

)} {index === 0 && <>{claimTiles}} {index !== 0 && ( {claimTiles} )} {(route || link) && (
); } return ( {IS_WEB && DOMAIN === 'lbry.tv' && (

, }} > lbry.tv is being retired in favor of %odysee%

), odysee:

)} {!SIMPLE_SITE && (authenticated || !IS_WEB) && !subscribedChannels.length && (

{__("%SITE_NAME% is more fun if you're following channels", { SITE_NAME })}

)} {rowData.map(({ title, route, link, icon, help, options = {} }, index) => { return getRowElements(title, route, link, icon, help, options, index); })} {/* @if TARGET='web' */} {/* @endif */}
); } export default HomePage;