generated from muhtadeetaron/nextjs-template
fix(ui): fix results screen
This commit is contained in:
@ -2,7 +2,9 @@
|
||||
|
||||
import BackgroundWrapper from "@/components/BackgroundWrapper";
|
||||
import Header from "@/components/Header";
|
||||
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
|
||||
import { API_URL, getToken } from "@/lib/auth";
|
||||
import Image from "next/image";
|
||||
import React, { useEffect, useState } from "react";
|
||||
|
||||
const page = () => {
|
||||
@ -94,6 +96,82 @@ const page = () => {
|
||||
<BackgroundWrapper>
|
||||
<section>
|
||||
<Header displaySubject={"Leaderboard"} displayTabTitle={null} />
|
||||
<section className="flex flex-col mx-10 pt-10 space-y-4">
|
||||
<section className="flex justify-evenly items-end">
|
||||
{getTopThree(boardData).map((student, idx) =>
|
||||
student ? (
|
||||
<div
|
||||
key={idx}
|
||||
className="w-[100px] flex flex-col bg-[#113768] rounded-t-xl items-center justify-start pt-4 space-y-3"
|
||||
style={{ height: student.height }}
|
||||
>
|
||||
<h3 className="font-bold text-xl text-white">
|
||||
{student.rank}
|
||||
</h3>
|
||||
<Avatar className="bg-slate-300 w-12 h-12">
|
||||
<AvatarFallback className="text-xl font-semibold">
|
||||
{student.name.charAt(0).toUpperCase()}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
<p className="font-bold text-md text-center text-white">
|
||||
{student.name}
|
||||
</p>
|
||||
<p className="text-sm text-white">({student.points}pt)</p>
|
||||
</div>
|
||||
) : null
|
||||
)}
|
||||
</section>
|
||||
<div className="w-full border-[0.5px] border-[#c5dbf8] bg-[#c5dbf8]"></div>
|
||||
<section className="border-[1px] border-[#c0dafc] w-full rounded-3xl p-6 space-y-4 mb-20">
|
||||
<section>
|
||||
{getUserData(boardData, userData?.name).map((user, idx) => (
|
||||
<div
|
||||
key={idx}
|
||||
className="flex bg-[#113768] rounded-[8] py-2 px-4 justify-between items-center"
|
||||
>
|
||||
<div className=" flex gap-3 items-center">
|
||||
<h2 className="font-medium text-lg text-white">
|
||||
{user.rank}
|
||||
</h2>
|
||||
<Avatar className="bg-slate-300 w-6 h-6">
|
||||
<AvatarFallback className="text-md font-semibold">
|
||||
{user.name.charAt(0).toUpperCase()}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
<h3 className="font-medium text-sm text-white">You</h3>
|
||||
</div>
|
||||
<p className="font-medium text-white/70">{user.points}pt</p>
|
||||
</div>
|
||||
))}
|
||||
</section>
|
||||
<div className="w-full border-[0.5px] border-[#c5dbf8] bg-[#c5dbf8]"></div>
|
||||
<section className="space-y-4">
|
||||
{getLeaderboard(boardData)
|
||||
.slice(0, 10)
|
||||
.map((user, idx) => (
|
||||
<div
|
||||
key={idx}
|
||||
className="flex border-2 border-[#c5dbf8] rounded-[8] py-2 px-4 justify-between items-center"
|
||||
>
|
||||
<div className="flex gap-3 items-center">
|
||||
<h2 className="font-medium text-lg">{idx + 1}</h2>
|
||||
<Avatar className="bg-slate-300 w-6 h-6">
|
||||
<AvatarFallback className="text-md font-semibold">
|
||||
{user.name.charAt(0).toUpperCase()}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
<h3 className="font-medium text-sm">
|
||||
{user.name.split(" ").slice(0, 2).join(" ")}
|
||||
</h3>
|
||||
</div>
|
||||
<p className="font-medium text-[#000]/40">
|
||||
{user.points}pt
|
||||
</p>
|
||||
</div>
|
||||
))}
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
</BackgroundWrapper>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user