mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-18 11:31:36 +03:00
fix(sidebar): use a tag for link
This commit is contained in:
parent
ed941a02aa
commit
07e6e9fe98
@ -3,9 +3,9 @@ import React, {
|
||||
type CSSProperties,
|
||||
type HTMLAttributes,
|
||||
} from 'react';
|
||||
import { useParams, useNavigate } from 'react-router-dom';
|
||||
import { useParams, Link } from 'react-router-dom';
|
||||
import cx from 'clsx';
|
||||
import { CloseIcon, DocumentIcon } from '@toeverything/components/common';
|
||||
import { CloseIcon } from '@toeverything/components/common';
|
||||
import {
|
||||
ArrowDropDownIcon,
|
||||
ArrowRightIcon,
|
||||
@ -62,7 +62,6 @@ export const TreeItem = forwardRef<HTMLDivElement, TreeItemProps>(
|
||||
ref
|
||||
) => {
|
||||
const { workspace_id } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const BooleanPageTreeItemMoreActions = useFlag(
|
||||
'BooleanPageTreeItemMoreActions',
|
||||
true
|
||||
@ -103,15 +102,13 @@ export const TreeItem = forwardRef<HTMLDivElement, TreeItemProps>(
|
||||
</Action>
|
||||
|
||||
<div className={styles['ItemContent']}>
|
||||
<span
|
||||
<Link
|
||||
className={styles['Text']}
|
||||
{...handleProps}
|
||||
onClick={() => {
|
||||
navigate(`/${workspace_id}/${pageId}`);
|
||||
}}
|
||||
to={`/${workspace_id}/${pageId}`}
|
||||
>
|
||||
{value}
|
||||
</span>
|
||||
</Link>
|
||||
{BooleanPageTreeItemMoreActions && (
|
||||
<MoreActions
|
||||
workspaceId={workspace_id}
|
||||
|
@ -105,6 +105,9 @@
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
appearance: none;
|
||||
color: unset;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.Count {
|
||||
|
Loading…
Reference in New Issue
Block a user