mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-15 15:10:31 -08:00
refactor: lazy load renderer pages
This commit is contained in:
parent
70f0aa5c3e
commit
2245fcd63a
2 changed files with 11 additions and 8 deletions
|
|
@ -1,12 +1,15 @@
|
|||
/* eslint-disable @typescript-eslint/promise-function-async */
|
||||
import { WindowNames } from '@services/windows/WindowProperties';
|
||||
import { lazy } from 'react';
|
||||
|
||||
const AboutPage = lazy(() => import('./About'));
|
||||
const DialogAddWorkspace = lazy(() => import('./AddWorkspace').then((module) => ({ default: module.AddWorkspace })));
|
||||
const EditWorkspace = lazy(() => import('./EditWorkspace'));
|
||||
const Main = lazy(() => import('./Main'));
|
||||
const DialogNotifications = lazy(() => import('./Notifications'));
|
||||
const DialogPreferences = lazy(() => import('./Preferences'));
|
||||
const SpellcheckLanguages = lazy(() => import('./SpellcheckLanguages'));
|
||||
|
||||
import AboutPage from './About';
|
||||
import { AddWorkspace as DialogAddWorkspace } from './AddWorkspace';
|
||||
import EditWorkspace from './EditWorkspace';
|
||||
import Main from './Main';
|
||||
import DialogNotifications from './Notifications';
|
||||
import DialogPreferences from './Preferences';
|
||||
import SpellcheckLanguages from './SpellcheckLanguages';
|
||||
|
||||
export function Pages(): JSX.Element {
|
||||
switch (window.meta.windowName) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ function App(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
void window.remote.setVisualZoomLevelLimits(1, 1);
|
||||
window.remote.setVisualZoomLevelLimits(1, 1);
|
||||
const container = document.querySelector('#app');
|
||||
const root = createRoot(container!);
|
||||
root.render(<App />);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue