mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-19 06:52:30 +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 CSSProperties,
|
||||||
type HTMLAttributes,
|
type HTMLAttributes,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { useParams, useNavigate } from 'react-router-dom';
|
import { useParams, Link } from 'react-router-dom';
|
||||||
import cx from 'clsx';
|
import cx from 'clsx';
|
||||||
import { CloseIcon, DocumentIcon } from '@toeverything/components/common';
|
import { CloseIcon } from '@toeverything/components/common';
|
||||||
import {
|
import {
|
||||||
ArrowDropDownIcon,
|
ArrowDropDownIcon,
|
||||||
ArrowRightIcon,
|
ArrowRightIcon,
|
||||||
@ -62,7 +62,6 @@ export const TreeItem = forwardRef<HTMLDivElement, TreeItemProps>(
|
|||||||
ref
|
ref
|
||||||
) => {
|
) => {
|
||||||
const { workspace_id } = useParams();
|
const { workspace_id } = useParams();
|
||||||
const navigate = useNavigate();
|
|
||||||
const BooleanPageTreeItemMoreActions = useFlag(
|
const BooleanPageTreeItemMoreActions = useFlag(
|
||||||
'BooleanPageTreeItemMoreActions',
|
'BooleanPageTreeItemMoreActions',
|
||||||
true
|
true
|
||||||
@ -103,15 +102,13 @@ export const TreeItem = forwardRef<HTMLDivElement, TreeItemProps>(
|
|||||||
</Action>
|
</Action>
|
||||||
|
|
||||||
<div className={styles['ItemContent']}>
|
<div className={styles['ItemContent']}>
|
||||||
<span
|
<Link
|
||||||
className={styles['Text']}
|
className={styles['Text']}
|
||||||
{...handleProps}
|
{...handleProps}
|
||||||
onClick={() => {
|
to={`/${workspace_id}/${pageId}`}
|
||||||
navigate(`/${workspace_id}/${pageId}`);
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{value}
|
{value}
|
||||||
</span>
|
</Link>
|
||||||
{BooleanPageTreeItemMoreActions && (
|
{BooleanPageTreeItemMoreActions && (
|
||||||
<MoreActions
|
<MoreActions
|
||||||
workspaceId={workspace_id}
|
workspaceId={workspace_id}
|
||||||
|
@ -105,6 +105,9 @@
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
appearance: none;
|
||||||
|
color: unset;
|
||||||
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Count {
|
.Count {
|
||||||
|
Loading…
Reference in New Issue
Block a user