diff --git a/ui/component/app/view.jsx b/ui/component/app/view.jsx index 1bccf726b..9ea9a5c4d 100644 --- a/ui/component/app/view.jsx +++ b/ui/component/app/view.jsx @@ -1,7 +1,6 @@ // @flow import * as PAGES from 'constants/pages'; import React, { useEffect, useRef, useState, useLayoutEffect } from 'react'; -import { lazyImport } from 'util/lazyImport'; import classnames from 'classnames'; import analytics from 'analytics'; import Router from 'component/router/index'; @@ -18,12 +17,12 @@ import useZoom from 'effects/use-zoom'; import useHistoryNav from 'effects/use-history-nav'; 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" */)); +import FileDrop from 'component/fileDrop'; +import ModalRouter from 'modal/modalRouter'; +import Nag from 'component/common/nag'; -const SyncFatalError = lazyImport(() => import('component/syncFatalError' /* webpackChunkName: "syncFatalError" */)); -const Yrbl = lazyImport(() => import('component/yrbl' /* webpackChunkName: "yrbl" */)); +import SyncFatalError from 'component/syncFatalError'; +import Yrbl from 'component/yrbl'; // **************************************************************************** @@ -330,44 +329,32 @@ function App(props: Props) { }, [sidebarOpen, isPersonalized, resolvedSubscriptions, subscriptions, resolveUris, setResolvedSubscriptions]); if (syncFatalError) { - return ( - - - - ); + return ; } return (
openContextMenu(e)} > - - - {renderFiledrop && } - + + {renderFiledrop && } - - {isEnhancedLayout && } + {isEnhancedLayout && } - {/* @if TARGET='app' */} - {showUpgradeButton && ( - setUpgradeNagClosed(true)} - /> - )} - {/* @endif */} - + {showUpgradeButton && ( + setUpgradeNagClosed(true)} + /> + )}
); } diff --git a/ui/component/claimPreview/view.jsx b/ui/component/claimPreview/view.jsx index 68349c139..38ce66c9c 100644 --- a/ui/component/claimPreview/view.jsx +++ b/ui/component/claimPreview/view.jsx @@ -3,7 +3,6 @@ import type { Node } from 'react'; import React, { useEffect, forwardRef } from 'react'; import { NavLink, withRouter } from 'react-router-dom'; import { isEmpty } from 'util/object'; -import { lazyImport } from 'util/lazyImport'; import classnames from 'classnames'; import { isURIEqual, isURIValid } from 'util/lbryURI'; import * as COLLECTIONS_CONSTS from 'constants/collections'; @@ -31,9 +30,7 @@ import { ENABLE_NO_SOURCE_CLAIMS } from 'config'; import Button from 'component/button'; import * as ICONS from 'constants/icons'; -const AbandonedChannelPreview = lazyImport(() => - import('component/abandonedChannelPreview' /* webpackChunkName: "abandonedChannelPreview" */) -); +import AbandonedChannelPreview from 'component/abandonedChannelPreview'; // preview images used on the landing page and on the channel page type Props = { @@ -326,11 +323,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { } if (!shouldFetch && showUnresolvedClaim && !isResolvingUri && isChannelUri && claim === null) { - return ( - - - - ); + return ; } if (placeholder === 'publish' && !claim && uri.startsWith('lbry://@')) { return null; diff --git a/ui/component/fileRender/view.jsx b/ui/component/fileRender/view.jsx index 5a946f868..19fa61983 100644 --- a/ui/component/fileRender/view.jsx +++ b/ui/component/fileRender/view.jsx @@ -1,7 +1,6 @@ // @flow import { remote } from 'electron'; import React from 'react'; -import { lazyImport } from 'util/lazyImport'; import classnames from 'classnames'; import * as RENDER_MODES from 'constants/file_render_modes'; import * as KEYCODES from 'constants/keycodes'; @@ -12,17 +11,15 @@ import analytics from 'analytics'; import DocumentViewer from 'component/viewers/documentViewer'; -// @if TARGET='app' // should match import DocxViewer from 'component/viewers/docxViewer'; import ComicBookViewer from 'component/viewers/comicBookViewer'; import ThreeViewer from 'component/viewers/threeViewer'; -// @endif -const AppViewer = lazyImport(() => import('component/viewers/appViewer' /* webpackChunkName: "appViewer" */)); -const HtmlViewer = lazyImport(() => import('component/viewers/htmlViewer' /* webpackChunkName: "htmlViewer" */)); -const ImageViewer = lazyImport(() => import('component/viewers/imageViewer' /* webpackChunkName: "imageViewer" */)); -const PdfViewer = lazyImport(() => import('component/viewers/pdfViewer' /* webpackChunkName: "pdfViewer" */)); +import AppViewer from 'component/viewers/appViewer'; +import HtmlViewer from 'component/viewers/htmlViewer'; +import ImageViewer from 'component/viewers/imageViewer'; +import PdfViewer from 'component/viewers/pdfViewer'; type Props = { uri: string, @@ -96,17 +93,9 @@ class FileRender extends React.PureComponent { /> ); case RENDER_MODES.IMAGE: - return ( - - - - ); + return ; case RENDER_MODES.HTML: - return ( - - - - ); + return ; case RENDER_MODES.DOCUMENT: case RENDER_MODES.MARKDOWN: return ( @@ -126,11 +115,7 @@ class FileRender extends React.PureComponent { case RENDER_MODES.DOCX: return ; case RENDER_MODES.PDF: - return ( - - - - ); + return ; case RENDER_MODES.CAD: return ( { /> ); case RENDER_MODES.APPLICATION: - return ( - - - - ); + return ; } return null; diff --git a/ui/component/router/view.jsx b/ui/component/router/view.jsx index 1d674485e..a9a0b6609 100644 --- a/ui/component/router/view.jsx +++ b/ui/component/router/view.jsx @@ -4,85 +4,75 @@ import { Route, Redirect, Switch, withRouter } from 'react-router-dom'; import * as PAGES from 'constants/pages'; import { PAGE_TITLE } from 'constants/pageTitles'; -import { lazyImport } from 'util/lazyImport'; import { LINKED_COMMENT_QUERY_PARAM } from 'constants/comment'; import { parseURI, isURIValid } from 'util/lbryURI'; import { SITE_TITLE, WELCOME_VERSION } from 'config'; -import LoadingBarOneOff from 'component/loadingBarOneOff'; import { GetLinksData } from 'util/buildHomepage'; import HomePage from 'page/home'; - -// @if TARGET='app' -const BackupPage = lazyImport(() => import('page/backup' /* webpackChunkName: "backup" */)); -// @endif +import BackupPage from 'page/backup'; // Chunk: "secondary" -const SignInPage = lazyImport(() => import('page/signIn' /* webpackChunkName: "secondary" */)); -const SignInWalletPasswordPage = lazyImport(() => - import('page/signInWalletPassword' /* webpackChunkName: "secondary" */) -); -const SignUpPage = lazyImport(() => import('page/signUp' /* webpackChunkName: "secondary" */)); -const SignInVerifyPage = lazyImport(() => import('page/signInVerify' /* webpackChunkName: "secondary" */)); +import SignInPage from 'page/signIn'; +import SignInWalletPasswordPage from 'page/signInWalletPassword'; + +import SignUpPage from 'page/signUp'; +import SignInVerifyPage from 'page/signInVerify'; // Chunk: "wallet/secondary" -const BuyPage = lazyImport(() => import('page/buy' /* webpackChunkName: "secondary" */)); -const ReceivePage = lazyImport(() => import('page/receive' /* webpackChunkName: "secondary" */)); -const SendPage = lazyImport(() => import('page/send' /* webpackChunkName: "secondary" */)); -const SwapPage = lazyImport(() => import('page/swap' /* webpackChunkName: "secondary" */)); -const WalletPage = lazyImport(() => import('page/wallet' /* webpackChunkName: "secondary" */)); +import BuyPage from 'page/buy'; +import ReceivePage from 'page/receive'; +import SendPage from 'page/send'; +import SwapPage from 'page/swap'; +import WalletPage from 'page/wallet'; // Chunk: none -const NotificationsPage = lazyImport(() => import('page/notifications' /* webpackChunkName: "secondary" */)); -const CollectionPage = lazyImport(() => import('page/collection' /* webpackChunkName: "secondary" */)); -const ChannelNew = lazyImport(() => import('page/channelNew' /* webpackChunkName: "secondary" */)); -const ChannelsFollowingDiscoverPage = lazyImport(() => - import('page/channelsFollowingDiscover' /* webpackChunkName: "secondary" */) -); -const ChannelsFollowingPage = lazyImport(() => import('page/channelsFollowing' /* webpackChunkName: "secondary" */)); -const ChannelsPage = lazyImport(() => import('page/channels' /* webpackChunkName: "secondary" */)); -const CheckoutPage = lazyImport(() => import('page/checkoutPage' /* webpackChunkName: "checkoutPage" */)); -const CreatorDashboard = lazyImport(() => import('page/creatorDashboard' /* webpackChunkName: "secondary" */)); -const DiscoverPage = lazyImport(() => import('page/discover' /* webpackChunkName: "secondary" */)); -const EmbedWrapperPage = lazyImport(() => import('page/embedWrapper' /* webpackChunkName: "secondary" */)); -const FileListPublished = lazyImport(() => import('page/fileListPublished' /* webpackChunkName: "secondary" */)); -const FourOhFourPage = lazyImport(() => import('page/fourOhFour' /* webpackChunkName: "fourOhFour" */)); -const HelpPage = lazyImport(() => import('page/help' /* webpackChunkName: "help" */)); -const InvitePage = lazyImport(() => import('page/invite' /* webpackChunkName: "secondary" */)); -const InvitedPage = lazyImport(() => import('page/invited' /* webpackChunkName: "secondary" */)); -const LibraryPage = lazyImport(() => import('page/library' /* webpackChunkName: "secondary" */)); -const ListBlockedPage = lazyImport(() => import('page/listBlocked' /* webpackChunkName: "secondary" */)); -const ListsPage = lazyImport(() => import('page/lists' /* webpackChunkName: "secondary" */)); -const LiveStreamSetupPage = lazyImport(() => import('page/livestreamSetup' /* webpackChunkName: "secondary" */)); -const LivestreamCurrentPage = lazyImport(() => import('page/livestreamCurrent' /* webpackChunkName: "secondary" */)); -const OwnComments = lazyImport(() => import('page/ownComments' /* webpackChunkName: "ownComments" */)); -const PasswordResetPage = lazyImport(() => import('page/passwordReset' /* webpackChunkName: "secondary" */)); -const PasswordSetPage = lazyImport(() => import('page/passwordSet' /* webpackChunkName: "secondary" */)); -const PublishPage = lazyImport(() => import('page/publish' /* webpackChunkName: "secondary" */)); -const ReportContentPage = lazyImport(() => import('page/reportContent' /* webpackChunkName: "secondary" */)); -const ReportPage = lazyImport(() => import('page/report' /* webpackChunkName: "secondary" */)); -const RepostNew = lazyImport(() => import('page/repost' /* webpackChunkName: "secondary" */)); -const RewardsPage = lazyImport(() => import('page/rewards' /* webpackChunkName: "secondary" */)); -const RewardsVerifyPage = lazyImport(() => import('page/rewardsVerify' /* webpackChunkName: "secondary" */)); -const SearchPage = lazyImport(() => import('page/search' /* webpackChunkName: "secondary" */)); -const SettingsStripeCard = lazyImport(() => import('page/settingsStripeCard' /* webpackChunkName: "secondary" */)); -const SettingsStripeAccount = lazyImport(() => - import('page/settingsStripeAccount' /* webpackChunkName: "secondary" */) -); -const SettingsCreatorPage = lazyImport(() => import('page/settingsCreator' /* webpackChunkName: "secondary" */)); -const SettingsNotificationsPage = lazyImport(() => - import('page/settingsNotifications' /* webpackChunkName: "secondary" */) -); -const SettingsPage = lazyImport(() => import('page/settings' /* webpackChunkName: "secondary" */)); -const ShowPage = lazyImport(() => import('page/show' /* webpackChunkName: "secondary" */)); -const TagsFollowingManagePage = lazyImport(() => - import('page/tagsFollowingManage' /* webpackChunkName: "secondary" */) -); -const TagsFollowingPage = lazyImport(() => import('page/tagsFollowing' /* webpackChunkName: "secondary" */)); -const TopPage = lazyImport(() => import('page/top' /* webpackChunkName: "secondary" */)); -const UpdatePasswordPage = lazyImport(() => import('page/passwordUpdate' /* webpackChunkName: "passwordUpdate" */)); -const Welcome = lazyImport(() => import('page/welcome' /* webpackChunkName: "secondary" */)); -const YoutubeSyncPage = lazyImport(() => import('page/youtubeSync' /* webpackChunkName: "secondary" */)); +import NotificationsPage from 'page/notifications'; +import CollectionPage from 'page/collection'; +import ChannelNew from 'page/channelNew'; +import ChannelsFollowingDiscoverPage from 'page/channelsFollowingDiscover'; + +import ChannelsFollowingPage from 'page/channelsFollowing'; +import ChannelsPage from 'page/channels'; +import CheckoutPage from 'page/checkoutPage'; +import CreatorDashboard from 'page/creatorDashboard'; +import DiscoverPage from 'page/discover'; +import EmbedWrapperPage from 'page/embedWrapper'; +import FileListPublished from 'page/fileListPublished'; +import FourOhFourPage from 'page/fourOhFour'; +import HelpPage from 'page/help'; +import InvitePage from 'page/invite'; +import InvitedPage from 'page/invited'; +import LibraryPage from 'page/library'; +import ListBlockedPage from 'page/listBlocked'; +import ListsPage from 'page/lists'; +import LiveStreamSetupPage from 'page/livestreamSetup'; +import LivestreamCurrentPage from 'page/livestreamCurrent'; +import OwnComments from 'page/ownComments'; +import PasswordResetPage from 'page/passwordReset'; +import PasswordSetPage from 'page/passwordSet'; +import PublishPage from 'page/publish'; +import ReportContentPage from 'page/reportContent'; +import ReportPage from 'page/report'; +import RepostNew from 'page/repost'; +import RewardsPage from 'page/rewards'; +import RewardsVerifyPage from 'page/rewardsVerify'; +import SearchPage from 'page/search'; +import SettingsStripeCard from 'page/settingsStripeCard'; +import SettingsStripeAccount from 'page/settingsStripeAccount'; + +import SettingsCreatorPage from 'page/settingsCreator'; +import SettingsNotificationsPage from 'page/settingsNotifications'; + +import SettingsPage from 'page/settings'; +import ShowPage from 'page/show'; +import TagsFollowingManagePage from 'page/tagsFollowingManage'; + +import TagsFollowingPage from 'page/tagsFollowing'; +import TopPage from 'page/top'; +import UpdatePasswordPage from 'page/passwordUpdate'; +import Welcome from 'page/welcome'; +import YoutubeSyncPage from 'page/youtubeSync'; // Tell the browser we are handling scroll restoration if ('scrollRestoration' in history) { @@ -237,105 +227,103 @@ function AppRouter(props: Props) { } return ( - }> - - {/* @if TARGET='app' */} - {welcomeVersion < WELCOME_VERSION && } - {/* @endif */} - + {/* @if TARGET='app' */} + {welcomeVersion < WELCOME_VERSION && } + {/* @endif */} + + + + + + + + + + {/* $FlowFixMe */} + {dynamicRoutes.map((dynamicRouteProps: RowDataItem) => ( + } /> - - - - - + ))} - - - {/* $FlowFixMe */} - {dynamicRoutes.map((dynamicRouteProps: RowDataItem) => ( - } - /> - ))} + + + + + + - - - - - - + + {/* @if TARGET='app' */} + + {/* @endif */} + + + + + + + + - - {/* @if TARGET='app' */} - - {/* @endif */} - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - {/* Below need to go at the end to make sure we don't match any of our pages first */} - - - - - + {/* Below need to go at the end to make sure we don't match any of our pages first */} + + + + ); } diff --git a/ui/component/wunderbar/view.jsx b/ui/component/wunderbar/view.jsx index 22fb78d20..1ae053929 100644 --- a/ui/component/wunderbar/view.jsx +++ b/ui/component/wunderbar/view.jsx @@ -1,12 +1,10 @@ // @flow import * as ICONS from 'constants/icons'; import React from 'react'; -import { lazyImport } from 'util/lazyImport'; import { useIsMobile } from 'effects/use-screensize'; -const Button = lazyImport(() => import('component/button' /* webpackChunkName: "button" */)); -const Icon = lazyImport(() => import('component/common/icon' /* webpackChunkName: "icon" */)); -const WunderbarSuggestions = lazyImport(() => import('component/wunderbarSuggestions' /* webpackChunkName: "secondary" */)); +import Button from 'component/button'; +import WunderbarSuggestions from 'component/wunderbarSuggestions'; type Props = { doOpenMobileSearch: (any) => void, @@ -21,27 +19,13 @@ export default function WunderBar(props: Props) { const isMobile = useIsMobile(); return isMobile ? ( - -