mirror of
https://github.com/toeverything/AFFiNE.git
synced 2025-01-04 20:37:54 +03:00
fix(mobile): use mobile app-fallback in app-container (#8804)
close AF-1633
This commit is contained in:
parent
a97ee60502
commit
ffa4d5422d
@ -1,5 +1,5 @@
|
|||||||
import { AffineContext } from '@affine/core/components/context';
|
import { AffineContext } from '@affine/core/components/context';
|
||||||
import { AppFallback } from '@affine/core/mobile/components';
|
import { AppContainer } from '@affine/core/desktop/components/app-container';
|
||||||
import { configureMobileModules } from '@affine/core/mobile/modules';
|
import { configureMobileModules } from '@affine/core/mobile/modules';
|
||||||
import { router } from '@affine/core/mobile/router';
|
import { router } from '@affine/core/mobile/router';
|
||||||
import { configureCommonModules } from '@affine/core/modules';
|
import { configureCommonModules } from '@affine/core/modules';
|
||||||
@ -47,7 +47,7 @@ export function App() {
|
|||||||
<I18nProvider>
|
<I18nProvider>
|
||||||
<AffineContext store={getCurrentStore()}>
|
<AffineContext store={getCurrentStore()}>
|
||||||
<RouterProvider
|
<RouterProvider
|
||||||
fallbackElement={<AppFallback />}
|
fallbackElement={<AppContainer fallback />}
|
||||||
router={router}
|
router={router}
|
||||||
future={future}
|
future={future}
|
||||||
/>
|
/>
|
||||||
|
@ -44,4 +44,4 @@ SPEC CHECKSUMS:
|
|||||||
|
|
||||||
PODFILE CHECKSUM: 1b0d3fe81862c0e9ce712ddd0c5a0accd0097698
|
PODFILE CHECKSUM: 1b0d3fe81862c0e9ce712ddd0c5a0accd0097698
|
||||||
|
|
||||||
COCOAPODS: 1.16.1
|
COCOAPODS: 1.16.2
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { AffineContext } from '@affine/core/components/context';
|
import { AffineContext } from '@affine/core/components/context';
|
||||||
import { AppFallback } from '@affine/core/mobile/components';
|
import { AppContainer } from '@affine/core/desktop/components/app-container';
|
||||||
import { configureMobileModules } from '@affine/core/mobile/modules';
|
import { configureMobileModules } from '@affine/core/mobile/modules';
|
||||||
import { router } from '@affine/core/mobile/router';
|
import { router } from '@affine/core/mobile/router';
|
||||||
import { configureCommonModules } from '@affine/core/modules';
|
import { configureCommonModules } from '@affine/core/modules';
|
||||||
@ -123,7 +123,7 @@ export function App() {
|
|||||||
<I18nProvider>
|
<I18nProvider>
|
||||||
<AffineContext store={getCurrentStore()}>
|
<AffineContext store={getCurrentStore()}>
|
||||||
<RouterProvider
|
<RouterProvider
|
||||||
fallbackElement={<AppFallback />}
|
fallbackElement={<AppContainer fallback />}
|
||||||
router={router}
|
router={router}
|
||||||
future={future}
|
future={future}
|
||||||
/>
|
/>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { AffineContext } from '@affine/core/components/context';
|
import { AffineContext } from '@affine/core/components/context';
|
||||||
import { AppFallback } from '@affine/core/mobile/components';
|
import { AppContainer } from '@affine/core/desktop/components/app-container';
|
||||||
import { configureMobileModules } from '@affine/core/mobile/modules';
|
import { configureMobileModules } from '@affine/core/mobile/modules';
|
||||||
import { router } from '@affine/core/mobile/router';
|
import { router } from '@affine/core/mobile/router';
|
||||||
import { configureCommonModules } from '@affine/core/modules';
|
import { configureCommonModules } from '@affine/core/modules';
|
||||||
@ -67,7 +67,7 @@ export function App() {
|
|||||||
<I18nProvider>
|
<I18nProvider>
|
||||||
<AffineContext store={getCurrentStore()}>
|
<AffineContext store={getCurrentStore()}>
|
||||||
<RouterProvider
|
<RouterProvider
|
||||||
fallbackElement={<AppFallback />}
|
fallbackElement={<AppContainer fallback />}
|
||||||
router={router}
|
router={router}
|
||||||
future={future}
|
future={future}
|
||||||
/>
|
/>
|
||||||
|
@ -22,6 +22,7 @@ import {
|
|||||||
type ReactElement,
|
type ReactElement,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
|
|
||||||
|
import { AppFallback } from './mobile';
|
||||||
import * as styles from './styles.css';
|
import * as styles from './styles.css';
|
||||||
|
|
||||||
export const AppContainer = ({
|
export const AppContainer = ({
|
||||||
@ -102,7 +103,23 @@ const BrowserLayout = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const LayoutComponent = BUILD_CONFIG.isElectron ? DesktopLayout : 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 MainContainer = forwardRef<
|
const MainContainer = forwardRef<
|
||||||
HTMLDivElement,
|
HTMLDivElement,
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { SafeArea, Skeleton } from '@affine/component';
|
import { SafeArea, Skeleton } from '@affine/component';
|
||||||
|
import { WorkspaceSelector } from '@affine/core/mobile/components';
|
||||||
import { WorkspaceSelector } from '../workspace-selector';
|
|
||||||
|
|
||||||
const SectionTitleFallback = () => {
|
const SectionTitleFallback = () => {
|
||||||
return (
|
return (
|
@ -3,6 +3,5 @@ export * from './doc-card';
|
|||||||
export * from './rename';
|
export * from './rename';
|
||||||
export * from './search-input';
|
export * from './search-input';
|
||||||
export * from './search-result';
|
export * from './search-result';
|
||||||
export * from './skeletons';
|
|
||||||
export * from './user-plan-tag';
|
export * from './user-plan-tag';
|
||||||
export * from './workspace-selector';
|
export * from './workspace-selector';
|
||||||
|
@ -1 +0,0 @@
|
|||||||
export * from './app-fallback';
|
|
@ -6,6 +6,7 @@ import {
|
|||||||
} from '@affine/core/components/affine/quota-reached-modal';
|
} from '@affine/core/components/affine/quota-reached-modal';
|
||||||
import { SWRConfigProvider } from '@affine/core/components/providers/swr-config-provider';
|
import { SWRConfigProvider } from '@affine/core/components/providers/swr-config-provider';
|
||||||
import { WorkspaceSideEffects } from '@affine/core/components/providers/workspace-side-effects';
|
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 { PeekViewManagerModal } from '@affine/core/modules/peek-view';
|
||||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||||
import type { Workspace, WorkspaceMetadata } from '@toeverything/infra';
|
import type { Workspace, WorkspaceMetadata } from '@toeverything/infra';
|
||||||
@ -23,7 +24,6 @@ import {
|
|||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
|
|
||||||
import { AppFallback } from '../../components';
|
|
||||||
import { WorkspaceDialogs } from '../../dialogs';
|
import { WorkspaceDialogs } from '../../dialogs';
|
||||||
|
|
||||||
// TODO(@forehalo): reuse the global context with [core/electron]
|
// TODO(@forehalo): reuse the global context with [core/electron]
|
||||||
@ -91,7 +91,7 @@ export const WorkspaceLayout = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!isRootDocReady) {
|
if (!isRootDocReady) {
|
||||||
return <AppFallback />;
|
return <AppContainer fallback />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user