2020-02-17 20:12:28 +01:00
|
|
|
// @flow
|
2021-03-03 20:23:42 +01:00
|
|
|
// import * as ICONS from 'constants/icons';
|
|
|
|
// import * as PAGES from 'constants/pages';
|
|
|
|
import * as CS from 'constants/claim_search';
|
2020-02-17 20:12:28 +01:00
|
|
|
import React from 'react';
|
|
|
|
import Page from 'component/page';
|
2021-03-03 20:23:42 +01:00
|
|
|
// import Button from 'component/button';
|
2020-02-27 18:01:57 +01:00
|
|
|
import ClaimListDiscover from 'component/claimListDiscover';
|
2021-03-03 20:23:42 +01:00
|
|
|
// import { toCapitalCase } from 'util/string';
|
2020-11-10 17:07:00 +01:00
|
|
|
import { SIMPLE_SITE } from 'config';
|
2020-02-17 20:12:28 +01:00
|
|
|
|
2020-11-25 18:09:58 +01:00
|
|
|
const MORE_CHANNELS_ANCHOR = 'MoreChannels';
|
|
|
|
|
2020-02-18 16:26:58 +01:00
|
|
|
type Props = {
|
|
|
|
followedTags: Array<Tag>,
|
2020-02-18 18:00:47 +01:00
|
|
|
subscribedChannels: Array<Subscription>,
|
|
|
|
blockedChannels: Array<string>,
|
2020-11-10 17:07:00 +01:00
|
|
|
homepageData: any,
|
2020-02-18 16:26:58 +01:00
|
|
|
};
|
2020-02-17 20:12:28 +01:00
|
|
|
|
|
|
|
function ChannelsFollowingDiscover(props: Props) {
|
2021-03-03 20:23:42 +01:00
|
|
|
const {
|
|
|
|
// followedTags,
|
|
|
|
// subscribedChannels,
|
|
|
|
// blockedChannels,
|
|
|
|
homepageData,
|
|
|
|
} = props;
|
2020-11-10 17:07:00 +01:00
|
|
|
const { PRIMARY_CONTENT_CHANNEL_IDS } = homepageData;
|
2021-03-03 20:23:42 +01:00
|
|
|
// let rowData: Array<ChannelsFollowingItem> = [];
|
|
|
|
// const notChannels = subscribedChannels
|
|
|
|
// .map(({ uri }) => uri)
|
|
|
|
// .concat(blockedChannels)
|
|
|
|
// .map(uri => uri.split('#')[1]);
|
2020-02-17 20:12:28 +01:00
|
|
|
|
2021-03-03 20:23:42 +01:00
|
|
|
// rowData.push({
|
|
|
|
// title: 'Top Channels Of All Time',
|
|
|
|
// link: `/$/${PAGES.DISCOVER}?claim_type=channel&${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TOP}&${CS.FRESH_KEY}=${CS.FRESH_ALL}`,
|
|
|
|
// options: {
|
|
|
|
// pageSize: 12,
|
|
|
|
// claimType: 'channel',
|
|
|
|
// orderBy: ['effective_amount'],
|
|
|
|
// },
|
|
|
|
// });
|
2020-02-18 16:26:58 +01:00
|
|
|
|
2021-03-03 20:23:42 +01:00
|
|
|
// rowData.push({
|
|
|
|
// title: 'Latest From @lbrycast',
|
|
|
|
// link: `/@lbrycast:4`,
|
|
|
|
// options: {
|
|
|
|
// orderBy: ['release_time'],
|
|
|
|
// pageSize: 8,
|
|
|
|
// channelIds: ['4c29f8b013adea4d5cca1861fb2161d5089613ea'],
|
|
|
|
// },
|
|
|
|
// });
|
2020-02-18 16:26:58 +01:00
|
|
|
|
2021-03-03 20:23:42 +01:00
|
|
|
// rowData.push({
|
|
|
|
// title: 'Trending Channels',
|
|
|
|
// link: `/$/${PAGES.DISCOVER}?claim_type=channel`,
|
|
|
|
// options: {
|
|
|
|
// pageSize: 8,
|
|
|
|
// claimType: 'channel',
|
|
|
|
// orderBy: ['trending_group', 'trending_mixed'],
|
|
|
|
// },
|
|
|
|
// });
|
2020-02-17 20:12:28 +01:00
|
|
|
|
2021-03-03 20:23:42 +01:00
|
|
|
// if (followedTags.length > 0 && followedTags.length < 5) {
|
|
|
|
// const followedRows = followedTags.map((tag: Tag) => ({
|
|
|
|
// title: `Trending Channels for #${toCapitalCase(tag.name)}`,
|
|
|
|
// link: `/$/${PAGES.DISCOVER}?t=${tag.name}&claim_type=channel`,
|
|
|
|
// options: {
|
|
|
|
// claimType: 'channel',
|
|
|
|
// pageSize: 4,
|
|
|
|
// tags: [tag.name],
|
|
|
|
// },
|
|
|
|
// }));
|
|
|
|
// rowData.push(...followedRows);
|
|
|
|
// }
|
2020-02-18 16:26:58 +01:00
|
|
|
|
2021-03-03 20:23:42 +01:00
|
|
|
// if (followedTags.length > 4) {
|
|
|
|
// rowData.push({
|
|
|
|
// title: 'Trending For Your Tags',
|
|
|
|
// link: `/$/${PAGES.TAGS_FOLLOWING}?claim_type=channel`,
|
|
|
|
// options: {
|
|
|
|
// claimType: 'channel',
|
|
|
|
// tags: followedTags.map(tag => tag.name),
|
|
|
|
// },
|
|
|
|
// });
|
|
|
|
// }
|
2020-02-18 16:26:58 +01:00
|
|
|
|
2021-03-03 20:23:42 +01:00
|
|
|
// const rowDataWithGenericOptions = rowData.map(row => {
|
|
|
|
// return {
|
|
|
|
// ...row,
|
|
|
|
// options: {
|
|
|
|
// ...row.options,
|
|
|
|
// notChannels,
|
|
|
|
// },
|
|
|
|
// };
|
|
|
|
// });
|
2020-02-18 18:00:47 +01:00
|
|
|
|
2020-02-17 20:12:28 +01:00
|
|
|
return (
|
|
|
|
<Page>
|
2021-03-03 20:23:42 +01:00
|
|
|
{/* {rowDataWithGenericOptions.map(({ title, link, help, options = {} }) => (
|
2020-02-17 20:12:28 +01:00
|
|
|
<div key={title} className="claim-grid__wrapper">
|
|
|
|
<h1 className="section__actions">
|
|
|
|
{link ? (
|
|
|
|
<Button
|
|
|
|
className="claim-grid__title"
|
|
|
|
button="link"
|
|
|
|
navigate={link}
|
|
|
|
iconRight={ICONS.ARROW_RIGHT}
|
2020-09-18 16:13:20 +02:00
|
|
|
label={__(title)}
|
2020-02-17 20:12:28 +01:00
|
|
|
/>
|
|
|
|
) : (
|
2020-09-18 16:13:20 +02:00
|
|
|
<span className="claim-grid__title">{__(title)}</span>
|
2020-02-17 20:12:28 +01:00
|
|
|
)}
|
|
|
|
{help}
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
<ClaimTilesDiscover {...options} />
|
|
|
|
</div>
|
2021-03-03 20:23:42 +01:00
|
|
|
))} */}
|
|
|
|
|
2020-11-10 17:07:00 +01:00
|
|
|
<ClaimListDiscover
|
2020-11-10 18:47:31 +01:00
|
|
|
defaultOrderBy={CS.ORDER_BY_TRENDING}
|
2020-11-10 17:07:00 +01:00
|
|
|
defaultFreshness={CS.FRESH_ALL}
|
2020-11-10 18:47:31 +01:00
|
|
|
claimType={CS.CLAIM_CHANNEL}
|
2020-12-10 22:58:31 +01:00
|
|
|
claimIds={SIMPLE_SITE ? PRIMARY_CONTENT_CHANNEL_IDS : undefined}
|
2020-11-25 18:09:58 +01:00
|
|
|
scrollAnchor={MORE_CHANNELS_ANCHOR}
|
2021-03-03 20:23:42 +01:00
|
|
|
maxPages={3}
|
|
|
|
hideFilters
|
|
|
|
header={<h1 className="section__title">{__('Moon cheese is an acquired taste')}</h1>}
|
2020-11-10 17:07:00 +01:00
|
|
|
/>
|
2020-02-17 20:12:28 +01:00
|
|
|
</Page>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ChannelsFollowingDiscover;
|