mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 14:28:51 +08:00
refactor(core): move setting dialog to workspace scope (#9706)
This commit is contained in:
@@ -18,7 +18,6 @@ const GLOBAL_DIALOGS = {
|
||||
// 'create-workspace': CreateWorkspaceDialog,
|
||||
// 'import-workspace': ImportWorkspaceDialog,
|
||||
// 'import-template': ImportTemplateDialog,
|
||||
setting: SettingDialog,
|
||||
// import: ImportDialog,
|
||||
'sign-in': SignInDialog,
|
||||
} satisfies {
|
||||
@@ -34,6 +33,7 @@ const WORKSPACE_DIALOGS = {
|
||||
'doc-selector': DocSelectorDialog,
|
||||
'collection-selector': CollectionSelectorDialog,
|
||||
'date-selector': DateSelectorDialog,
|
||||
setting: SettingDialog,
|
||||
} satisfies {
|
||||
[key in keyof WORKSPACE_DIALOG_SCHEMA]?: React.FC<
|
||||
DialogComponentProps<WORKSPACE_DIALOG_SCHEMA[key]>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { AuthService } from '@affine/core/modules/cloud';
|
||||
import type {
|
||||
DialogComponentProps,
|
||||
GLOBAL_DIALOG_SCHEMA,
|
||||
WORKSPACE_DIALOG_SCHEMA,
|
||||
} from '@affine/core/modules/dialogs';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { useService } from '@toeverything/infra';
|
||||
@@ -34,7 +34,7 @@ const MobileSetting = () => {
|
||||
|
||||
export const SettingDialog = ({
|
||||
close,
|
||||
}: DialogComponentProps<GLOBAL_DIALOG_SCHEMA['setting']>) => {
|
||||
}: DialogComponentProps<WORKSPACE_DIALOG_SCHEMA['setting']>) => {
|
||||
const t = useI18n();
|
||||
|
||||
return (
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
SafeArea,
|
||||
startScopedViewTransition,
|
||||
} from '@affine/component';
|
||||
import { GlobalDialogService } from '@affine/core/modules/dialogs';
|
||||
import { WorkspaceDialogService } from '@affine/core/modules/dialogs';
|
||||
import { WorkbenchService } from '@affine/core/modules/workbench';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { SettingsIcon } from '@blocksuite/icons/rc';
|
||||
@@ -23,7 +23,7 @@ import * as styles from './styles.css';
|
||||
* - hide Search
|
||||
*/
|
||||
export const HomeHeader = () => {
|
||||
const globalDialogService = useService(GlobalDialogService);
|
||||
const workspaceDialogService = useService(WorkspaceDialogService);
|
||||
|
||||
const workspaceCardRef = useRef<HTMLDivElement>(null);
|
||||
const floatWorkspaceCardRef = useRef<HTMLDivElement>(null);
|
||||
@@ -50,10 +50,10 @@ export const HomeHeader = () => {
|
||||
);
|
||||
|
||||
const openSetting = useCallback(() => {
|
||||
globalDialogService.open('setting', {
|
||||
workspaceDialogService.open('setting', {
|
||||
activeTab: 'appearance',
|
||||
});
|
||||
}, [globalDialogService]);
|
||||
}, [workspaceDialogService]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user