mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
feat: page view persistence (#2581)
This commit is contained in:
@@ -15,8 +15,10 @@ import {
|
||||
SettingsIcon,
|
||||
ShareIcon,
|
||||
} from '@blocksuite/icons';
|
||||
import { RESET } from 'jotai/utils';
|
||||
import type { ReactElement } from 'react';
|
||||
import React from 'react';
|
||||
import { NIL } from 'uuid';
|
||||
|
||||
import { BlockSuiteEditorHeader } from './blocksuite/workspace-header';
|
||||
import { WorkspaceTitle } from './pure/workspace-title';
|
||||
@@ -38,25 +40,24 @@ export function WorkspaceHeader({
|
||||
<div style={{ flex: 1 }}>
|
||||
<FilterList
|
||||
value={setting.currentView.filterList}
|
||||
onChange={filterList =>
|
||||
setting.changeView(
|
||||
{
|
||||
...setting.currentView,
|
||||
filterList,
|
||||
},
|
||||
setting.currentViewIndex
|
||||
)
|
||||
}
|
||||
onChange={filterList => {
|
||||
setting.setCurrentView(view => ({
|
||||
...view,
|
||||
filterList,
|
||||
}));
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
{setting.currentViewIndex == null ? (
|
||||
{setting.currentView.id !== NIL ||
|
||||
(setting.currentView.id === NIL &&
|
||||
setting.currentView.filterList.length > 0) ? (
|
||||
<SaveViewButton
|
||||
init={setting.currentView.filterList}
|
||||
onConfirm={setting.createView}
|
||||
></SaveViewButton>
|
||||
) : (
|
||||
<Button onClick={() => setting.selectView()}>
|
||||
<Button onClick={() => setting.setCurrentView(RESET)}>
|
||||
Back to all
|
||||
</Button>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user