Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Commit 708601f

Browse files
author
Sung Won Cho
committed
Add missing link from comments to user profile
1 parent 0346e61 commit 708601f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

app/client/src/components/CommentItem.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import React from "react";
2+
import { Link } from "react-router-dom";
23
import moment from "moment";
34
import marked from "marked";
45

56
const CommentItem = ({ comment, currentUser, onDeleteComment }) => {
67
const isOwner = currentUser && comment.Author[0]._uid_ === currentUser._uid_;
8+
const author = comment.Author[0];
79

810
return (
911
<li className="comment-item">
@@ -14,14 +16,13 @@ const CommentItem = ({ comment, currentUser, onDeleteComment }) => {
1416
<span
1517
className="comment-body"
1618
dangerouslySetInnerHTML={{ __html: marked(comment.Text) }}
17-
/>
18-
{" "}
19-
-
20-
{" "}
19+
/>{" "}
20+
-{" "}
2121
<span className="comment-author-name">
22-
{comment.Author[0].DisplayName}
23-
</span>
24-
{" "}
22+
<Link to={`/users/${author._uid_}`}>
23+
{author.DisplayName}
24+
</Link>
25+
</span>{" "}
2526
<span className="comment-timestamp">
2627
{moment(comment.Timestamp).fromNow()}
2728
</span>

0 commit comments

Comments
 (0)