mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-24 18:02:47 +08:00
fix(component): windows client does not have app controls on some pages (#8176)
close AF-1266
This commit is contained in:
@@ -27,6 +27,12 @@ export const topNav = style({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
export const draggableHeader = style({
|
||||||
|
height: '52px',
|
||||||
|
width: '100%',
|
||||||
|
position: 'fixed',
|
||||||
|
['WebkitAppRegion' as string]: 'drag',
|
||||||
|
});
|
||||||
export const topNavLinks = style({
|
export const topNavLinks = style({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
columnGap: 4,
|
columnGap: 4,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Button } from '@affine/component/ui/button';
|
import { Button } from '@affine/component/ui/button';
|
||||||
import { useI18n } from '@affine/i18n';
|
import { useI18n } from '@affine/i18n';
|
||||||
import { Logo1Icon } from '@blocksuite/icons/rc';
|
import { Logo1Icon } from '@blocksuite/icons/rc';
|
||||||
import { useCallback } from 'react';
|
import { type ReactNode, useCallback } from 'react';
|
||||||
|
|
||||||
import { DesktopNavbar } from './desktop-navbar';
|
import { DesktopNavbar } from './desktop-navbar';
|
||||||
import * as styles from './index.css';
|
import * as styles from './index.css';
|
||||||
@@ -10,7 +10,7 @@ import { MobileNavbar } from './mobile-navbar';
|
|||||||
export const AffineOtherPageLayout = ({
|
export const AffineOtherPageLayout = ({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: ReactNode;
|
||||||
}) => {
|
}) => {
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
|
|
||||||
@@ -20,7 +20,9 @@ export const AffineOtherPageLayout = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.root}>
|
<div className={styles.root}>
|
||||||
{environment.isElectron ? null : (
|
{environment.isElectron ? (
|
||||||
|
<div className={styles.draggableHeader} />
|
||||||
|
) : (
|
||||||
<div className={styles.topNav}>
|
<div className={styles.topNav}>
|
||||||
<a href="/" rel="noreferrer" className={styles.affineLogo}>
|
<a href="/" rel="noreferrer" className={styles.affineLogo}>
|
||||||
<Logo1Icon width={24} height={24} />
|
<Logo1Icon width={24} height={24} />
|
||||||
|
|||||||
@@ -5,7 +5,10 @@ import { AffineOtherPageLayout } from '../affine-other-page-layout';
|
|||||||
import { authPageContainer, hideInSmallScreen } from './share.css';
|
import { authPageContainer, hideInSmallScreen } from './share.css';
|
||||||
|
|
||||||
export const AuthPageContainer: FC<
|
export const AuthPageContainer: FC<
|
||||||
PropsWithChildren<{ title?: ReactNode; subtitle?: ReactNode }>
|
PropsWithChildren<{
|
||||||
|
title?: ReactNode;
|
||||||
|
subtitle?: ReactNode;
|
||||||
|
}>
|
||||||
> = ({ children, title, subtitle }) => {
|
> = ({ children, title, subtitle }) => {
|
||||||
return (
|
return (
|
||||||
<AffineOtherPageLayout>
|
<AffineOtherPageLayout>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import type { FC } from 'react';
|
|||||||
import { Button } from '../../ui/button';
|
import { Button } from '../../ui/button';
|
||||||
import { AuthPageContainer } from './auth-page-container';
|
import { AuthPageContainer } from './auth-page-container';
|
||||||
|
|
||||||
export const ConfirmChangeEmail: FC<{
|
export const ConfirmVerifiedEmail: FC<{
|
||||||
onOpenAffine: () => void;
|
onOpenAffine: () => void;
|
||||||
}> = ({ onOpenAffine }) => {
|
}> = ({ onOpenAffine }) => {
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export * from './change-email-page';
|
|||||||
export * from './change-password-page';
|
export * from './change-password-page';
|
||||||
export * from './confirm-change-email';
|
export * from './confirm-change-email';
|
||||||
export * from './count-down-render';
|
export * from './count-down-render';
|
||||||
|
export * from './email-verified-email';
|
||||||
export * from './modal';
|
export * from './modal';
|
||||||
export * from './modal-header';
|
export * from './modal-header';
|
||||||
export * from './onboarding-page';
|
export * from './onboarding-page';
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import {
|
|||||||
appSidebarResizingAtom,
|
appSidebarResizingAtom,
|
||||||
} from '@affine/core/components/app-sidebar';
|
} from '@affine/core/components/app-sidebar';
|
||||||
import { appSidebarWidthAtom } from '@affine/core/components/app-sidebar/index.jotai';
|
import { appSidebarWidthAtom } from '@affine/core/components/app-sidebar/index.jotai';
|
||||||
import { WindowsAppControls } from '@affine/core/components/pure/header/windows-app-controls';
|
|
||||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||||
import { useCatchEventCallback } from '@affine/core/hooks/use-catch-event-hook';
|
import { useCatchEventCallback } from '@affine/core/hooks/use-catch-event-hook';
|
||||||
import { track } from '@affine/core/mixpanel';
|
import { track } from '@affine/core/mixpanel';
|
||||||
@@ -475,7 +474,7 @@ export const AppTabsHeader = ({
|
|||||||
<RightSidebarIcon />
|
<RightSidebarIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
{environment.isElectron && environment.isWindows ? (
|
{environment.isElectron && environment.isWindows ? (
|
||||||
<WindowsAppControls />
|
<div className={styles.windowsAppControlsPlaceholder} />
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -242,6 +242,12 @@ export const spacer = style({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const windowsAppControlsPlaceholder = style({
|
||||||
|
width: '160px',
|
||||||
|
height: '100%',
|
||||||
|
flexShrink: 0,
|
||||||
|
});
|
||||||
|
|
||||||
export const dropIndicator = style({
|
export const dropIndicator = style({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
height: 32,
|
height: 32,
|
||||||
|
|||||||
@@ -67,4 +67,6 @@ export const PageNotFound = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Component = PageNotFound;
|
export const Component = () => {
|
||||||
|
return <PageNotFound />;
|
||||||
|
};
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import {
|
|||||||
ChangeEmailPage,
|
ChangeEmailPage,
|
||||||
ChangePasswordPage,
|
ChangePasswordPage,
|
||||||
ConfirmChangeEmail,
|
ConfirmChangeEmail,
|
||||||
|
ConfirmVerifiedEmail,
|
||||||
OnboardingPage,
|
OnboardingPage,
|
||||||
SetPasswordPage,
|
SetPasswordPage,
|
||||||
SignInSuccessPage,
|
SignInSuccessPage,
|
||||||
@@ -153,7 +154,7 @@ export const Component = () => {
|
|||||||
return <ConfirmChangeEmail onOpenAffine={onOpenAffine} />;
|
return <ConfirmChangeEmail onOpenAffine={onOpenAffine} />;
|
||||||
}
|
}
|
||||||
case 'verify-email': {
|
case 'verify-email': {
|
||||||
return <ConfirmChangeEmail onOpenAffine={onOpenAffine} />;
|
return <ConfirmVerifiedEmail onOpenAffine={onOpenAffine} />;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { AffineOtherPageLayout } from '@affine/component/affine-other-page-layout';
|
||||||
import { AppFallback } from '@affine/core/components/affine/app-container';
|
import { AppFallback } from '@affine/core/components/affine/app-container';
|
||||||
import { viewRoutes } from '@affine/core/router';
|
import { viewRoutes } from '@affine/core/router';
|
||||||
import { ZipTransformer } from '@blocksuite/blocks';
|
import { ZipTransformer } from '@blocksuite/blocks';
|
||||||
@@ -108,7 +109,11 @@ export const Component = (): ReactElement => {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return <PageNotFound noPermission />;
|
return (
|
||||||
|
<AffineOtherPageLayout>
|
||||||
|
<PageNotFound noPermission />
|
||||||
|
</AffineOtherPageLayout>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (!meta) {
|
if (!meta) {
|
||||||
return <AppFallback />;
|
return <AppFallback />;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import '@affine/component/theme/theme.css';
|
|||||||
import { AffineContext } from '@affine/component/context';
|
import { AffineContext } from '@affine/component/context';
|
||||||
import { GlobalLoading } from '@affine/component/global-loading';
|
import { GlobalLoading } from '@affine/component/global-loading';
|
||||||
import { AppFallback } from '@affine/core/components/affine/app-container';
|
import { AppFallback } from '@affine/core/components/affine/app-container';
|
||||||
|
import { WindowsAppControls } from '@affine/core/components/pure/header/windows-app-controls';
|
||||||
import { configureCommonModules } from '@affine/core/modules';
|
import { configureCommonModules } from '@affine/core/modules';
|
||||||
import { configureAppTabsHeaderModule } from '@affine/core/modules/app-tabs-header';
|
import { configureAppTabsHeaderModule } from '@affine/core/modules/app-tabs-header';
|
||||||
import { configureElectronStateStorageImpls } from '@affine/core/modules/storage';
|
import { configureElectronStateStorageImpls } from '@affine/core/modules/storage';
|
||||||
@@ -121,6 +122,11 @@ export function App() {
|
|||||||
router={router}
|
router={router}
|
||||||
future={future}
|
future={future}
|
||||||
/>
|
/>
|
||||||
|
{environment.isWindows && (
|
||||||
|
<div style={{ position: 'fixed', right: 0, top: 0, zIndex: 5 }}>
|
||||||
|
<WindowsAppControls />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</DebugProvider>
|
</DebugProvider>
|
||||||
</AffineContext>
|
</AffineContext>
|
||||||
</CacheProvider>
|
</CacheProvider>
|
||||||
|
|||||||
Reference in New Issue
Block a user