From 32a9d2766fd2e191e26e8bcb2714ec82ffa2e65d Mon Sep 17 00:00:00 2001 From: Madiator2011 Date: Sun, 17 Oct 2021 10:56:40 +0000 Subject: [PATCH] Update custom/homepages/v2/index.js, custom/homepages/v2/madiator-en.js, README.md Deleted v2/.gitkeep --- README.md | 5 +- custom/homepages/v2/index.js | 4 + custom/homepages/v2/madiator-en.js | 157 +++++++++++++++++++++++++++++ v2/.gitkeep | 0 4 files changed, 162 insertions(+), 4 deletions(-) create mode 100644 custom/homepages/v2/index.js create mode 100644 custom/homepages/v2/madiator-en.js delete mode 100644 v2/.gitkeep diff --git a/README.md b/README.md index 9b01e8b..5944879 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This repo contains the UI code that powers the official LBRY desktop app, as wel ## Running from Source -You can run the web version (lbry.tv), the electron app, or both at the same time. +You can run the web version (madiator.com), the electron app, or both at the same time. #### Prerequisites @@ -49,9 +49,6 @@ nano .env - To specify your own OG-IMAGE You can either place a png named v2-og.png in the /custom folder or specify the OG_IMAGE_URL in .env -- To specify your own channels to be followed on first run - `AUTO_FOLLOW_URLS=lbry://@chan#123...a lbry://@chan2#456...a` - - If you want to customize the homepage content 1. add `CUSTOM_HOMEPAGE=true` to the '.env' file diff --git a/custom/homepages/v2/index.js b/custom/homepages/v2/index.js new file mode 100644 index 0000000..435de5b --- /dev/null +++ b/custom/homepages/v2/index.js @@ -0,0 +1,4 @@ +const madiator_en = require('./madiator-en.js'); +module.exports = { + en: madiator_en, +}; diff --git a/custom/homepages/v2/madiator-en.js b/custom/homepages/v2/madiator-en.js new file mode 100644 index 0000000..67f17ec --- /dev/null +++ b/custom/homepages/v2/madiator-en.js @@ -0,0 +1,157 @@ +//module.exports = { +// LINUX, +//}; + +//const PRIMARY_CONTENT_CHANNEL_IDS = [ +//e15f8434e6fd76b05f0b6c2918f71a7f29b93f7e, +//]; + +//const PRIMARY_CONTENT = { +// channelIds: PRIMARY_CONTENT_CHANNEL_IDS, +// name: 'general', +// sortOrder: 1, +// icon: 'Cheese', +// label: 'Cheese', +// channelLimit: 'auto', +// daysOfContent: 180, +// pageSize: 24, + //pinnedUrls: ['lbry://@RationalAnimations#1/humanity-was-born-way-ahead-of-its-time.#5',] + //mixIn: [], +//}; + +import * as PAGES from 'constants/pages'; +import * as CS from 'constants/claim_search'; +import * as ICONS from 'constants/icons'; +import { parseURI } from 'lbry-redux'; +import moment from 'moment'; +import { toCapitalCase } from 'util/string'; +import React from 'react'; +import Icon from 'component/common/icon'; + +export type RowDataItem = { + title: string, + link?: string, + help?: any, + options?: {}, +}; + +export default function GetHomePageRowData( + authenticated: boolean, + showPersonalizedChannels: boolean, + showPersonalizedTags: boolean, + subscribedChannels: Array, + followedTags: Array, + showIndividualTags: boolean +) { + let rowData: Array = []; + const individualTagDataItems: Array = []; + + const TOP_CONTENT_TODAY = { + title: 'Top Content from Today', + link: `/$/${PAGES.DISCOVER}?${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TOP}&${CS.FRESH_KEY}=${CS.FRESH_DAY}`, + options: { + pageSize: 12, + orderBy: ['effective_amount'], + claimType: ['stream'], + releaseTime: `>${Math.floor( + moment() + .subtract(1, 'day') + .startOf('day') + .unix() + )}`, + }, + }; + + const TOP_CHANNELS = { + title: 'Top Channels On LBRY', + link: `/$/${PAGES.DISCOVER}?claim_type=channel&${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TOP}&${CS.FRESH_KEY}=${CS.FRESH_ALL}`, + options: { + orderBy: ['effective_amount'], + claimType: ['channel'], + }, + }; + + const TRENDING_CLASSICS = { + title: 'Trending Classics', + link: `/$/${PAGES.DISCOVER}?${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TRENDING}&${CS.FRESH_KEY}=${CS.FRESH_WEEK}`, + options: { + pageSize: 6, + claimType: ['stream'], + releaseTime: `<${Math.floor( + moment() + .subtract(6, 'month') + .startOf('day') + .unix() + )}`, + }, + }; + + const TRENDING_ON_LBRY = { + title: 'Trending On LBRY', + link: `/$/${PAGES.DISCOVER}`, + options: { + pageSize: showPersonalizedChannels || showPersonalizedTags ? 4 : 8, + }, + }; + + const TRENDING_FOR_TAGS = { + title: 'Trending For Your Tags', + link: `/$/${PAGES.TAGS_FOLLOWING}`, + options: { + tags: followedTags.map(tag => tag.name), + claimType: ['stream'], + }, + }; + + const LATEST_FROM_LBRY = { + title: 'Latest From @Madiator2011', + link: `/@Madiator2011:e`, + options: { + orderBy: ['release_time'], + pageSize: 8, + channelIds: ['e15f8434e6fd76b05f0b6c2918f71a7f29b93f7e'], + }, + }; + + const LATEST_FROM_LBRYCAST = { + title: 'Latest From @blenderdumbass', + link: `/@blenderdumbass:f`, + options: { + orderBy: ['release_time'], + pageSize: 4, + channelIds: ['fd60b4b0b82f7f4e870c956ab61e9137b7c54680'], + }, + }; + +// const LINUX_CHANNEL_IDS = [ +// '5d5770bc07e5727320d5e18680867cbe47ae72bd', +// 'e5d96ea3720b01cca537c6d90f38e8c11ff06a0a', +// ]; +// const LINUXI = { +// channelIds: LINUX_CHANNEL_IDS, +// name: 'linux', +// sortOrder: 40, +// icon: 'Speaker', +// label: 'Linux', +// channelLimit: 'auto', +// daysOfContent: 180, +// pageSize: 24, +//}; + + + if (showPersonalizedChannels) rowData.push(RECENT_FROM_FOLLOWING); + if (showPersonalizedTags && !showIndividualTags) rowData.push(TRENDING_FOR_TAGS); + if (showPersonalizedTags && showIndividualTags) { + individualTagDataItems.forEach((item: RowDataItem) => { + rowData.push(item); + }); + } + rowData.push(TOP_CONTENT_TODAY); + rowData.push(LATEST_FROM_LBRY); + rowData.push(LATEST_FROM_LBRYCAST); + rowData.push(TRENDING_ON_LBRY); + rowData.push(TOP_CHANNELS); + rowData.push(TRENDING_CLASSICS); + return rowData; +} + diff --git a/v2/.gitkeep b/v2/.gitkeep deleted file mode 100644 index e69de29..0000000