From 188e806427ff6c9b302d994fc9c84a0300526688 Mon Sep 17 00:00:00 2001
From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>
Date: Mon, 9 Sep 2024 20:10:16 +0300
Subject: refactor: make names clickable throughout the site, fix user pages

---
 frontend/src/components/Discussions.tsx | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'frontend/src/components/Discussions.tsx')

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
 import { time_ago } from '../utils/Time';
 import { API } from '../api/Api';
 import "../css/Maps.css"
+import { Link } from 'react-router-dom';
 
 interface DiscussionsProps {
   data?: MapDiscussions;
@@ -88,7 +89,9 @@ const Discussions: React.FC<DiscussionsProps> = ({ data, isModerator, mapID, onR
                 </div>
 
                 <div>
-                  <img src={discussionThread.discussion.creator.avatar_link} alt="" />
+                  <Link to={`/users/${discussionThread.discussion.creator.steam_id}`}>
+                    <img src={discussionThread.discussion.creator.avatar_link} alt="" />
+                  </Link>
                   <div>
                     <span>{discussionThread.discussion.creator.user_name}</span>
                     <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
                     discussionThread.discussion.comments.sort((a, b) => new Date(a.date).getTime() - new Date(b.date).getTime())
                       .map(e => (
                         <>
-                          <img src={e.user.avatar_link} alt="" />
+                          <Link to={`/users/${e.user.steam_id}`}>
+                            <img src={e.user.avatar_link} alt="" />
+                          </Link>
                           <div>
                             <span>{e.user.user_name}</span>
                             <span>{time_ago(new Date(e.date.replace("T", " ").replace("Z", "")))}</span>
-- 
cgit v1.2.3

