Skip to content

Commit

Permalink
Merge branch 'main' into feature/best-run-tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
therungg authored Nov 8, 2023
2 parents d20f196 + ae22a7f commit 7d12a7e
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 13 deletions.
1 change: 1 addition & 0 deletions app/games/[game]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default async function GamePage({ params }: PageProps) {
the upload is not processed yet. If you have uploaded runs for
the game, but this page still shows, please{" "}
<a href={"/contact"}>contact me!</a>
{JSON.stringify(data)}
</>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ export const CombinedTournamentSeedingTable = ({
);
return (
<td
title={`${run?.differenceToFirst.toFixed(
2
)}%`}
key={
leaderboard.username +
tournament.game
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ export const isLiveDataEligibleForTournament = (
equalsCaseInsensitive(run.category, data.category)
);
})
)
) {
return false;
}

if (
tournament.ineligibleUsers &&
Expand All @@ -38,7 +39,7 @@ export const isLiveDataEligibleForTournaments = (
data: LiveRun,
tournaments: Tournament[]
): boolean => {
return !!tournaments
.map((tournament) => isLiveDataEligibleForTournament(tournament, data))
.find((bool) => bool);
return tournaments
.map((tournament) => isLiveDataEligibleForTournament(data, tournament))
.includes(true);
};
12 changes: 7 additions & 5 deletions app/tournaments/all-tournaments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ export function AllTournaments({
}: AllTournamentsProps) {
return (
<div>
<h1>Ongoing tournaments</h1>
<h1>Tournaments</h1>

<h2>Ongoing tournaments</h2>

<ListTournaments tournaments={ongoingTournaments} />

<h1>Upcoming tournaments</h1>
<h2>Upcoming tournaments</h2>

<ListTournaments tournaments={upcomingTournaments} />

<h1>Finished tournaments</h1>
<h2>Finished tournaments</h2>

<ListTournaments tournaments={finishedTournaments} />
</div>
Expand All @@ -34,7 +36,7 @@ export const ListTournaments = ({
tournaments: Tournament[];
}) => {
return (
<Row>
<Row className={"g-3 mb-5"}>
{tournaments.map((tournament: Tournament) => {
const startDate = new Date(tournament.startDate);
const endDate = new Date(tournament.endDate);
Expand All @@ -46,7 +48,7 @@ export const ListTournaments = ({
return (
<Col sm={12} lg={6} key={tournament.name}>
{tournament.logoUrl && (
<div className="float-start d-flex d-none d-sm-block align-items-center me-2 ms-2">
<div className="float-start d-flex d-none d-sm-block align-items-center me-2">
<a
href={`/tournaments/${safeEncodeURI(
tournament.name
Expand Down
7 changes: 4 additions & 3 deletions app/tournaments/tournament-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ const tournamentEntries: Array<[string, TournamentEntryValue]> = [
{ tournament: "Defeat Ganon No SRM Community Clash Main Event" },
],
["dirtythirty", { tournament: "Dirty Thirty Sapphire Tourney 2" }],
["gsa", { tournament: "SWRC Season 3: Super Mario Sunshine" }],
["gsa", { tournament: "PACE MK8" }],
["hgss", { tournament: "HGSS Blitz" }],
["lego", { tournament: "Lego Challenge 3" }],
[
"moist",
{
tournament:
"The Elder Scrolls Adventures: Redguard Speedrun Challenge",
tournament: "Escape from Lavender Island",
},
],
["saesr", { tournament: "NCW Seeding" }],
Expand All @@ -41,6 +40,8 @@ const tournamentEntries: Array<[string, TournamentEntryValue]> = [
["basementcup", { tournament: "Ultimate Basement Cup 2023" }],
["tcs", { tournament: "TCS Community BTR" }],
["nitro_cup", { tournament: "Nitro Cup" }],
["nitro_tournament", { tournament: "Nitro Tournament 4" }],
["knuckles", { tournament: "Knuckles Story Eclipse the Record" }],
[
"3dmm",
{
Expand Down
Binary file added public/Nitro_Tournament.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/components/game/get-game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export const getGame = async (game: string) => {
return getGame(game.replace(" ", "+"));
}

if (!gameData.data) {
return gameData;
}

return { ...gameData, global: { ...globalGameData } };
};

Expand Down
1 change: 1 addition & 0 deletions src/components/run/user-detail/user-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export const UserOverview = ({
return (
<div
key={n}
className="clearfix"
style={{
marginLeft:
sameGame && globalData && images.length > 0
Expand Down
2 changes: 1 addition & 1 deletion src/components/topbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const Topbar = ({
<b>Live</b>
</Nav.Link>
<Nav.Link href="/games/">Games</Nav.Link>
<Nav.Link href="/3dmm/">3D Mario Madness</Nav.Link>
<Nav.Link href="/gsa/">PACE LTA</Nav.Link>
<Nav.Link href="/patron">
Support <PatreonBunnySvgWithoutLink />
</Nav.Link>
Expand Down

0 comments on commit 7d12a7e

Please sign in to comment.