// @flow import * as ICONS from 'constants/icons'; import * as PAGES from 'constants/pages'; import { SITE_NAME } 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 WaitUntilOnPage from 'component/common/wait-until-on-page'; import { useIsLargeScreen } from 'effects/use-screensize'; import { GetLinksData } from 'util/buildHomepage'; type Props = { followedTags: Array, subscribedChannels: Array, showNsfw: boolean, homepageData: any, }; function HomePage(props: Props) { const { followedTags, subscribedChannels, showNsfw, homepageData } = props; const showPersonalizedChannels = subscribedChannels && subscribedChannels.length > 0; const showPersonalizedTags = followedTags && followedTags.length > 0; const showIndividualTags = showPersonalizedTags && followedTags.length < 5; const isLargeScreen = useIsLargeScreen(); const rowData: Array = GetLinksData( homepageData, isLargeScreen, true, showPersonalizedChannels, showPersonalizedTags, subscribedChannels, followedTags, showIndividualTags, showNsfw ); type SectionHeaderProps = { title: string, navigate?: string, icon?: string, help?: string, }; const SectionHeader = ({ title, navigate = '/', icon = '', help }: SectionHeaderProps) => { return (

); }; function getRowElements(title, route, link, icon, help, options, index, pinUrls) { const tilePlaceholder = (
    {new Array(options.pageSize || 8).fill(1).map((x, i) => ( ))}
); const claimTiles = ; return (
{/* category header */} {index !== 0 && title && typeof title === 'string' && ( )} {index === 0 && <>{claimTiles}} {index !== 0 && ( {claimTiles} )} {/* view more button */} {(route || link) && (
); } return ( {!subscribedChannels.length && (

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

)} {rowData.map(({ title, route, link, icon, help, pinnedUrls: pinUrls, options = {} }, index) => { // add pins here return getRowElements(title, route, link, icon, help, options, index, pinUrls); })}
); } export default HomePage;