mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 21:38:44 +08:00
feat: add history back & forward for desktop app (#1926)
This commit is contained in:
@@ -103,7 +103,7 @@ export const NavigationPath = ({
|
||||
>
|
||||
<IconButton
|
||||
data-testid="navigation-path-expand-btn"
|
||||
size="middle"
|
||||
size="small"
|
||||
className="collapse-btn"
|
||||
onClick={() => {
|
||||
setOpenExtend(!openExtend);
|
||||
@@ -158,9 +158,7 @@ const NavigationPathExtendPanel = ({
|
||||
show={open}
|
||||
data-testid="navigation-path-expand-panel"
|
||||
>
|
||||
<div className="tree-container">
|
||||
<TreeView data={data} indent={10} disableCollapse={true} />
|
||||
</div>
|
||||
<TreeView data={data} indent={10} disableCollapse={true} />
|
||||
</StyledNavPathExtendContainer>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -55,12 +55,7 @@ export const StyledNavPathExtendContainer = styled('div')<{ show: boolean }>(
|
||||
transition: 'top .15s',
|
||||
fontSize: theme.font.sm,
|
||||
color: theme.colors.secondaryTextColor,
|
||||
paddingTop: '46px',
|
||||
paddingRight: '12px',
|
||||
|
||||
'.tree-container': {
|
||||
padding: '0 12px 0 15px',
|
||||
},
|
||||
padding: '46px 12px 0 15px',
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { PageMeta } from '@blocksuite/store';
|
||||
export function findPath(metas: PageMeta[], meta: PageMeta): PageMeta[] {
|
||||
function helper(group: PageMeta[]): PageMeta[] {
|
||||
const last = group[group.length - 1];
|
||||
const parent = metas.find(m => m.subpageIds.includes(last.id));
|
||||
const parent = metas.find(m => (m.subpageIds ?? []).includes(last.id));
|
||||
if (parent) {
|
||||
return helper([...group, parent]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user