Skip to content

Commit

Permalink
referral leaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
kavinvalli committed Nov 7, 2022
1 parent c8596f4 commit 41b3007
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 120 deletions.
133 changes: 71 additions & 62 deletions resources/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,92 +17,101 @@
}

@font-face {
font-family: 'Panchang';
src: url('fonts/Panchang-Variable.woff2') format('woff2'),
url('fonts/Panchang-Variable.woff') format('woff'),
url('fonts/Panchang-Variable.ttf') format('truetype');
font-weight: 200 800;
font-display: swap;
font-style: normal;
font-family: "Panchang";
src: url("fonts/Panchang-Variable.woff2") format("woff2"),
url("fonts/Panchang-Variable.woff") format("woff"),
url("fonts/Panchang-Variable.ttf") format("truetype");
font-weight: 200 800;
font-display: swap;
font-style: normal;
}


@font-face {
font-family: 'Panchang';
src: url('fonts/Panchang-Extralight.woff2') format('woff2'),
url('fonts/Panchang-Extralight.woff') format('woff'),
url('fonts/Panchang-Extralight.ttf') format('truetype');
font-weight: 200;
font-display: swap;
font-style: normal;
font-family: "Panchang";
src: url("fonts/Panchang-Extralight.woff2") format("woff2"),
url("fonts/Panchang-Extralight.woff") format("woff"),
url("fonts/Panchang-Extralight.ttf") format("truetype");
font-weight: 200;
font-display: swap;
font-style: normal;
}


@font-face {
font-family: 'Panchang';
src: url('fonts/Panchang-Light.woff2') format('woff2'),
url('fonts/Panchang-Light.woff') format('woff'),
url('fonts/Panchang-Light.ttf') format('truetype');
font-weight: 300;
font-display: swap;
font-style: normal;
font-family: "Panchang";
src: url("fonts/Panchang-Light.woff2") format("woff2"),
url("fonts/Panchang-Light.woff") format("woff"),
url("fonts/Panchang-Light.ttf") format("truetype");
font-weight: 300;
font-display: swap;
font-style: normal;
}


@font-face {
font-family: 'Panchang';
src: url('fonts/Panchang-Regular.woff2') format('woff2'),
url('fonts/Panchang-Regular.woff') format('woff'),
url('fonts/Panchang-Regular.ttf') format('truetype');
font-weight: 400;
font-display: swap;
font-style: normal;
font-family: "Panchang";
src: url("fonts/Panchang-Regular.woff2") format("woff2"),
url("fonts/Panchang-Regular.woff") format("woff"),
url("fonts/Panchang-Regular.ttf") format("truetype");
font-weight: 400;
font-display: swap;
font-style: normal;
}


@font-face {
font-family: 'Panchang';
src: url('fonts/Panchang-Medium.woff2') format('woff2'),
url('fonts/Panchang-Medium.woff') format('woff'),
url('fonts/Panchang-Medium.ttf') format('truetype');
font-weight: 500;
font-display: swap;
font-style: normal;
font-family: "Panchang";
src: url("fonts/Panchang-Medium.woff2") format("woff2"),
url("fonts/Panchang-Medium.woff") format("woff"),
url("fonts/Panchang-Medium.ttf") format("truetype");
font-weight: 500;
font-display: swap;
font-style: normal;
}


@font-face {
font-family: 'Panchang';
src: url('fonts/Panchang-Semibold.woff2') format('woff2'),
url('fonts/Panchang-Semibold.woff') format('woff'),
url('fonts/Panchang-Semibold.ttf') format('truetype');
font-weight: 600;
font-display: swap;
font-style: normal;
font-family: "Panchang";
src: url("fonts/Panchang-Semibold.woff2") format("woff2"),
url("fonts/Panchang-Semibold.woff") format("woff"),
url("fonts/Panchang-Semibold.ttf") format("truetype");
font-weight: 600;
font-display: swap;
font-style: normal;
}

@font-face {
font-family: "Panchang";
src: url("fonts/Panchang-Bold.woff2") format("woff2"),
url("fonts/Panchang-Bold.woff") format("woff"),
url("fonts/Panchang-Bold.ttf") format("truetype");
font-weight: 700;
font-display: swap;
font-style: normal;
}

@font-face {
font-family: 'Panchang';
src: url('fonts/Panchang-Bold.woff2') format('woff2'),
url('fonts/Panchang-Bold.woff') format('woff'),
url('fonts/Panchang-Bold.ttf') format('truetype');
font-weight: 700;
font-display: swap;
font-style: normal;
font-family: "Panchang";
src: url("fonts/Panchang-Extrabold.woff2") format("woff2"),
url("fonts/Panchang-Extrabold.woff") format("woff"),
url("fonts/Panchang-Extrabold.ttf") format("truetype");
font-weight: 800;
font-display: swap;
font-style: normal;
}

::-webkit-scrollbar {
width: 20px;
}

@font-face {
font-family: 'Panchang';
src: url('fonts/Panchang-Extrabold.woff2') format('woff2'),
url('fonts/Panchang-Extrabold.woff') format('woff'),
url('fonts/Panchang-Extrabold.ttf') format('truetype');
font-weight: 800;
font-display: swap;
font-style: normal;
::-webkit-scrollbar-track {
background: transparent;
}

::-webkit-scrollbar-thumb {
background: #ffffff;
}

/* ::-webkit-scrollbar-thumb:hover { */
/* background: transparent; */
/* } */

#nprogress .bar {
box-shadow: none;
height: 5px !important;
Expand Down
8 changes: 4 additions & 4 deletions resources/js/lib/use-navbar-links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ export default function useNavbarLinks() {
.concat(
authenticated
? [
// {
// href: "/leaderboard",
// label: "Leaderboard",
// },
{
href: "/rlleaderboard",
label: "Referral Leaderboard",
},
// {
// href: "/me",
// label: "Profile",
Expand Down
104 changes: 51 additions & 53 deletions resources/js/pages/rlleaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,70 +45,68 @@ const RlLeaderboard: React.FC<IRlLeaderboardProps> = ({
return (
<Layout authenticated={authenticated}>
<div className="home-container h-screen flex flex-col justify-start items-center p-10">
<h1 className="text-xl text-center sm:text-[2rem] lg:text-[4rem] font-bold tracking-wider h-[2rem] mb-4 sm:h-[4rem]">
REFERRAL LEADERBOARD
</h1>
<div className="px-10 max-w-[1000px] w-full mx-auto">
<input
type="text"
placeholder="Search"
ref={searchRef}
onChange={handleSearch}
// className="w-full bg-gray-600 opacity-70 focus:opacity-90 p-6 text-lg text-white border-t-0 border-r-0 border-l-0 border-b-4 border-gray-400 focus:border-sudo transition"
className="w-full bg-dark-lighter px-6 py-4 text-lg text-white border-2 border-gray-400 rounded focus:border-sudo transition mb-4"
// className="w-full bg-dark-lighter px-6 py-4 text-lg text-white border-2 border-gray-400 rounded focus:border-sudo transition mb-4"
className="bg-transparent text-gray-200 block w-full border-0 border-b-2 border-gray-600 transition focus:ring-0 focus:!outline-none focus:!shadow-none focus:border-sudo-red py-4 px-1"
style={{ boxShadow: "none" }}
/>
</div>
<IndexCard
className="h-[calc(100vh-104px-120px)] overflow-y-auto w-full lg:w-3/4"
authenticated={authenticated}
title="Leaderboard"
>
<div className="flex-1 overflow-y-auto p-10 max-w-[1000px] h-full w-full mx-auto">
<table className="w-full border-collapse">
<thead>
<tr className="font-extrabold text-xl uppercase text-sudo">
<th className="p-5">Rank</th>
<th className="p-5">Username</th>
{/* <th className="p-5">Points</th> */}
<th className="p-5">Referrals</th>
</tr>
</thead>
<tbody>
{/* {displayUsers.map(({ rank, username, points }, i) => ( */}
{displayUsers.map(
({ rank, username, number_of_referrals }, i) => (
<tr
key={i}
className={
rank === "DQ"
? "text-sudo-dark font-extrabold"
: "font-bold"
}
<div className="flex-1 overflow-y-auto p-10 max-w-[1000px] h-full w-full mx-auto">
<table className="w-full border-collapse">
<thead>
<tr className="font-extrabold text-xl uppercase text-sudo">
<th className="p-5">Rank</th>
<th className="p-5">Username</th>
{/* <th className="p-5">Points</th> */}
<th className="p-5">Referrals</th>
</tr>
</thead>
<tbody>
{/* {displayUsers.map(({ rank, username, points }, i) => ( */}
{displayUsers.map(
({ rank, username, number_of_referrals }, i) => (
<tr
key={i}
className={
rank === "DQ"
? "text-sudo-dark font-extrabold"
: "font-bold"
}
>
<td
className="text-lg text-center p-5 bg-none"
style={{ color: "inerit" }}
>
<td
className="text-lg text-center p-5 bg-none"
style={{ color: "inerit" }}
>
{i + 1}
</td>
<td
className="text-lg text-center p-5 bg-none"
style={{ color: "inerit" }}
>
{username}
</td>
<td
className="text-lg text-center p-5 bg-none"
style={{ color: "inerit" }}
>
{/* {points} */}
{number_of_referrals}
</td>
</tr>
)
)}
</tbody>
</table>
</div>
</IndexCard>
{i + 1}
</td>
<td
className="text-lg text-center p-5 bg-none"
style={{ color: "inerit" }}
>
{username}
</td>
<td
className="text-lg text-center p-5 bg-none"
style={{ color: "inerit" }}
>
{/* {points} */}
{number_of_referrals}
</td>
</tr>
)
)}
</tbody>
</table>
</div>
</div>
</Layout>
);
Expand Down
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

Route::get('/dq', [IndexController::class, 'dq'])->name('dq');
Route::get('/leaderboard', [LeaderboardController::class, 'show'])->name('leaderboard');
/* Route::get('/rlleaderboard', [RlLeaderboardController::class, 'show'])->name('rlleaderboard'); */
Route::get('/rlleaderboard', [RlLeaderboardController::class, 'show'])->name('rlleaderboard');

Route::get('/', [IndexController::class, 'show'])->middleware(['dq'])->name('index');
Route::get('/about', [IndexController::class, 'about'])->middleware(['dq'])->name('about');
Expand Down

0 comments on commit 41b3007

Please sign in to comment.