From 9307511c881dfd76bb82cd62277231a6e1297a89 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Fri, 10 Dec 2021 12:28:37 +0800 Subject: [PATCH] Move MAIN_CLASS to constants file for better code-splitting. Cross-importing was making things hard to code-split efficiently, because the entire file gets evaluated when imported. --- ui/component/claimList/view.jsx | 2 +- ui/component/page/view.jsx | 4 +--- ui/constants/classnames.js | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ui/component/claimList/view.jsx b/ui/component/claimList/view.jsx index 273954e72..5ebf84990 100644 --- a/ui/component/claimList/view.jsx +++ b/ui/component/claimList/view.jsx @@ -1,5 +1,5 @@ // @flow -import { MAIN_CLASS } from 'component/page/view'; +import { MAIN_CLASS } from 'constants/classnames'; import type { Node } from 'react'; import React, { useEffect } from 'react'; import classnames from 'classnames'; diff --git a/ui/component/page/view.jsx b/ui/component/page/view.jsx index d8acf8a80..a78c397c3 100644 --- a/ui/component/page/view.jsx +++ b/ui/component/page/view.jsx @@ -2,6 +2,7 @@ import type { Node } from 'react'; import React, { Fragment } from 'react'; import classnames from 'classnames'; +import { MAIN_CLASS } from 'constants/classnames'; import { lazyImport } from 'util/lazyImport'; import SideNavigation from 'component/sideNavigation'; import SettingsSideNavigation from 'component/settingsSideNavigation'; @@ -16,12 +17,9 @@ import { parseURI } from 'util/lbryURI'; const Footer = lazyImport(() => import('web/component/footer' /* webpackChunkName: "footer" */)); -export const MAIN_CLASS = 'main'; type Props = { children: Node | Array, className: ?string, - autoUpdateDownloaded: boolean, - isUpgradeAvailable: boolean, authPage: boolean, filePage: boolean, settingsPage?: boolean, diff --git a/ui/constants/classnames.js b/ui/constants/classnames.js index f6411605b..ebd583dd8 100644 --- a/ui/constants/classnames.js +++ b/ui/constants/classnames.js @@ -1 +1,2 @@ +export const MAIN_CLASS = 'main'; export const COMMENT_HIGHLIGHTED = 'comment--highlighted';