Skip to content

Commit 2fdf655

Browse files
committed
fix: comment content title cell
Signed-off-by: Innei <[email protected]>
1 parent c5bae13 commit 2fdf655

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

src/components/modules/dashboard/comments/CommentContentCell.tsx

+18-16
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { CommentModel } from '@mx-space/api-client'
33

44
import { CollectionRefTypes } from '@mx-space/api-client'
55

6-
import { MotionButtonBase } from '~/components/ui/button'
76
import { RelativeTime } from '~/components/ui/relative-time'
87
import { EllipsisHorizontalTextWithTooltip } from '~/components/ui/typography'
98
import { clsxm } from '~/lib/helper'
@@ -34,25 +33,28 @@ export const CommentContentCell: Component<{ comment: CommentModel }> = (
3433
if (refType === CollectionRefTypes.Recently)
3534
return `${ref.text.slice(0, 20)}...`
3635
return (
37-
<MotionButtonBase
38-
className="inline-flex grow"
39-
onClick={async () => {
40-
const url = await apiClient.proxy.helper('url-builder')(ref.id).get<{
41-
data: string
42-
}>()
43-
window.open(url?.data, '_blank')
44-
}}
45-
>
46-
<EllipsisHorizontalTextWithTooltip wrapperClassName="text-left text-accent inline-block !w-0 flex-grow">
47-
{ref.title}
48-
</EllipsisHorizontalTextWithTooltip>
49-
</MotionButtonBase>
36+
<div className="flex w-0 grow items-center">
37+
<a
38+
href={`${apiClient.proxy
39+
.helper('url-builder')(ref.id)
40+
.toString(true)}?redirect=true`}
41+
className="inline-flex overflow-hidden"
42+
target="_blank"
43+
rel="noreferrer"
44+
>
45+
<EllipsisHorizontalTextWithTooltip wrapperClassName="text-left text-accent inline-block flex-shrink">
46+
{ref.title}
47+
</EllipsisHorizontalTextWithTooltip>
48+
</a>
49+
<div className="ml-2">{isWhispers && '悄悄说'}</div>
50+
<div className="grow" />
51+
</div>
5052
)
51-
}, [ref, refType])
53+
}, [isWhispers, ref, refType])
5254
return (
5355
<div className={clsxm('flex flex-col gap-2 py-2 text-sm', className)}>
5456
<div className="flex gap-2 whitespace-nowrap text-sm">
55-
<RelativeTime date={created} />{TitleEl} {isWhispers && '悄悄说'}
57+
<RelativeTime date={created} />{TitleEl}
5658
</div>
5759

5860
<p className="break-words">{text}</p>

0 commit comments

Comments
 (0)