mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-21 18:06:30 +02:00
re-add default suspense to album/artist routes
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import clsx from 'clsx';
|
||||
import isElectron from 'is-electron';
|
||||
import { lazy } from 'react';
|
||||
|
||||
import styles from './default-layout.module.css';
|
||||
|
||||
import { ContextMenuController } from '/@/renderer/features/context-menu/context-menu-controller';
|
||||
import { MainContent } from '/@/renderer/layouts/default-layout/main-content';
|
||||
import { PlayerBar } from '/@/renderer/layouts/default-layout/player-bar';
|
||||
import { WindowBar } from '/@/renderer/layouts/window-bar';
|
||||
import { useSettingsStore, useWindowBarStyle } from '/@/renderer/store/settings.store';
|
||||
import { Platform, PlayerType } from '/@/shared/types/types';
|
||||
|
||||
@@ -18,12 +18,6 @@ if (!isElectron()) {
|
||||
});
|
||||
}
|
||||
|
||||
const WindowBar = lazy(() =>
|
||||
import('/@/renderer/layouts/window-bar').then((module) => ({
|
||||
default: module.WindowBar,
|
||||
})),
|
||||
);
|
||||
|
||||
interface DefaultLayoutProps {
|
||||
shell?: boolean;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import clsx from 'clsx';
|
||||
import { AnimatePresence } from 'motion/react';
|
||||
import { lazy } from 'react';
|
||||
import { lazy, Suspense } from 'react';
|
||||
import { Outlet } from 'react-router';
|
||||
|
||||
import styles from './mobile-layout.module.css';
|
||||
@@ -13,6 +13,7 @@ import { PlayerBar } from '/@/renderer/layouts/default-layout/player-bar';
|
||||
import { useFullScreenPlayerOverlayState, useWindowBarStyle } from '/@/renderer/store';
|
||||
import { ActionIcon } from '/@/shared/components/action-icon/action-icon';
|
||||
import { Drawer } from '/@/shared/components/drawer/drawer';
|
||||
import { Spinner } from '/@/shared/components/spinner/spinner';
|
||||
import { useDisclosure } from '/@/shared/hooks/use-disclosure';
|
||||
import { Platform } from '/@/shared/types/types';
|
||||
|
||||
@@ -53,7 +54,9 @@ export const MobileLayout = ({ shell }: MobileLayoutProps) => {
|
||||
variant="subtle"
|
||||
/>
|
||||
<main className={styles.mainContent}>
|
||||
<Outlet />
|
||||
<Suspense fallback={<Spinner container />}>
|
||||
<Outlet />
|
||||
</Suspense>
|
||||
</main>
|
||||
<PlayerBar />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user