Skip to content

Commit

Permalink
fix: make creation time a link to the detail page (#1379)
Browse files Browse the repository at this point in the history
  • Loading branch information
gera2ld authored Mar 18, 2023
1 parent 7529296 commit 8b20cb9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions web/src/components/Memo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,11 @@ const Memo: React.FC<Props> = (props: Props) => {
editorStore.setEditMemoWithId(memo.id);
};

const handleMemoCreatedTimeClick = () => {
showChangeMemoCreatedTsDialog(memo.id);
const handleMemoCreatedTimeClick = (e: React.MouseEvent) => {
if (e.altKey) {
e.preventDefault();
showChangeMemoCreatedTsDialog(memo.id);
}
};

const handleMemoVisibilityClick = (visibility: Visibility) => {
Expand All @@ -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}
Expand Down

0 comments on commit 8b20cb9

Please sign in to comment.