diff --git a/src/app/(home)/major-league-balatro/_components/match-card.tsx b/src/app/(home)/major-league-balatro/_components/match-card.tsx index 74dfca6..420e702 100644 --- a/src/app/(home)/major-league-balatro/_components/match-card.tsx +++ b/src/app/(home)/major-league-balatro/_components/match-card.tsx @@ -52,7 +52,7 @@ export const MatchCard = ({ match }: MatchCardProps) => { - + {date} • {time} @@ -94,7 +94,11 @@ export const MatchCard = ({ match }: MatchCardProps) => { target='_blank' rel='noopener noreferrer' > - + {vod1.includes('twitch') ? ( + + ) : ( + + )} {player1.name} @@ -106,7 +110,11 @@ export const MatchCard = ({ match }: MatchCardProps) => { target='_blank' rel='noopener noreferrer' > - + {vod2.includes('twitch') ? ( + + ) : ( + + )} {player2.name} diff --git a/src/app/(home)/major-league-balatro/_components/next-match-info-card.tsx b/src/app/(home)/major-league-balatro/_components/next-match-info-card.tsx index c9e483f..c40344a 100644 --- a/src/app/(home)/major-league-balatro/_components/next-match-info-card.tsx +++ b/src/app/(home)/major-league-balatro/_components/next-match-info-card.tsx @@ -6,7 +6,6 @@ import { DropdownMenuTrigger, } from '@/components/ui/dropdown-menu' import { SiTwitch } from '@icons-pack/react-simple-icons' -import { Twitch } from 'lucide-react' import Link from 'next/link' import type { Player } from '../types' import { PlayerAvatar } from './player-avatar' diff --git a/src/app/(home)/major-league-balatro/_components/next-match-info.tsx b/src/app/(home)/major-league-balatro/_components/next-match-info.tsx index 52d1d74..f16ce16 100644 --- a/src/app/(home)/major-league-balatro/_components/next-match-info.tsx +++ b/src/app/(home)/major-league-balatro/_components/next-match-info.tsx @@ -2,6 +2,7 @@ import { NextMatchInfoCard } from '@/app/(home)/major-league-balatro/_components import { CountdownTimer } from '@/components/countdown-timer' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Calendar, Clock } from 'lucide-react' +import { useFormatter } from 'next-intl' import type { PropsWithChildren } from 'react' import { players } from '../_constants/players' import type { Match } from '../types' @@ -11,6 +12,7 @@ export type NextMatchInfoProps = { } export function NextMatchInfo({ nextMatch }: NextMatchInfoProps) { + const formatter = useFormatter() if (!nextMatch) { return ( @@ -39,6 +41,15 @@ export function NextMatchInfo({ nextMatch }: NextMatchInfoProps) { const nextMatchPlayer1 = players[nextMatch.player1Id] const nextMatchPlayer2 = players[nextMatch.player2Id] + const date = formatter.dateTime(nextMatch.datetime, { + month: 'long', + day: 'numeric', + year: 'numeric', + }) + const time = formatter.dateTime(nextMatch.datetime, { + timeStyle: 'short', + }) + if (!nextMatchPlayer1) { throw new Error(`Player ${nextMatch.player1Id} not found`) } @@ -57,7 +68,7 @@ export function NextMatchInfo({ nextMatch }: NextMatchInfoProps) {

- {nextMatch.date} - {nextMatch.time} + {date} • {time}

diff --git a/src/app/(home)/major-league-balatro/_components/schedule.tsx b/src/app/(home)/major-league-balatro/_components/schedule.tsx index 490450a..22c0150 100644 --- a/src/app/(home)/major-league-balatro/_components/schedule.tsx +++ b/src/app/(home)/major-league-balatro/_components/schedule.tsx @@ -62,8 +62,7 @@ type StatusBadgeProps = { } const StatusBadge = ({ status }: StatusBadgeProps) => { - const { variant, className } = - WEEK_CONFIG[status]?.badgeProps || DEFAULT_BADGE_PROPS + const { variant } = WEEK_CONFIG[status]?.badgeProps || DEFAULT_BADGE_PROPS const text = status === 'completed' @@ -104,10 +103,12 @@ const WeekTab = ({ week, matches, status }: WeekTabProps) => { } const filteredMatches = useMemo( () => - matches.filter( - (m) => m.week === week || m.week === Number.parseInt(String(week)) - ), - [matches, week] + matches + .filter( + (m) => m.week === week || m.week === Number.parseInt(String(week)) + ) + .sort((a, b) => (a.datetime > b.datetime ? 1 : -1)), + [(matches, week)] ) return ( diff --git a/src/app/(home)/major-league-balatro/_constants/matches.ts b/src/app/(home)/major-league-balatro/_constants/matches.ts index 28a85d5..936c707 100644 --- a/src/app/(home)/major-league-balatro/_constants/matches.ts +++ b/src/app/(home)/major-league-balatro/_constants/matches.ts @@ -7,8 +7,6 @@ export const matches: Match[] = [ division: 'Blue', player1Id: 'roffle', player2Id: 'haelian', - date: 'April 9, 2025', - time: '3:00 PM EDT', datetime: new Date('2025-04-09T15:00:00-04:00'), vod1: 'https://www.twitch.tv/videos/2428370737?t=01h26m15s', vod2: 'https://www.twitch.tv/videos/2428334601?t=02h10m32s', @@ -20,8 +18,6 @@ export const matches: Match[] = [ division: 'Blue', player1Id: 'zainotv', player2Id: 'bear', - date: 'April 7, 2025', - time: '8:00 PM EDT', datetime: new Date('2025-04-07T20:00:00-04:00'), vod1: 'https://youtu.be/NCsQ3PePAdc', vod2: 'https://www.twitch.tv/videos/2426932234?t=00h20m47s', @@ -33,8 +29,6 @@ export const matches: Match[] = [ division: 'Blue', player1Id: 'gothic', player2Id: 'neato', - date: 'April 9, 2025', - time: '1:00 PM EDT', datetime: new Date('2025-04-09T13:00:00-04:00'), vod1: 'https://youtu.be/BAcx4fih1V4', vod2: 'https://www.twitch.tv/videos/2428289132?t=01h56m48s', @@ -46,8 +40,6 @@ export const matches: Match[] = [ division: 'Red', player1Id: 'drspectred', player2Id: 'malf', - date: 'April 7, 2025', - time: '11:00 AM EDT', datetime: new Date('2025-04-07T11:00:00-04:00'), vod1: 'https://www.twitch.tv/videos/2426535670?t=01h08m29s', vod2: 'https://www.twitch.tv/videos/2426478651?t=02h52m39s', @@ -59,8 +51,6 @@ export const matches: Match[] = [ division: 'Red', player1Id: 'skoottie', player2Id: 'nandre', - date: 'April 7, 2025', - time: '9:00 PM EDT', datetime: new Date('2025-04-07T21:00:00-04:00'), vod1: 'https://www.twitch.tv/videos/2426992443?t=00h15m19s', vod2: 'https://www.twitch.tv/videos/2426985590?t=00h22m44s', @@ -72,8 +62,6 @@ export const matches: Match[] = [ division: 'Red', player1Id: 'edzy', player2Id: 'seadubbs', - date: 'April 8, 2025', - time: '6:30 PM EDT', datetime: new Date('2025-04-08T18:30:00-04:00'), vod1: 'https://www.twitch.tv/videos/2427881454?t=01h13m54s', vod2: 'https://www.twitch.tv/videos/2427647925?t=01h51m03s', @@ -87,8 +75,6 @@ export const matches: Match[] = [ division: 'Blue', player1Id: 'roffle', player2Id: 'zainotv', - date: 'April 15, 2025', - time: '5:00 PM EDT', datetime: new Date('2025-04-15T17:00:00-04:00'), vod1: 'https://www.twitch.tv/videos/2433708429?t=2h31m42s', vod2: 'https://www.twitch.tv/videos/2433805983?t=0h29m52s', @@ -100,8 +86,6 @@ export const matches: Match[] = [ division: 'Blue', player1Id: 'haelian', player2Id: 'gothic', - date: 'April 16, 2025', - time: '3:00 PM EDT', datetime: new Date('2025-04-16T15:00:00-04:00'), vod1: 'https://www.twitch.tv/videos/2434505224?t=2h4m35s', vod2: 'https://www.twitch.tv/videos/2434576019?t=0h38m11s', @@ -113,8 +97,6 @@ export const matches: Match[] = [ division: 'Blue', player1Id: 'bear', player2Id: 'neato', - date: 'April 16, 2025', - time: '1:00 PM EDT', datetime: new Date('2025-04-16T13:00:00-04:00'), vod1: 'https://www.twitch.tv/videos/2434505033?t=0h9m42s', vod2: 'https://www.twitch.tv/videos/2434499724?t=0h16m5s', @@ -126,8 +108,6 @@ export const matches: Match[] = [ division: 'Red', player1Id: 'drspectred', player2Id: 'skoottie', - date: 'April 14, 2025', - time: '1:00 PM EDT', datetime: new Date('2025-04-14T13:00:00-04:00'), vod1: 'https://www.twitch.tv/videos/2432780721?t=0h6m52s', vod2: 'https://www.twitch.tv/videos/2432776421?t=0h12m29s', @@ -139,8 +119,6 @@ export const matches: Match[] = [ division: 'Red', player1Id: 'malf', player2Id: 'edzy', - date: 'April 17, 2025', - time: '2:00 PM EDT', datetime: new Date('2025-04-17T14:00:00-04:00'), vod1: 'https://www.twitch.tv/videos/2435238972?t=4h54m48s', vod2: 'https://www.twitch.tv/videos/2435320190?t=2h37m18s', @@ -152,8 +130,6 @@ export const matches: Match[] = [ division: 'Red', player1Id: 'nandre', player2Id: 'seadubbs', - date: 'April 15, 2025', - time: '6:30 PM EDT', datetime: new Date('2025-04-15T18:30:00-04:00'), vod1: 'https://www.twitch.tv/videos/2433882453?t=0h11m14s', vod2: 'https://www.twitch.tv/videos/2433878480?t=0h16m39s', @@ -167,8 +143,6 @@ export const matches: Match[] = [ division: 'Blue', player1Id: 'roffle', player2Id: 'bear', - date: 'April 21, 2025', - time: '5:00 PM EDT', datetime: new Date('2025-04-21T17:00:00-04:00'), vod1: 'https://www.twitch.tv/videos/2439002527?t=2h35m39s', vod2: 'https://www.twitch.tv/videos/2439115722?t=0h9m57s', @@ -180,8 +154,6 @@ export const matches: Match[] = [ division: 'Blue', player1Id: 'zainotv', player2Id: 'gothic', - date: 'April 21, 2025', - time: '4:00 PM EDT', datetime: new Date('2025-04-21T16:00:00-04:00'), vod1: 'https://www.twitch.tv/videos/2439061383?t=0h19m32s', vod2: 'https://www.twitch.tv/videos/2439069703?t=0h8m18s', @@ -193,8 +165,6 @@ export const matches: Match[] = [ division: 'Blue', player1Id: 'haelian', player2Id: 'neato', - date: 'April 23, 2025', - time: '1:00 PM EDT', datetime: new Date('2025-04-23T13:00:00-04:00'), vod1: 'https://www.twitch.tv/videos/2440603518?t=0h42m56s', vod2: 'https://www.twitch.tv/videos/2440622793?t=0h15m35s', @@ -206,8 +176,6 @@ export const matches: Match[] = [ division: 'Red', player1Id: 'drspectred', player2Id: 'nandre', - date: 'April 22, 2025', - time: '1:00 PM EDT', datetime: new Date('2025-04-22T13:00:00-04:00'), vod1: 'https://www.twitch.tv/videos/2439955669?t=0h26m44s', vod2: 'https://www.twitch.tv/videos/2439965151?t=0h13m20s', @@ -219,10 +187,10 @@ export const matches: Match[] = [ division: 'Red', player1Id: 'malf', player2Id: 'seadubbs', - date: 'April 25, 2025', - time: '11:00 AM EDT', datetime: new Date('2025-04-25T11:00:00-04:00'), - completed: false, + vod1: 'https://www.twitch.tv/videos/2442216828?t=1h52m44s', + vod2: 'https://www.twitch.tv/videos/2442251262?t=0h54m45s', + completed: true, week: 3, }, { @@ -230,10 +198,10 @@ export const matches: Match[] = [ division: 'Red', player1Id: 'skoottie', player2Id: 'edzy', - date: 'April 25, 2025', - time: '3:00 PM EDT', datetime: new Date('2025-04-25T15:00:00-04:00'), - completed: false, + vod1: 'https://www.twitch.tv/videos/2442405006?t=1h7m57s', + vod2: 'https://www.twitch.tv/videos/2442311541?t=3h11m42s', + completed: true, week: 3, }, @@ -243,9 +211,7 @@ export const matches: Match[] = [ division: 'Blue', player1Id: 'roffle', player2Id: 'gothic', - date: 'April 29, 2025', - time: '5:00 PM EDT', - datetime: new Date('2025-04-29T17:00:00-04:00'), + datetime: new Date('2025-04-29T14:00:00-04:00'), completed: false, week: 4, }, @@ -254,8 +220,6 @@ export const matches: Match[] = [ division: 'Blue', player1Id: 'haelian', player2Id: 'bear', - date: 'April 28, 2025', - time: '5:00 PM EDT', datetime: new Date('2025-04-28T17:00:00-04:00'), completed: false, week: 4, @@ -265,8 +229,6 @@ export const matches: Match[] = [ division: 'Blue', player1Id: 'zainotv', player2Id: 'neato', - date: 'May 1, 2025', - time: '5:00 PM EDT', datetime: new Date('2025-05-01T17:00:00-04:00'), completed: false, week: 4, @@ -276,9 +238,7 @@ export const matches: Match[] = [ division: 'Red', player1Id: 'drspectred', player2Id: 'edzy', - date: 'April 30, 2025', - time: '1:00 PM EDT', - datetime: new Date('2025-04-30T13:00:00-04:00'), + datetime: new Date('2025-05-01T15:00:00-04:00'), completed: false, week: 4, }, @@ -287,9 +247,7 @@ export const matches: Match[] = [ division: 'Red', player1Id: 'malf', player2Id: 'nandre', - date: 'April 30, 2025', - time: '2:00 PM EDT', - datetime: new Date('2025-04-30T14:00:00-04:00'), + datetime: new Date('2025-05-02T13:00:00-04:00'), completed: false, week: 4, }, @@ -298,9 +256,7 @@ export const matches: Match[] = [ division: 'Red', player1Id: 'skoottie', player2Id: 'seadubbs', - date: 'May 2, 2025', - time: '3:00 PM EDT', - datetime: new Date('2025-05-02T15:00:00-04:00'), + datetime: new Date('2025-04-29T20:00:00-04:00'), completed: false, week: 4, }, @@ -311,8 +267,7 @@ export const matches: Match[] = [ // division: 'Blue', // player1Id: 'roffle', // player2Id: 'neato', - // date: 'May 5, 2025', - // time: '5:00 PM EDT', + // // datetime: new Date('2025-05-05T17:00:00-04:00'), // completed: false, // week: 5, @@ -322,8 +277,7 @@ export const matches: Match[] = [ // division: 'Blue', // player1Id: 'haelian', // player2Id: 'zainotv', - // date: 'May 7, 2025', - // time: '3:00 PM EDT', + // // datetime: new Date('2025-05-07T15:00:00-04:00'), // completed: false, // week: 5, @@ -333,8 +287,7 @@ export const matches: Match[] = [ // division: 'Blue', // player1Id: 'bear', // player2Id: 'gothic', - // date: 'May 8, 2025', - // time: '1:00 PM EDT', + // // datetime: new Date('2025-05-08T13:00:00-04:00'), // completed: false, // week: 5, @@ -344,8 +297,7 @@ export const matches: Match[] = [ // division: 'Red', // player1Id: 'drspectred', // player2Id: 'seadubbs', - // date: 'May 5, 2025', - // time: '1:00 PM EDT', + // // datetime: new Date('2025-05-05T13:00:00-04:00'), // completed: false, // week: 5, @@ -355,8 +307,7 @@ export const matches: Match[] = [ // division: 'Red', // player1Id: 'malf', // player2Id: 'skoottie', - // date: 'May 6, 2025', - // time: '2:00 PM EDT', + // // datetime: new Date('2025-05-06T14:00:00-04:00'), // completed: false, // week: 5, @@ -366,8 +317,7 @@ export const matches: Match[] = [ // division: 'Red', // player1Id: 'nandre', // player2Id: 'edzy', - // date: 'May 9, 2025', - // time: '6:30 PM EDT', + // // datetime: new Date('2025-05-09T18:30:00-04:00'), // completed: false, // week: 5, @@ -379,8 +329,7 @@ export const matches: Match[] = [ // division: 'Playoff', // player1Id: 'tbd', // player2Id: 'tbd', - // date: 'May 12, 2025', - // time: '5:00 PM EDT', + // // datetime: new Date('2025-05-12T17:00:00-04:00'), // completed: false, // week: 'Play-in', @@ -390,8 +339,7 @@ export const matches: Match[] = [ // division: 'Playoff', // player1Id: 'tbd', // player2Id: 'tbd', - // date: 'May 13, 2025', - // time: '5:00 PM EDT', + // // datetime: new Date('2025-05-13T17:00:00-04:00'), // completed: false, // week: 'Play-in', @@ -401,8 +349,7 @@ export const matches: Match[] = [ // division: 'Playoff', // player1Id: 'tbd', // player2Id: 'tbd', - // date: 'May 14, 2025', - // time: '5:00 PM EDT', + // // datetime: new Date('2025-05-14T17:00:00-04:00'), // completed: false, // week: 'Play-in', @@ -412,8 +359,7 @@ export const matches: Match[] = [ // division: 'Playoff', // player1Id: 'tbd', // player2Id: 'tbd', - // date: 'May 15, 2025', - // time: '5:00 PM EDT', + // // datetime: new Date('2025-05-15T17:00:00-04:00'), // completed: false, // week: 'Play-in', @@ -425,8 +371,7 @@ export const matches: Match[] = [ // division: 'Finals', // player1Id: 'tbd', // player2Id: 'tbd', - // date: 'May 17, 2025', - // time: '11:00 AM EDT', + // // datetime: new Date('2025-05-17T11:00:00-04:00'), // completed: false, // week: 'Finals', @@ -436,8 +381,7 @@ export const matches: Match[] = [ // division: 'Finals', // player1Id: 'tbd', // player2Id: 'tbd', - // date: 'May 17, 2025', - // time: '1:00 PM EDT', + // // datetime: new Date('2025-05-17T13:00:00-04:00'), // completed: false, // week: 'Finals', @@ -447,8 +391,7 @@ export const matches: Match[] = [ // division: 'Finals', // player1Id: 'tbd', // player2Id: 'tbd', - // date: 'May 17, 2025', - // time: '3:00 PM EDT', + // // datetime: new Date('2025-05-17T15:00:00-04:00'), // completed: false, // week: 'Finals', diff --git a/src/app/(home)/major-league-balatro/types.ts b/src/app/(home)/major-league-balatro/types.ts index 0077a4d..e4af907 100644 --- a/src/app/(home)/major-league-balatro/types.ts +++ b/src/app/(home)/major-league-balatro/types.ts @@ -16,8 +16,6 @@ export type Match = { division: 'Blue' | 'Red' | 'Playoff' | 'Finals' player1Id: keyof typeof players player2Id: keyof typeof players - date: string - time: string datetime: Date vod1?: string vod2?: string