From 3784ec9e21cd7fee212519b0f3d76532e6b012ed Mon Sep 17 00:00:00 2001 From: zeppi Date: Thu, 21 Oct 2021 16:56:15 -0400 Subject: [PATCH] remove lbryinc web, update sitename, etc --- .env.defaults | 6 +- extras/lbryinc/index.js | 15 ---- extras/lbryinc/redux/actions/homepage.js | 79 ------------------- extras/lbryinc/redux/actions/web.js | 12 --- extras/lbryinc/redux/reducers/homepage.js | 48 ----------- extras/lbryinc/redux/reducers/web.js | 62 --------------- extras/lbryinc/redux/selectors/homepage.js | 17 ---- extras/lbryinc/redux/selectors/web.js | 10 --- static/app-strings.json | 1 + ui/component/app/index.js | 2 - ui/component/sideNavigation/view.jsx | 2 +- ui/component/webUploadList/index.js | 13 --- .../internal/web-upload-item.jsx | 41 ---------- ui/component/webUploadList/view.jsx | 36 --------- ui/page/fileListPublished/index.js | 2 - ui/page/fileListPublished/view.jsx | 17 +--- ui/reducers.js | 3 +- 17 files changed, 8 insertions(+), 358 deletions(-) delete mode 100644 extras/lbryinc/redux/actions/homepage.js delete mode 100644 extras/lbryinc/redux/actions/web.js delete mode 100644 extras/lbryinc/redux/reducers/homepage.js delete mode 100644 extras/lbryinc/redux/reducers/web.js delete mode 100644 extras/lbryinc/redux/selectors/homepage.js delete mode 100644 extras/lbryinc/redux/selectors/web.js delete mode 100644 ui/component/webUploadList/index.js delete mode 100644 ui/component/webUploadList/internal/web-upload-item.jsx delete mode 100644 ui/component/webUploadList/view.jsx diff --git a/.env.defaults b/.env.defaults index 9647e7e04..8aa09d98e 100644 --- a/.env.defaults +++ b/.env.defaults @@ -35,11 +35,11 @@ SITE_CANONICAL_URL=https://lbry.tv ## Custom Site info DOMAIN=lbry.tv URL=https://lbry.tv -SITE_TITLE=lbry.tv -SITE_NAME=lbry.tv +SITE_TITLE=LBRY +SITE_NAME=LBRY SITE_DESCRIPTION=Meet LBRY, an open, free, and community-controlled content wonderland. SITE_HELP_EMAIL=help@lbry.com -LOGO_TITLE=lbry.tv +LOGO_TITLE=LBRY ## Social media TWITTER_ACCOUNT=LBRYcom BRANDED_SITE=odysee diff --git a/extras/lbryinc/index.js b/extras/lbryinc/index.js index b68d006e6..1b23baae0 100644 --- a/extras/lbryinc/index.js +++ b/extras/lbryinc/index.js @@ -5,10 +5,6 @@ import Lbryio from './lbryio'; export { Lbryio }; -export function testTheThing() { - console.log('tested'); -} - // constants export { LBRYINC_ACTIONS, YOUTUBE_STATUSES, ERRORS }; @@ -20,7 +16,6 @@ export { doGenerateAuthToken } from './redux/actions/auth'; export { doFetchCostInfoForUri } from './redux/actions/cost_info'; export { doBlackListedOutpointsSubscribe } from './redux/actions/blacklist'; export { doFilteredOutpointsSubscribe } from './redux/actions/filtered'; -// export { doFetchFeaturedUris, doFetchTrendingUris } from './redux/actions/homepage'; export { doFetchViewCount, doFetchSubCount } from './redux/actions/stats'; export { doCheckSync, @@ -31,17 +26,14 @@ export { doResetSync, doSyncEncryptAndDecrypt, } from 'redux/actions/sync'; -export { doUpdateUploadProgress } from './redux/actions/web'; // reducers export { authReducer } from './redux/reducers/auth'; export { costInfoReducer } from './redux/reducers/cost_info'; export { blacklistReducer } from './redux/reducers/blacklist'; export { filteredReducer } from './redux/reducers/filtered'; -// export { homepageReducer } from './redux/reducers/homepage'; export { statsReducer } from './redux/reducers/stats'; export { syncReducer } from './redux/reducers/sync'; -export { webReducer } from './redux/reducers/web'; // selectors export { selectAuthToken, selectIsAuthenticating } from './redux/selectors/auth'; @@ -56,12 +48,6 @@ export { selectBlacklistedOutpointMap, } from './redux/selectors/blacklist'; export { selectFilteredOutpoints, selectFilteredOutpointMap } from './redux/selectors/filtered'; -// export { -// selectFeaturedUris, -// selectFetchingFeaturedUris, -// selectTrendingUris, -// selectFetchingTrendingUris, -// } from './redux/selectors/homepage'; export { selectViewCount, makeSelectViewCountForUri, @@ -80,4 +66,3 @@ export { selectSyncApplyErrorMessage, selectSyncApplyPasswordError, } from './redux/selectors/sync'; -export { selectCurrentUploads, selectUploadCount } from './redux/selectors/web'; diff --git a/extras/lbryinc/redux/actions/homepage.js b/extras/lbryinc/redux/actions/homepage.js deleted file mode 100644 index 41de4a2bd..000000000 --- a/extras/lbryinc/redux/actions/homepage.js +++ /dev/null @@ -1,79 +0,0 @@ -import { Lbryio } from 'lbryinc'; -import { batchActions } from 'util/batch-actions'; -import { doResolveUris } from 'util/lbryURI'; -import * as ACTIONS from 'constants/action_types'; - -export function doFetchFeaturedUris(offloadResolve = false) { - return dispatch => { - dispatch({ - type: ACTIONS.FETCH_FEATURED_CONTENT_STARTED, - }); - - const success = ({ Uris }) => { - let urisToResolve = []; - Object.keys(Uris).forEach(category => { - urisToResolve = [...urisToResolve, ...Uris[category]]; - }); - - const actions = [ - { - type: ACTIONS.FETCH_FEATURED_CONTENT_COMPLETED, - data: { - uris: Uris, - success: true, - }, - }, - ]; - if (urisToResolve.length && !offloadResolve) { - actions.push(doResolveUris(urisToResolve)); - } - - dispatch(batchActions(...actions)); - }; - - const failure = () => { - dispatch({ - type: ACTIONS.FETCH_FEATURED_CONTENT_COMPLETED, - data: { - uris: {}, - }, - }); - }; - - Lbryio.call('file', 'list_homepage').then(success, failure); - }; -} - -export function doFetchTrendingUris() { - return dispatch => { - dispatch({ - type: ACTIONS.FETCH_TRENDING_CONTENT_STARTED, - }); - - const success = data => { - const urisToResolve = data.map(uri => uri.url); - const actions = [ - doResolveUris(urisToResolve), - { - type: ACTIONS.FETCH_TRENDING_CONTENT_COMPLETED, - data: { - uris: data, - success: true, - }, - }, - ]; - dispatch(batchActions(...actions)); - }; - - const failure = () => { - dispatch({ - type: ACTIONS.FETCH_TRENDING_CONTENT_COMPLETED, - data: { - uris: [], - }, - }); - }; - - Lbryio.call('file', 'list_trending').then(success, failure); - }; -} diff --git a/extras/lbryinc/redux/actions/web.js b/extras/lbryinc/redux/actions/web.js deleted file mode 100644 index 1bcce69a5..000000000 --- a/extras/lbryinc/redux/actions/web.js +++ /dev/null @@ -1,12 +0,0 @@ -// @flow -import * as ACTIONS from 'constants/action_types'; - -export const doUpdateUploadProgress = ( - progress: string, - params: { [key: string]: any }, - xhr: any -) => (dispatch: Dispatch) => - dispatch({ - type: ACTIONS.UPDATE_UPLOAD_PROGRESS, - data: { progress, params, xhr }, - }); diff --git a/extras/lbryinc/redux/reducers/homepage.js b/extras/lbryinc/redux/reducers/homepage.js deleted file mode 100644 index 912bf4f32..000000000 --- a/extras/lbryinc/redux/reducers/homepage.js +++ /dev/null @@ -1,48 +0,0 @@ -import { handleActions } from 'util/redux-utils'; -import * as ACTIONS from 'constants/action_types'; - -const defaultState = { - fetchingFeaturedContent: false, - fetchingFeaturedContentFailed: false, - featuredUris: undefined, - fetchingTrendingContent: false, - fetchingTrendingContentFailed: false, - trendingUris: undefined, -}; - -export const homepageReducer = handleActions( - { - [ACTIONS.FETCH_FEATURED_CONTENT_STARTED]: state => ({ - ...state, - fetchingFeaturedContent: true, - }), - - [ACTIONS.FETCH_FEATURED_CONTENT_COMPLETED]: (state, action) => { - const { uris, success } = action.data; - - return { - ...state, - fetchingFeaturedContent: false, - fetchingFeaturedContentFailed: !success, - featuredUris: uris, - }; - }, - - [ACTIONS.FETCH_TRENDING_CONTENT_STARTED]: state => ({ - ...state, - fetchingTrendingContent: true, - }), - - [ACTIONS.FETCH_TRENDING_CONTENT_COMPLETED]: (state, action) => { - const { uris, success } = action.data; - - return { - ...state, - fetchingTrendingContent: false, - fetchingTrendingContentFailed: !success, - trendingUris: uris, - }; - }, - }, - defaultState -); diff --git a/extras/lbryinc/redux/reducers/web.js b/extras/lbryinc/redux/reducers/web.js deleted file mode 100644 index 7cb9f674d..000000000 --- a/extras/lbryinc/redux/reducers/web.js +++ /dev/null @@ -1,62 +0,0 @@ -// @flow -import * as ACTIONS from 'constants/action_types'; - -/* -test mock: - currentUploads: { - 'test#upload': { - progress: 50, - params: { - name: 'steve', - thumbnail_url: 'https://dev2.spee.ch/4/KMNtoSZ009fawGz59VG8PrID.jpeg', - }, - }, - }, - */ - -export type Params = { - channel?: string, - name: string, - thumbnail_url: ?string, - title: ?string, -}; - -export type UploadItem = { - progess: string, - params: Params, - xhr?: any, -}; - -export type TvState = { - currentUploads: { [key: string]: UploadItem }, -}; - -const reducers = {}; - -const defaultState: TvState = { - currentUploads: {}, -}; - -reducers[ACTIONS.UPDATE_UPLOAD_PROGRESS] = (state: TvState, action) => { - const { progress, params, xhr } = action.data; - const key = params.channel ? `${params.name}#${params.channel}` : `${params.name}#anonymous`; - let currentUploads; - if (!progress) { - currentUploads = Object.assign({}, state.currentUploads); - Object.keys(currentUploads).forEach(k => { - if (k === key) { - delete currentUploads[key]; - } - }); - } else { - currentUploads = Object.assign({}, state.currentUploads); - currentUploads[key] = { progress, params, xhr }; - } - return { ...state, currentUploads }; -}; - -export function webReducer(state: TvState = defaultState, action: any) { - const handler = reducers[action.type]; - if (handler) return handler(state, action); - return state; -} diff --git a/extras/lbryinc/redux/selectors/homepage.js b/extras/lbryinc/redux/selectors/homepage.js deleted file mode 100644 index 710058cbc..000000000 --- a/extras/lbryinc/redux/selectors/homepage.js +++ /dev/null @@ -1,17 +0,0 @@ -import { createSelector } from 'reselect'; - -const selectState = state => state.homepage || {}; - -export const selectFeaturedUris = createSelector(selectState, state => state.featuredUris); - -export const selectFetchingFeaturedUris = createSelector( - selectState, - state => state.fetchingFeaturedContent -); - -export const selectTrendingUris = createSelector(selectState, state => state.trendingUris); - -export const selectFetchingTrendingUris = createSelector( - selectState, - state => state.fetchingTrendingContent -); diff --git a/extras/lbryinc/redux/selectors/web.js b/extras/lbryinc/redux/selectors/web.js deleted file mode 100644 index 54ac3ec4e..000000000 --- a/extras/lbryinc/redux/selectors/web.js +++ /dev/null @@ -1,10 +0,0 @@ -import { createSelector } from 'reselect'; - -const selectState = state => state.web || {}; - -export const selectCurrentUploads = createSelector(selectState, state => state.currentUploads); - -export const selectUploadCount = createSelector( - selectCurrentUploads, - currentUploads => currentUploads && Object.keys(currentUploads).length -); diff --git a/static/app-strings.json b/static/app-strings.json index 4ba96f4db..f42efe9a4 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -2194,5 +2194,6 @@ "Trending for #Btc": "Trending for #Btc", "Trending for #Music": "Trending for #Music", "You sent %lbc% as a tip, Mahalo!": "You sent %lbc% as a tip, Mahalo!", + "Export All": "Export All", "--end--": "--end--" } diff --git a/ui/component/app/index.js b/ui/component/app/index.js index 457b1886f..882bc9fec 100644 --- a/ui/component/app/index.js +++ b/ui/component/app/index.js @@ -1,6 +1,5 @@ import { hot } from 'react-hot-loader/root'; import { connect } from 'react-redux'; -import { selectUploadCount } from 'lbryinc'; import { selectGetSyncErrorMessage, selectSyncFatalError } from 'redux/selectors/sync'; import { doFetchAccessToken, doUserSetReferrer } from 'redux/actions/user'; import { selectUser, selectAccessToken, selectUserVerifiedEmail } from 'redux/selectors/user'; @@ -43,7 +42,6 @@ const select = (state) => ({ autoUpdateDownloaded: selectAutoUpdateDownloaded(state), isUpgradeAvailable: selectIsUpgradeAvailable(state), syncError: selectGetSyncErrorMessage(state), - uploadCount: selectUploadCount(state), rewards: selectUnclaimedRewards(state), isAuthenticated: selectUserVerifiedEmail(state), currentModal: selectModal(state), diff --git a/ui/component/sideNavigation/view.jsx b/ui/component/sideNavigation/view.jsx index 1a6f6d413..b2c10b8c4 100644 --- a/ui/component/sideNavigation/view.jsx +++ b/ui/component/sideNavigation/view.jsx @@ -272,7 +272,7 @@ function SideNavigation(props: Props) {