From fb69de920a567683af92199120a31e7bbc0dfebc Mon Sep 17 00:00:00 2001 From: NOOB-3301 Date: Wed, 19 Feb 2025 01:42:06 +0530 Subject: [PATCH] added user following compoent --- front-end/src/pages/ProfilePage.jsx | 53 +++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/front-end/src/pages/ProfilePage.jsx b/front-end/src/pages/ProfilePage.jsx index c867d5f..cecad1a 100644 --- a/front-end/src/pages/ProfilePage.jsx +++ b/front-end/src/pages/ProfilePage.jsx @@ -17,6 +17,15 @@ import { motion, AnimatePresence } from 'framer-motion'; import Markdown from 'react-markdown'; import LikeButton from '../components/LikeButton'; +const dummyFollowing = [ + { id: 1, name: "User 1", image: "https://via.placeholder.com/50" }, + { id: 2, name: "User 2", image: "https://via.placeholder.com/50" }, + { id: 3, name: "User 2", image: "https://via.placeholder.com/50" }, + { id: 4, name: "User 3", image: "https://via.placeholder.com/50" }, + { id: 5, name: "User 4", image: "https://via.placeholder.com/50" } +]; + + const ProfilePage = () => { const [user, setUser] = useState({}); const [userArticles, setUserArticles] = useState([]); @@ -232,6 +241,50 @@ const ProfilePage = () => { + +
+

+ + You Following: +

+ +

You are following:

+ + {user.following && user.following.length > 0 ? ( + + {user.following.map((followedUser) => ( + + {followedUser.name} + {followedUser.name} + + ))} + + ) : ( + + {dummyFollowing.map((user) => ( + + {user.name} + {user.name} + + ))} + + )} +
+ +
{/* Additional Sections */}