mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix(core): use Link from react-router-dom (#3342)
This commit is contained in:
@@ -52,7 +52,7 @@ export const ReferencePage = ({
|
||||
data-type="favorite-list-item"
|
||||
data-testid={`favorite-list-item-${pageId}`}
|
||||
active={active}
|
||||
href={`/workspace/${workspace.id}/${pageId}`}
|
||||
to={`/workspace/${workspace.id}/${pageId}`}
|
||||
icon={icon}
|
||||
collapsed={collapsible ? collapsed : undefined}
|
||||
onCollapsedChange={setCollapsed}
|
||||
|
||||
@@ -53,7 +53,7 @@ const RouteMenuLinkItem = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
{
|
||||
currentPath: string; // todo: pass through useRouter?
|
||||
path?: string | null;
|
||||
path: string;
|
||||
icon: ReactElement;
|
||||
children?: ReactElement;
|
||||
isDraggedOver?: boolean;
|
||||
@@ -66,7 +66,7 @@ const RouteMenuLinkItem = React.forwardRef<
|
||||
ref={ref}
|
||||
{...props}
|
||||
active={active}
|
||||
href={path ?? ''}
|
||||
to={path ?? ''}
|
||||
icon={icon}
|
||||
>
|
||||
{children}
|
||||
@@ -169,7 +169,7 @@ export const RootAppSidebar = ({
|
||||
<RouteMenuLinkItem
|
||||
icon={<FolderIcon />}
|
||||
currentPath={currentPath}
|
||||
path={currentWorkspaceId && paths.all(currentWorkspaceId)}
|
||||
path={paths.all(currentWorkspaceId)}
|
||||
onClick={backToAll}
|
||||
>
|
||||
<span data-testid="all-pages">{t['All pages']()}</span>
|
||||
@@ -198,7 +198,7 @@ export const RootAppSidebar = ({
|
||||
isDraggedOver={trashDroppable.isOver}
|
||||
icon={<DeleteTemporarilyIcon />}
|
||||
currentPath={currentPath}
|
||||
path={currentWorkspaceId && paths.trash(currentWorkspaceId)}
|
||||
path={paths.trash(currentWorkspaceId)}
|
||||
>
|
||||
<span data-testid="trash-page">{t['Trash']()}</span>
|
||||
</RouteMenuLinkItem>
|
||||
|
||||
Reference in New Issue
Block a user