diff --git a/static/app-strings.json b/static/app-strings.json index c2f5fc02b..d42de1470 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -2190,5 +2190,8 @@ "%totalComments% comments": "%totalComments% comments", "(%lbc_balance% available)": "(%lbc_balance% available)", "Sending...": "Sending...", + "Trending for #Art": "Trending for #Art", + "Trending for #Btc": "Trending for #Btc", + "Trending for #Music": "Trending for #Music", "--end--": "--end--" } diff --git a/ui/component/app/view.jsx b/ui/component/app/view.jsx index cfa3f701e..1bccf726b 100644 --- a/ui/component/app/view.jsx +++ b/ui/component/app/view.jsx @@ -4,8 +4,6 @@ import React, { useEffect, useRef, useState, useLayoutEffect } from 'react'; import { lazyImport } from 'util/lazyImport'; import classnames from 'classnames'; import analytics from 'analytics'; -import { buildURI, parseURI } from 'util/lbryURI'; -import { SIMPLE_SITE } from 'config'; import Router from 'component/router/index'; import ReactModal from 'react-modal'; import { openContextMenu } from 'util/context-menu'; @@ -15,45 +13,14 @@ import { withRouter } from 'react-router'; import usePrevious from 'effects/use-previous'; import REWARDS from 'rewards'; import usePersistedState from 'effects/use-persisted-state'; -import Spinner from 'component/spinner'; import LANGUAGES from 'constants/languages'; -// @if TARGET='app' import useZoom from 'effects/use-zoom'; import useHistoryNav from 'effects/use-history-nav'; -// @endif -// @if TARGET='web' -import { - useDegradedPerformance, - STATUS_OK, - STATUS_DEGRADED, - STATUS_FAILING, - STATUS_DOWN, -} from 'web/effects/use-degraded-performance'; -// @endif import LANGUAGE_MIGRATIONS from 'constants/language-migrations'; const FileDrop = lazyImport(() => import('component/fileDrop' /* webpackChunkName: "secondary" */)); const ModalRouter = lazyImport(() => import('modal/modalRouter' /* webpackChunkName: "secondary" */)); const Nag = lazyImport(() => import('component/common/nag' /* webpackChunkName: "secondary" */)); -const NagContinueFirstRun = lazyImport(() => - import('component/nagContinueFirstRun' /* webpackChunkName: "secondary" */) -); -const OpenInAppLink = lazyImport(() => import('web/component/openInAppLink' /* webpackChunkName: "secondary" */)); - -// @if TARGET='web' -const NagDataCollection = lazyImport(() => - import('web/component/nag-data-collection' /* webpackChunkName: "secondary" */) -); -const NagDegradedPerformance = lazyImport(() => - import('web/component/nag-degraded-performance' /* webpackChunkName: "secondary" */) -); -const NagNoUser = lazyImport(() => import('web/component/nag-no-user' /* webpackChunkName: "nag-no-user" */)); -const NagSunset = lazyImport(() => import('web/component/nag-sunset' /* webpackChunkName: "nag-no-user" */)); -const YoutubeWelcome = lazyImport(() => - import('web/component/youtubeReferralWelcome' /* webpackChunkName: "secondary" */) -); - -// @endif const SyncFatalError = lazyImport(() => import('component/syncFatalError' /* webpackChunkName: "syncFatalError" */)); const Yrbl = lazyImport(() => import('component/yrbl' /* webpackChunkName: "yrbl" */)); @@ -156,45 +123,26 @@ function App(props: Props) { const isRewardApproved = user && user.is_reward_approved; const previousHasVerifiedEmail = usePrevious(hasVerifiedEmail); const previousRewardApproved = usePrevious(isRewardApproved); - // @if TARGET='web' - const [showAnalyticsNag, setShowAnalyticsNag] = usePersistedState('analytics-nag', true); - const [lbryTvApiStatus, setLbryTvApiStatus] = useState(STATUS_OK); - // @endif - const { pathname, hash, search } = props.location; + const { pathname, search } = props.location; const [upgradeNagClosed, setUpgradeNagClosed] = useState(false); const [resolvedSubscriptions, setResolvedSubscriptions] = useState(false); const [sidebarOpen] = usePersistedState('sidebar', true); - const [seenSunsestMessage, setSeenSunsetMessage] = usePersistedState('lbrytv-sunset', false); const showUpgradeButton = (autoUpdateDownloaded || (process.platform === 'linux' && isUpgradeAvailable)) && !upgradeNagClosed; // referral claiming const referredRewardAvailable = rewards && rewards.some((reward) => reward.reward_type === REWARDS.TYPE_REFEREE); const urlParams = new URLSearchParams(search); const rawReferrerParam = urlParams.get('r'); - const fromLbrytvParam = urlParams.get('sunset'); const sanitizedReferrerParam = rawReferrerParam && rawReferrerParam.replace(':', '#'); - const shouldHideNag = pathname.startsWith(`/$/${PAGES.EMBED}`) || pathname.startsWith(`/$/${PAGES.AUTH_VERIFY}`); const userId = user && user.id; const useCustomScrollbar = !IS_MAC; const hasMyChannels = myChannelUrls && myChannelUrls.length > 0; const hasNoChannels = myChannelUrls && myChannelUrls.length === 0; const shouldMigrateLanguage = LANGUAGE_MIGRATIONS[language]; const hasActiveChannelClaim = activeChannelClaim !== undefined; - const isPersonalized = !IS_WEB || hasVerifiedEmail; - const renderFiledrop = !IS_WEB || isAuthenticated; + const isPersonalized = hasVerifiedEmail; + const renderFiledrop = isAuthenticated; - let uri; - try { - const newpath = buildURI(parseURI(pathname.slice(1).replace(/:/g, '#'))); - uri = newpath + hash; - } catch (e) {} - - // @if TARGET='web' - function handleAnalyticsDismiss() { - setShowAnalyticsNag(false); - } - - // @endif useEffect(() => { if (userId) { analytics.setUser(userId); @@ -325,23 +273,6 @@ function App(props: Props) { } }, [previousRewardApproved, isRewardApproved]); - // Load IMA3 SDK for aniview: DISABLED FOR NOW - // @if TARGET='web' - // useEffect(() => { - // if (ENABLE_PREROLL_ADS) { - // const script = document.createElement('script'); - // script.src = `https://imasdk.googleapis.com/js/sdkloader/ima3.js`; - // script.async = true; - // // $FlowFixMe - // document.body.appendChild(script); - // return () => { - // // $FlowFixMe - // document.body.removeChild(script); - // }; - // } - // }); - // @endif - // @if TARGET='app' useEffect(() => { if (updatePreferences && getWalletSyncPref && readyForPrefs) { @@ -357,19 +288,10 @@ function App(props: Props) { // ready for sync syncs, however after signin when hasVerifiedEmail, that syncs too. useEffect(() => { // signInSyncPref is cleared after sharedState loop. - const syncLoopWithoutInterval = () => syncLoop(true); if (readyForSync && hasVerifiedEmail) { // In case we are syncing. syncLoop(); - // @if TARGET='web' - window.addEventListener('focus', syncLoopWithoutInterval); - // @endif } - // @if TARGET='web' - return () => { - window.removeEventListener('focus', syncLoopWithoutInterval); - }; - // @endif }, [readyForSync, hasVerifiedEmail, syncLoop]); // We know someone is logging in or not when we get their user object @@ -407,31 +329,10 @@ function App(props: Props) { } }, [sidebarOpen, isPersonalized, resolvedSubscriptions, subscriptions, resolveUris, setResolvedSubscriptions]); - // @if TARGET='web' - useDegradedPerformance(setLbryTvApiStatus, user); - // @endif - - // @if TARGET='web' - // Require an internal-api user on lbry.tv - // This also prevents the site from loading in the un-authed state while we wait for internal-apis to return for the first time - // It's not needed on desktop since there is no un-authed state - if (user === undefined) { - return ( -
- -
- ); - } - // @endif - if (syncFatalError) { return ( - + ); } @@ -447,54 +348,26 @@ function App(props: Props) { ref={appRef} onContextMenu={IS_WEB ? undefined : (e) => openContextMenu(e)} > - {IS_WEB && lbryTvApiStatus === STATUS_DOWN ? ( - - + + + {renderFiledrop && } + + + + {isEnhancedLayout && } + + {/* @if TARGET='app' */} + {showUpgradeButton && ( + setUpgradeNagClosed(true)} /> - - ) : ( - - - - - {renderFiledrop && } - - - - {isEnhancedLayout && } - - {/* @if TARGET='app' */} - {showUpgradeButton && ( - setUpgradeNagClosed(true)} - /> - )} - {/* @endif */} - - {/* @if TARGET='web' */} - - {!SIMPLE_SITE && !shouldHideNag && } - {!shouldHideNag && } - {fromLbrytvParam && !seenSunsestMessage && !shouldHideNag && ( - setSeenSunsetMessage(true)} /> - )} - {(lbryTvApiStatus === STATUS_DEGRADED || lbryTvApiStatus === STATUS_FAILING) && !shouldHideNag && ( - setLbryTvApiStatus(STATUS_OK)} /> - )} - {!SIMPLE_SITE && lbryTvApiStatus === STATUS_OK && showAnalyticsNag && !shouldHideNag && ( - - )} - {user === null && } - {/* @endif */} - - - )} + )} + {/* @endif */} + ); } diff --git a/ui/component/channelAbout/view.jsx b/ui/component/channelAbout/view.jsx index 711dd49ef..a49adff3d 100644 --- a/ui/component/channelAbout/view.jsx +++ b/ui/component/channelAbout/view.jsx @@ -1,11 +1,8 @@ // @flow -import { SIMPLE_SITE } from 'config'; import React, { Fragment } from 'react'; import MarkdownPreview from 'component/common/markdown-preview'; import ClaimTags from 'component/claimTags'; import CreditAmount from 'component/common/credit-amount'; -import Button from 'component/button'; -import * as PAGES from 'constants/pages'; import DateTime from 'component/dateTime'; import YoutubeBadge from 'component/youtubeBadge'; import SUPPORTED_LANGUAGES from 'constants/supported_languages'; @@ -101,15 +98,6 @@ function ChannelAbout(props: Props) { amount={parseFloat(claim.amount) + parseFloat(claim.meta.support_amount)} precision={8} />{' '} - {SIMPLE_SITE && ( -