From 79982cd0b57d14193ff74988c3fdad803e844f9d Mon Sep 17 00:00:00 2001 From: Bhavy_Zala Date: Fri, 5 Jul 2024 23:28:43 +0530 Subject: [PATCH] Leaderboard fix for small screen --- frontend/src/pages/LeaderBoard.tsx | 93 +++++++++++++++--------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/frontend/src/pages/LeaderBoard.tsx b/frontend/src/pages/LeaderBoard.tsx index 4c325e72..61e3fcd7 100644 --- a/frontend/src/pages/LeaderBoard.tsx +++ b/frontend/src/pages/LeaderBoard.tsx @@ -7,7 +7,6 @@ import { useTranslation } from 'react-i18next'; import useLeaderboard from '../hooks/useLeadearboard'; import bgHero from "../assets/bgHero.png"; - const LeaderBoard = () => { const {loading, leaderboard} = useLeaderboard(); const currentUser = useRecoilValue(userState); @@ -16,58 +15,60 @@ const LeaderBoard = () => { document.title='Style Share | Top users 😎' return ( -
-
-

{t("navbar.links.leaderboard")} 🥳

+
+
+

{t("navbar.links.leaderboard")} 🥳

{loading ? (
) : ( - - - - - - - - - - - - {leaderboard.map((user, index) => ( - - + + + + + ))} + +
{t("leaderboard.rank")}{t("leaderboard.profile")}{t("leaderboard.username")}{t("leaderboard.posts")}{t("leaderboard.likes")}
- {(index === 0 || index === 1 || index === 2) ? ( +
+ + + + {/* Adjusted padding for small screens */} + + + + + + + + {leaderboard.map((user, index) => ( + + + - - - - - - ))} - -
{t("leaderboard.rank")}{t("leaderboard.profile")}{t("leaderboard.username")}{t("leaderboard.posts")}{t("leaderboard.likes")}
+ {(index === 0 || index === 1 || index === 2) ? ( +
+ +
+ ) : ( + user.rank + )} +
- + profile-pic
- ) : ( - user.rank - )} -
-
- profile-pic -
-
- @{user.username} - -
{user.postCount}
-
-
{user.totalLikes}
-
+
+ @{user.username} + +
{user.postCount}
+
+
{user.totalLikes}
+
+
)}
@@ -75,4 +76,4 @@ const LeaderBoard = () => { ); } -export default LeaderBoard; \ No newline at end of file +export default LeaderBoard;