mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-24 23:25:10 +03:00
chore: add back&forward for web (#4403)
This commit is contained in:
parent
f395a955a2
commit
38417878fc
@ -28,36 +28,35 @@ export const SidebarHeader = (props: SidebarHeaderProps) => {
|
||||
data-is-macos-electron={environment.isDesktop && environment.isMacOs}
|
||||
>
|
||||
<SidebarSwitch show={open} />
|
||||
{environment.isDesktop && (
|
||||
<div className={navHeaderNavigationButtons}>
|
||||
<IconButton
|
||||
className={navHeaderButton}
|
||||
data-testid="app-sidebar-arrow-button-back"
|
||||
disabled={props.router?.history.current === 0}
|
||||
onClick={() => {
|
||||
props.router?.back();
|
||||
}}
|
||||
>
|
||||
<ArrowLeftSmallIcon />
|
||||
</IconButton>
|
||||
<IconButton
|
||||
className={navHeaderButton}
|
||||
data-testid="app-sidebar-arrow-button-forward"
|
||||
disabled={
|
||||
props.router
|
||||
? props.router.history.stack.length > 0 &&
|
||||
<div className={navHeaderNavigationButtons}>
|
||||
<IconButton
|
||||
className={navHeaderButton}
|
||||
data-testid="app-sidebar-arrow-button-back"
|
||||
disabled={props.router?.history.current === 0}
|
||||
onClick={() => {
|
||||
props.router?.back();
|
||||
}}
|
||||
>
|
||||
<ArrowLeftSmallIcon />
|
||||
</IconButton>
|
||||
<IconButton
|
||||
className={navHeaderButton}
|
||||
data-testid="app-sidebar-arrow-button-forward"
|
||||
disabled={
|
||||
props.router
|
||||
? (props.router.history.stack.length > 0 &&
|
||||
props.router.history.current ===
|
||||
props.router.history.stack.length - 1
|
||||
: false
|
||||
}
|
||||
onClick={() => {
|
||||
props.router?.forward();
|
||||
}}
|
||||
>
|
||||
<ArrowRightSmallIcon />
|
||||
</IconButton>
|
||||
</div>
|
||||
)}
|
||||
props.router.history.stack.length - 1) ||
|
||||
props.router.history.stack.length === 0
|
||||
: true
|
||||
}
|
||||
onClick={() => {
|
||||
props.router?.forward();
|
||||
}}
|
||||
>
|
||||
<ArrowRightSmallIcon />
|
||||
</IconButton>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user