diff --git a/src/common/playleaderboard/LeaderBoard.jsx b/src/common/playleaderboard/LeaderBoard.jsx index 9b7f70a77c..32856f0706 100644 --- a/src/common/playleaderboard/LeaderBoard.jsx +++ b/src/common/playleaderboard/LeaderBoard.jsx @@ -78,7 +78,6 @@ const LeaderBoard = () => {
{publishedPlays && top10Contributors && ( <> -
Top play creators of all time
diff --git a/src/common/playleaderboard/TopPlayCreators.jsx b/src/common/playleaderboard/TopPlayCreators.jsx index c2151b1f71..719ed2c12f 100644 --- a/src/common/playleaderboard/TopPlayCreators.jsx +++ b/src/common/playleaderboard/TopPlayCreators.jsx @@ -1,56 +1,100 @@ +import React from 'react'; import Table from '@mui/material/Table'; import TableBody from '@mui/material/TableBody'; import TableCell from '@mui/material/TableCell'; import TableContainer from '@mui/material/TableContainer'; import TableHead from '@mui/material/TableHead'; import TableRow from '@mui/material/TableRow'; +import Paper from '@mui/material/Paper'; +import TagRoundedIcon from '@mui/icons-material/TagRounded'; import './leaderBoard.css'; const TopPlayCreators = ({ topPlayCreators }) => { - const profilePicture = (name, avatarUrl) => { - return ( -
- {name} -
{name}
-
- ); + const firstPlace = topPlayCreators.length > 0 ? topPlayCreators[0] : null; + const secondPlace = topPlayCreators.length > 1 ? topPlayCreators[1] : null; + const thirdPlace = topPlayCreators.length > 2 ? topPlayCreators[2] : null; + + const renderRankIcon = (rank) => { + return ; }; return ( - - - - - - Name - - - Number of plays - - - - - {topPlayCreators.map((creator) => ( - - - {profilePicture(creator.displayName, creator.avatarUrl)} - - - {creator.count} +
+

Top Play Creators of All Time

+ +
+ {secondPlace && ( +
+ {secondPlace.displayName} +
{secondPlace.displayName}
+
2nd
+
+ )} + {firstPlace && ( +
+ {firstPlace.displayName} +
{firstPlace.displayName}
+
1st
+
+ )} + {thirdPlace && ( +
+ {thirdPlace.displayName} +
{thirdPlace.displayName}
+
3rd
+
+ )} +
+ + +
+ + + Place + Creator Name + + Number of Plays - ))} - -
-
+ + + {topPlayCreators.map((creator, index) => ( + + + {renderRankIcon(index + 1)} + {index + 1} + + +
+ {creator.displayName} + {creator.displayName} +
+
+ + {creator.count} Plays + +
+ ))} +
+ + +
); }; diff --git a/src/common/playleaderboard/leaderBoard.css b/src/common/playleaderboard/leaderBoard.css index 0af9bc10e9..bab6f4799f 100644 --- a/src/common/playleaderboard/leaderBoard.css +++ b/src/common/playleaderboard/leaderBoard.css @@ -1,39 +1,194 @@ -.leaderboard-container { - border: 0 solid black; - border-radius: 5px; - background-color: white; - margin-top: 10px; - margin-bottom: 20px; - padding: 5px 2rem 1rem 2rem; - --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); - --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), - 0 8px 10px -6px var(--tw-shadow-color); - box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), - var(--tw-shadow); -} +/* .leaderboard-container { + border: 0 solid black; + border-radius: 5px; + background-color: white; + margin-top: 10px; + margin-bottom: 20px; + padding: 5px 2rem 1rem 2rem; + --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), + 0 8px 10px -6px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), + var(--tw-shadow); + } + + .leaderboard-table-cell { + padding: 6px !important; + } + + .leaderboard-table-header { + font-weight: 700 !important; + font-family: var(--ff-accent) !important; + } + + .leaderboard-heading { + font-family: var(--ff-accent); + font-size: 32px !important; + } + + .leaderboard-text { + font-family: var(--ff-accent) !important; + font-size: var(--fs-md) !important; + } + + .leaderboard-loader { + display: flex; + align-items: center; + justify-content: center; + height: 100vh; + } */ + +.leaderboard-wrapper { + background-color: #ffffff; + border-radius: 16px; + padding: 24px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); + font-family: 'Inter', sans-serif; + max-width: 800px; + margin: 20px auto; + } + + .leaderboard-title { + font-size: 24px; + font-weight: 600; + color: #1a202c; + margin-bottom: 24px; + } + + .podium-container { + display: flex; + justify-content: center; + align-items: flex-end; + gap: 8px; + margin-bottom: 16px; + } + + .podium-card { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + padding: 16px; + border-radius: 12px; + width: 120px; + color: #4a5568; + border: 1px solid #e2e8f0; + transition: transform 0.2s ease-in-out; + } + + .podium-card:hover { + transform: translateY(-5px); + } + + .podium-avatar { + width: 60px; + height: 60px; + border-radius: 50%; + border: 3px solid #fff; + box-shadow: 0 2px 4px rgba(0,0,0,0.1); + margin-bottom: 8px; + } + + .podium-name { + font-weight: 600; + font-size: 14px; + color: #2d3748; + } + + .podium-rank { + font-size: 12px; + font-weight: 500; + margin-bottom: 4px; + } + + .podium-points { + font-weight: 700; + font-size: 14px; + color: #1a202c; + } + + .podium-second { + background-color: #f7fafc; + height: 170px; + order: 1; + } + + .podium-first { + background-color: #fffbef; + height: 200px; + border-color: #f6e05e; + order: 2; + } + + .podium-third { + background-color: #fdf5f2; + height: 150px; + order: 3; + } + + .winner-announcement { + text-align: center; + color: #4a5568; + font-size: 14px; + margin-bottom: 32px; + line-height: 1.5; + } + -.leaderboard-table-cell { - padding: 6px !important; -} - -.leaderboard-table-header { - font-weight: 700 !important; - font-family: var(--ff-accent) !important; -} - -.leaderboard-heading { - font-family: var(--ff-accent); - font-size: 32px !important; -} - -.leaderboard-text { - font-family: var(--ff-accent) !important; - font-size: var(--fs-md) !important; -} - -.leaderboard-loader { - display: flex; - align-items: center; - justify-content: center; - height: 100vh; -} + .leaderboard-table-container { + box-shadow: none !important; + border: 1px solid #e2e8f0; + border-radius: 12px !important; + } + + .leaderboard-table-header { + font-weight: 600 !important; + font-size: 12px !important; + color: #718096 !important; + text-transform: uppercase; + background-color: #f7fafc !important; + border-bottom: 1px solid #e2e8f0 !important; + } + + .leaderboard-table-cell { + font-size: 14px !important; + color: #2d3748 !important; + border-bottom: 1px solid #e2e8f0 !important; + } + + .user-profile { + display: flex; + align-items: center; + gap: 12px; + font-weight: 500; + } + + .table-avatar { + width: 32px; + height: 32px; + border-radius: 50%; + } + + .rank-cell { + display: flex; + align-items: center; + gap: 8px; + font-weight: 600 !important; + } + + .points-cell { + font-weight: 600 !important; + } + + .rank-icon { + font-size: 16px !important; + } + .rank-up { + color: #38a169; + } + .rank-down { + color: #e53e3e; + } + .rank-same { + color: #a0aec0; + } \ No newline at end of file