fix(sidebar): use a tag for link

This commit is contained in:
austaras 2022-08-05 15:18:23 +08:00 committed by Austaras
parent ed941a02aa
commit 07e6e9fe98
2 changed files with 8 additions and 8 deletions

View File

@ -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}

View File

@ -105,6 +105,9 @@
text-overflow: ellipsis;
overflow: hidden;
cursor: pointer;
appearance: none;
color: unset;
text-decoration: none;
}
.Count {