-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
67 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,39 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import Nav from "@/components/nav"; | ||
|
||
export default function Leaderboard() { | ||
const [leaderboard, setLeaderboard] = useState([]); | ||
const [profiles, setProfiles] = useState({}); | ||
const [range, setRange] = useState("all"); | ||
const [type, setType] = useState("xp"); | ||
const [total, setTotal] = useState(0); | ||
|
||
export default function Leaderboard(){ | ||
|
||
useEffect(() => { | ||
const fetchLeaderboard = async () => {}; | ||
}, []); | ||
|
||
|
||
return ( | ||
<div> | ||
<h1>Leaderboard</h1> | ||
</div> | ||
); | ||
} | ||
if (leaderboard.length == 0) { | ||
return ( | ||
<main> | ||
<Nav /> | ||
<div className="flex flex-col items-center"> | ||
<p className="text-3xl text-center font-bold">Leaderboard</p> | ||
<table className="mt-10 w-4/5"> | ||
<tbody className="w-full" id="data"> | ||
<tr className="w-full bg-slate-700 text-center"> | ||
<td className="p-2 rounded-sm">lol</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</main> | ||
); | ||
} else { | ||
return ( | ||
<main> | ||
<h1 className="m-5 text-3xl font-bold text-center">Loading...</h1> | ||
<p className="font-symbol text-center text-6xl animate-spin"></p> | ||
</main> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export const types = { | ||
'kills': 'Kills', | ||
'coins': 'Coins', | ||
'playtime': 'Survived', | ||
'xp': 'XP', | ||
'total-coins': 'Total Coins', | ||
'total-kills': 'Total Stabs', | ||
'total-playtime': 'Total Playtime', | ||
} | ||
|
||
export const ranges = { | ||
'all': 'All-Time', | ||
'day': 'Past Day', | ||
'week': 'Past Week', | ||
} | ||
|
||
const ApiUrl = "https://sb-api-fb48ef34a197.herokuapp.com/" | ||
|
||
export async function getLeaderboard(range, type){ | ||
|
||
} |