fix: make creation time a link to the detail page (#1379)

This commit is contained in:
Gerald 2023-03-18 22:06:44 +08:00 committed by GitHub
parent 7529296dd5
commit 8b20cb9fd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -171,8 +171,11 @@ const Memo: React.FC<Props> = (props: Props) => {
editorStore.setEditMemoWithId(memo.id);
};
const handleMemoCreatedTimeClick = () => {
const handleMemoCreatedTimeClick = (e: React.MouseEvent) => {
if (e.altKey) {
e.preventDefault();
showChangeMemoCreatedTsDialog(memo.id);
}
};
const handleMemoVisibilityClick = (visibility: Visibility) => {
@ -189,9 +192,9 @@ const Memo: React.FC<Props> = (props: Props) => {
{memo.pinned && <div className="corner-container"></div>}
<div className="memo-top-wrapper">
<div className="status-text-container">
<span className="time-text" onDoubleClick={handleMemoCreatedTimeClick}>
<Link className="time-text" to={`/m/${memo.id}`} onClick={handleMemoCreatedTimeClick}>
{createdTimeStr}
</span>
</Link>
{isVisitorMode && (
<Link className="name-text" to={`/u/${memo.creatorId}`}>
@{memo.creatorName}