mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 01:56:27 +08:00
feat(mobile): all docs page ui impl (#7976)
This commit is contained in:
@@ -14,11 +14,12 @@ export type WorkbenchLinkProps = React.PropsWithChildren<
|
||||
{
|
||||
to: To;
|
||||
onClick?: (e: MouseEvent) => void;
|
||||
replaceHistory?: boolean;
|
||||
} & React.HTMLProps<HTMLAnchorElement>
|
||||
>;
|
||||
|
||||
export const WorkbenchLink = forwardRef<HTMLAnchorElement, WorkbenchLinkProps>(
|
||||
function WorkbenchLink({ to, onClick, ...other }, ref) {
|
||||
function WorkbenchLink({ to, onClick, replaceHistory, ...other }, ref) {
|
||||
const { featureFlagService, workbenchService } = useServices({
|
||||
FeatureFlagService,
|
||||
WorkbenchService,
|
||||
@@ -45,10 +46,10 @@ export const WorkbenchLink = forwardRef<HTMLAnchorElement, WorkbenchLinkProps>(
|
||||
}
|
||||
return 'active';
|
||||
})();
|
||||
workbench.open(to, { at });
|
||||
workbench.open(to, { at, replaceHistory });
|
||||
event.preventDefault();
|
||||
},
|
||||
[enableMultiView, onClick, to, workbench]
|
||||
[enableMultiView, onClick, replaceHistory, to, workbench]
|
||||
);
|
||||
|
||||
// eslint suspicious runtime error
|
||||
|
||||
Reference in New Issue
Block a user