diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-09-09 20:10:16 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-09-09 20:10:16 +0300 |
| commit | 188e806427ff6c9b302d994fc9c84a0300526688 (patch) | |
| tree | de6b28b307efc181a26ff422895246b25d70de8a /frontend/src/components/Discussions.tsx | |
| parent | refactor: upload run form, lots of random shit (diff) | |
| download | lphub-188e806427ff6c9b302d994fc9c84a0300526688.tar.gz lphub-188e806427ff6c9b302d994fc9c84a0300526688.tar.bz2 lphub-188e806427ff6c9b302d994fc9c84a0300526688.zip | |
refactor: make names clickable throughout the site, fix user pages
Diffstat (limited to 'frontend/src/components/Discussions.tsx')
| -rw-r--r-- | frontend/src/components/Discussions.tsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/frontend/src/components/Discussions.tsx b/frontend/src/components/Discussions.tsx index 1cd3523..787104b 100644 --- a/frontend/src/components/Discussions.tsx +++ b/frontend/src/components/Discussions.tsx | |||
| @@ -5,6 +5,7 @@ import { MapDiscussionCommentContent, MapDiscussionContent } from '../types/Cont | |||
| 5 | import { time_ago } from '../utils/Time'; | 5 | import { time_ago } from '../utils/Time'; |
| 6 | import { API } from '../api/Api'; | 6 | import { API } from '../api/Api'; |
| 7 | import "../css/Maps.css" | 7 | import "../css/Maps.css" |
| 8 | import { Link } from 'react-router-dom'; | ||
| 8 | 9 | ||
| 9 | interface DiscussionsProps { | 10 | interface DiscussionsProps { |
| 10 | data?: MapDiscussions; | 11 | data?: MapDiscussions; |
| @@ -88,7 +89,9 @@ const Discussions: React.FC<DiscussionsProps> = ({ data, isModerator, mapID, onR | |||
| 88 | </div> | 89 | </div> |
| 89 | 90 | ||
| 90 | <div> | 91 | <div> |
| 91 | <img src={discussionThread.discussion.creator.avatar_link} alt="" /> | 92 | <Link to={`/users/${discussionThread.discussion.creator.steam_id}`}> |
| 93 | <img src={discussionThread.discussion.creator.avatar_link} alt="" /> | ||
| 94 | </Link> | ||
| 92 | <div> | 95 | <div> |
| 93 | <span>{discussionThread.discussion.creator.user_name}</span> | 96 | <span>{discussionThread.discussion.creator.user_name}</span> |
| 94 | <span>{time_ago(new Date(discussionThread.discussion.created_at.replace("T", " ").replace("Z", "")))}</span> | 97 | <span>{time_ago(new Date(discussionThread.discussion.created_at.replace("T", " ").replace("Z", "")))}</span> |
| @@ -98,7 +101,9 @@ const Discussions: React.FC<DiscussionsProps> = ({ data, isModerator, mapID, onR | |||
| 98 | discussionThread.discussion.comments.sort((a, b) => new Date(a.date).getTime() - new Date(b.date).getTime()) | 101 | discussionThread.discussion.comments.sort((a, b) => new Date(a.date).getTime() - new Date(b.date).getTime()) |
| 99 | .map(e => ( | 102 | .map(e => ( |
| 100 | <> | 103 | <> |
| 101 | <img src={e.user.avatar_link} alt="" /> | 104 | <Link to={`/users/${e.user.steam_id}`}> |
| 105 | <img src={e.user.avatar_link} alt="" /> | ||
| 106 | </Link> | ||
| 102 | <div> | 107 | <div> |
| 103 | <span>{e.user.user_name}</span> | 108 | <span>{e.user.user_name}</span> |
| 104 | <span>{time_ago(new Date(e.date.replace("T", " ").replace("Z", "")))}</span> | 109 | <span>{time_ago(new Date(e.date.replace("T", " ").replace("Z", "")))}</span> |