Added turbo kart racers stat card
This commit is contained in:
@@ -20,6 +20,7 @@ import BuildBattleStats from "./_stats/build-battle/build-battle"
|
|||||||
import ArenaBrawlStats from "./_stats/classic/arenabrawl"
|
import ArenaBrawlStats from "./_stats/classic/arenabrawl"
|
||||||
import PaintballStats from "./_stats/classic/paintball"
|
import PaintballStats from "./_stats/classic/paintball"
|
||||||
import QuakecraftStats from "./_stats/classic/quakecraft"
|
import QuakecraftStats from "./_stats/classic/quakecraft"
|
||||||
|
import TkrStats from "./_stats/classic/tkr"
|
||||||
import VampireZStats from "./_stats/classic/vampirez"
|
import VampireZStats from "./_stats/classic/vampirez"
|
||||||
import WallsStats from "./_stats/classic/walls"
|
import WallsStats from "./_stats/classic/walls"
|
||||||
import CopsAndCrimsStats from "./_stats/copsandcrims/copsandcrims"
|
import CopsAndCrimsStats from "./_stats/copsandcrims/copsandcrims"
|
||||||
@@ -109,7 +110,8 @@ export function PlayerStats(
|
|||||||
"paintball": <PaintballStats stats={stats.Paintball} />,
|
"paintball": <PaintballStats stats={stats.Paintball} />,
|
||||||
"walls": <WallsStats stats={stats.Walls} />,
|
"walls": <WallsStats stats={stats.Walls} />,
|
||||||
"vampirez": <VampireZStats stats={stats.VampireZ} />,
|
"vampirez": <VampireZStats stats={stats.VampireZ} />,
|
||||||
"quakecraft": <QuakecraftStats stats={stats.Quakecraft} godlikes={achievements?.["quake_godlikes"] ?? 0} />
|
"quakecraft": <QuakecraftStats stats={stats.Quakecraft} godlikes={achievements?.["quake_godlikes"] ?? 0} />,
|
||||||
|
"tkr": <TkrStats stats={stats.TurboKartRacers} />
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
const defaultOrder = Object.keys(statsComponents)
|
const defaultOrder = Object.keys(statsComponents)
|
||||||
|
|||||||
32
src/app/(stats)/player/[ign]/_stats/classic/tkr.tsx
Normal file
32
src/app/(stats)/player/[ign]/_stats/classic/tkr.tsx
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import { Separator } from "@/components/ui/separator"
|
||||||
|
import { formatNumber } from "@/lib/formatters"
|
||||||
|
import { NonNullStats } from "@/lib/schema/player"
|
||||||
|
import { title } from "process"
|
||||||
|
import { EmptyStats, GeneralStats } from "../stats-components"
|
||||||
|
|
||||||
|
export default function TkrStats({ stats }: { stats: NonNullStats["TurboKartRacers"] }) {
|
||||||
|
if (!stats) return <EmptyStats title="Turbo Kart Racers" />
|
||||||
|
|
||||||
|
return (
|
||||||
|
<GeneralStats
|
||||||
|
id="tkr"
|
||||||
|
title="Turbo Kart Racers"
|
||||||
|
collapsedStats={[
|
||||||
|
{
|
||||||
|
title: <p>Gold</p>,
|
||||||
|
stat: <p className="text-mc-gold">{`${formatNumber(stats.gold_trophy)}🏆\uFE0E`}</p>
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <p>Silver</p>,
|
||||||
|
stat: <p className="text-mc-white">{`${formatNumber(stats.silver_trophy)}🏆\uFE0E`}</p>
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <p>Bronze</p>,
|
||||||
|
stat: <p className="text-mc-brown">{`${formatNumber(stats.bronze_trophy)}🏆\uFE0E`}</p>
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Separator className="my-4" />
|
||||||
|
</GeneralStats>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
--color-mc-light-purple: #FF55FF;
|
--color-mc-light-purple: #FF55FF;
|
||||||
--color-mc-yellow: #FFFF55;
|
--color-mc-yellow: #FFFF55;
|
||||||
--color-mc-white: #FFFFFF;
|
--color-mc-white: #FFFFFF;
|
||||||
|
--color-mc-brown: #963;
|
||||||
--spacing-header: 3.75rem;
|
--spacing-header: 3.75rem;
|
||||||
--spacing-content: calc(100vh - var(--spacing-header));
|
--spacing-content: calc(100vh - var(--spacing-header));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,14 @@ import { arcadeStatsSchema } from "./stats/arcade"
|
|||||||
import { bedwarsStatsSchema } from "./stats/bedwars"
|
import { bedwarsStatsSchema } from "./stats/bedwars"
|
||||||
import { blitzStatsSchema } from "./stats/blitz"
|
import { blitzStatsSchema } from "./stats/blitz"
|
||||||
import { buildBattleStatsSchema } from "./stats/build-battle"
|
import { buildBattleStatsSchema } from "./stats/build-battle"
|
||||||
import { arenaBrawlStatsSchema, paintBallStatsSchema, quakecraftStatsSchema, vampireZStatsSchema, wallsStatsSchema } from "./stats/classic"
|
import {
|
||||||
|
arenaBrawlStatsSchema,
|
||||||
|
paintBallStatsSchema,
|
||||||
|
quakecraftStatsSchema,
|
||||||
|
turboKartRacersStatsSchema,
|
||||||
|
vampireZStatsSchema,
|
||||||
|
wallsStatsSchema
|
||||||
|
} from "./stats/classic"
|
||||||
import { copsAndCrimsStatsSchema } from "./stats/copsandcrims"
|
import { copsAndCrimsStatsSchema } from "./stats/copsandcrims"
|
||||||
import { duelsStatsSchema } from "./stats/duels"
|
import { duelsStatsSchema } from "./stats/duels"
|
||||||
import { megawallsStats } from "./stats/megawalls"
|
import { megawallsStats } from "./stats/megawalls"
|
||||||
@@ -50,8 +57,9 @@ export const playerSchema = z.looseObject({
|
|||||||
Paintball: paintBallStatsSchema.optional(),
|
Paintball: paintBallStatsSchema.optional(),
|
||||||
Walls: wallsStatsSchema.optional(),
|
Walls: wallsStatsSchema.optional(),
|
||||||
VampireZ: vampireZStatsSchema.optional(),
|
VampireZ: vampireZStatsSchema.optional(),
|
||||||
Quake: quakecraftStatsSchema.optional()
|
Quake: quakecraftStatsSchema.optional(),
|
||||||
}).transform(({ Walls3, MCGO, HungerGames, SuperSmash, Battleground, Arena, Quake, ...rest }) => {
|
GingerBread: turboKartRacersStatsSchema.optional()
|
||||||
|
}).transform(({ Walls3, MCGO, HungerGames, SuperSmash, Battleground, Arena, Quake, GingerBread, ...rest }) => {
|
||||||
return {
|
return {
|
||||||
MegaWalls: Walls3,
|
MegaWalls: Walls3,
|
||||||
CopsAndCrims: MCGO,
|
CopsAndCrims: MCGO,
|
||||||
@@ -60,6 +68,7 @@ export const playerSchema = z.looseObject({
|
|||||||
Warlords: Battleground,
|
Warlords: Battleground,
|
||||||
ArenaBrawl: Arena,
|
ArenaBrawl: Arena,
|
||||||
Quakecraft: Quake,
|
Quakecraft: Quake,
|
||||||
|
TurboKartRacers: GingerBread,
|
||||||
...rest
|
...rest
|
||||||
}
|
}
|
||||||
}).optional(),
|
}).optional(),
|
||||||
|
|||||||
@@ -69,3 +69,9 @@ export const quakecraftStatsSchema = z.object({
|
|||||||
dash_cooldown: z.coerce.number().default(0),
|
dash_cooldown: z.coerce.number().default(0),
|
||||||
dash_power: z.coerce.number().default(0)
|
dash_power: z.coerce.number().default(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export const turboKartRacersStatsSchema = z.object({
|
||||||
|
gold_trophy: z.number().default(0),
|
||||||
|
silver_trophy: z.number().default(0),
|
||||||
|
bronze_trophy: z.number().default(0)
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user