mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
chore(core): temporarily hide export png and pdf in edgeless (#5364)
This commit is contained in:
@@ -4,7 +4,9 @@ import { Divider } from '@affine/component/ui/divider';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { LinkIcon } from '@blocksuite/icons';
|
||||
import { useAtomValue } from 'jotai';
|
||||
|
||||
import { currentModeAtom } from '../../../../atoms/mode';
|
||||
import { useExportPage } from '../../../../hooks/affine/use-export-page';
|
||||
import * as styles from './index.css';
|
||||
import type { ShareMenuProps } from './share-menu';
|
||||
@@ -23,6 +25,7 @@ export const ShareExport = ({
|
||||
urlType: 'workspace',
|
||||
});
|
||||
const exportHandler = useExportPage(currentPage);
|
||||
const currentMode = useAtomValue(currentModeAtom);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -36,6 +39,7 @@ export const ShareExport = ({
|
||||
<ExportMenuItems
|
||||
exportHandler={exportHandler}
|
||||
className={styles.menuItemStyle}
|
||||
pageMode={currentMode}
|
||||
/>
|
||||
</div>
|
||||
{workspace.flavour !== WorkspaceFlavour.LOCAL ? (
|
||||
|
||||
@@ -182,7 +182,7 @@ export const PageHeaderMenuButton = ({ rename, pageId }: PageMenuProps) => {
|
||||
>
|
||||
{t['Import']()}
|
||||
</MenuItem>
|
||||
<Export exportHandler={exportHandler} />
|
||||
<Export exportHandler={exportHandler} pageMode={currentMode} />
|
||||
|
||||
{workspace.flavour === WorkspaceFlavour.AFFINE_CLOUD &&
|
||||
runtimeConfig.enablePageHistory ? (
|
||||
|
||||
@@ -141,7 +141,7 @@ export function useRegisterBlocksuiteEditorCommands(
|
||||
unsubs.push(
|
||||
registerAffineCommand({
|
||||
id: `editor:${mode}-export-to-pdf`,
|
||||
preconditionStrategy,
|
||||
preconditionStrategy: () => mode === 'page' && !trash,
|
||||
category: `editor:${mode}`,
|
||||
icon: mode === 'page' ? <PageIcon /> : <EdgelessIcon />,
|
||||
label: t['Export to PDF'](),
|
||||
@@ -167,7 +167,7 @@ export function useRegisterBlocksuiteEditorCommands(
|
||||
unsubs.push(
|
||||
registerAffineCommand({
|
||||
id: `editor:${mode}-export-to-png`,
|
||||
preconditionStrategy,
|
||||
preconditionStrategy: () => mode === 'page' && !trash,
|
||||
category: `editor:${mode}`,
|
||||
icon: mode === 'page' ? <PageIcon /> : <EdgelessIcon />,
|
||||
label: t['Export to PNG'](),
|
||||
|
||||
Reference in New Issue
Block a user