mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-03 18:40:00 +08:00
refactor(core): independent app fallback for mobile (#8884)
This commit is contained in:
@@ -22,7 +22,6 @@ import {
|
||||
type ReactElement,
|
||||
} from 'react';
|
||||
|
||||
import { AppFallback } from './mobile';
|
||||
import * as styles from './styles.css';
|
||||
|
||||
export const AppContainer = ({
|
||||
@@ -103,23 +102,7 @@ const BrowserLayout = ({
|
||||
);
|
||||
};
|
||||
|
||||
const MobileLayout = ({
|
||||
children,
|
||||
fallback = false,
|
||||
}: PropsWithChildren<{ fallback?: boolean }>) => {
|
||||
return (
|
||||
<div className={styles.browserAppViewContainer}>
|
||||
{fallback ? <AppFallback /> : null}
|
||||
<MainContainer>{children}</MainContainer>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const LayoutComponent = BUILD_CONFIG.isElectron
|
||||
? DesktopLayout
|
||||
: BUILD_CONFIG.isMobileEdition
|
||||
? MobileLayout
|
||||
: BrowserLayout;
|
||||
const LayoutComponent = BUILD_CONFIG.isElectron ? DesktopLayout : BrowserLayout;
|
||||
|
||||
const MainContainer = forwardRef<
|
||||
HTMLDivElement,
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
import { SafeArea, Skeleton } from '@affine/component';
|
||||
import { WorkspaceSelector } from '@affine/core/mobile/components';
|
||||
|
||||
import { WorkspaceSelector } from '../workspace-selector';
|
||||
|
||||
const SectionTitleFallback = () => {
|
||||
return (
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
} from '@affine/core/components/affine/quota-reached-modal';
|
||||
import { SWRConfigProvider } from '@affine/core/components/providers/swr-config-provider';
|
||||
import { WorkspaceSideEffects } from '@affine/core/components/providers/workspace-side-effects';
|
||||
import { AppContainer } from '@affine/core/desktop/components/app-container';
|
||||
import { PeekViewManagerModal } from '@affine/core/modules/peek-view';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import type { Workspace, WorkspaceMetadata } from '@toeverything/infra';
|
||||
@@ -24,6 +23,7 @@ import {
|
||||
useState,
|
||||
} from 'react';
|
||||
|
||||
import { AppFallback } from '../../components/app-fallback';
|
||||
import { WorkspaceDialogs } from '../../dialogs';
|
||||
|
||||
// TODO(@forehalo): reuse the global context with [core/electron]
|
||||
@@ -91,7 +91,7 @@ export const WorkspaceLayout = ({
|
||||
}
|
||||
|
||||
if (!isRootDocReady) {
|
||||
return <AppContainer fallback />;
|
||||
return <AppFallback />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user