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.
This commit is contained in:
infinite-persistence 2021-12-10 12:28:37 +08:00 committed by infinite-persistence
parent 0d59ce4f8c
commit 9307511c88
3 changed files with 3 additions and 4 deletions

View file

@ -1,5 +1,5 @@
// @flow // @flow
import { MAIN_CLASS } from 'component/page/view'; import { MAIN_CLASS } from 'constants/classnames';
import type { Node } from 'react'; import type { Node } from 'react';
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import classnames from 'classnames'; import classnames from 'classnames';

View file

@ -2,6 +2,7 @@
import type { Node } from 'react'; import type { Node } from 'react';
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import classnames from 'classnames'; import classnames from 'classnames';
import { MAIN_CLASS } from 'constants/classnames';
import { lazyImport } from 'util/lazyImport'; import { lazyImport } from 'util/lazyImport';
import SideNavigation from 'component/sideNavigation'; import SideNavigation from 'component/sideNavigation';
import SettingsSideNavigation from 'component/settingsSideNavigation'; import SettingsSideNavigation from 'component/settingsSideNavigation';
@ -16,12 +17,9 @@ import { parseURI } from 'util/lbryURI';
const Footer = lazyImport(() => import('web/component/footer' /* webpackChunkName: "footer" */)); const Footer = lazyImport(() => import('web/component/footer' /* webpackChunkName: "footer" */));
export const MAIN_CLASS = 'main';
type Props = { type Props = {
children: Node | Array<Node>, children: Node | Array<Node>,
className: ?string, className: ?string,
autoUpdateDownloaded: boolean,
isUpgradeAvailable: boolean,
authPage: boolean, authPage: boolean,
filePage: boolean, filePage: boolean,
settingsPage?: boolean, settingsPage?: boolean,

View file

@ -1 +1,2 @@
export const MAIN_CLASS = 'main';
export const COMMENT_HIGHLIGHTED = 'comment--highlighted'; export const COMMENT_HIGHLIGHTED = 'comment--highlighted';