-
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.
Merge pull request #31 from danielvanc/dev
Dev
- Loading branch information
Showing
12 changed files
with
3,218 additions
and
3,855 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
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,55 @@ | ||
import { getCDNLogo, type UpcomingGamesType } from "~/utils/games"; | ||
import { format } from "date-fns"; | ||
|
||
export default function UpcomingGames({ data }: { data: UpcomingGamesType[] }) { | ||
return ( | ||
<section> | ||
<h2 className="section-heading">Upcoming Games</h2> | ||
<ul className="bg-gray-100 bg-opacity-10 backdrop-filter backdrop-blur-lg shadow rounded-lg text-white border-faded border-[1px]"> | ||
{data.map((game, index) => ( | ||
<li | ||
key={`upcoming-${game.gameId}-${index}`} | ||
className="border-faded border-b-[1px] relative text-sm" | ||
> | ||
<div className="flex flex-col sm:flex-row items-center p-2 md:p-2"> | ||
<div className="sm:w-2/5 sm:text-right flex flex-row-reverse sm:flex-row items-center justify-end [&>svg]:min-w-[45px] [&>svg]:min-h-[45px]"> | ||
<span className="sm:max-w-32 xl:max-w-none xl:whitespace-nowrap"> | ||
{game.awayTeam.teamCity} {game.awayTeam.teamName} | ||
</span> | ||
<span className="mr-3 sm:ml-3 sm:mr-0 absolute sm:relative left-10 sm:left-auto top-1/2 transform sm:transform-none -translate-y-1/2"> | ||
<img | ||
src={getCDNLogo(game.awayTeam.teamId)} | ||
alt="" | ||
className="w-10 h-10 inline-block mr-2" | ||
/> | ||
</span> | ||
</div> | ||
<div className="mx-3 sm:w-1/5 text-center"> | ||
<div className="w-full text-sm"> | ||
<span className="opacity-30"> | ||
{format(game.gameDateTimeEst, "HH:mm")} | ||
</span> | ||
<span className="block"> | ||
{format(game.gameDateTimeEst, "dd / MM")} (ET) | ||
</span> | ||
</div> | ||
</div> | ||
<div className="sm:w-2/5 text-left flex items-center [&>svg]:min-w-[45px] [&>svg]:min-h-[45px]"> | ||
<span className="absolute sm:relative right-10 sm:right-auto transform -translate-y-1/2 sm:transform-none"> | ||
<img | ||
src={getCDNLogo(game.homeTeam.teamId)} | ||
alt="" | ||
className="w-10 h-10 inline-block mr-2" | ||
/> | ||
</span> | ||
<span className="ml-3 sm:max-w-32 xl:max-w-none xl:whitespace-nowrap"> | ||
{game.homeTeam.teamCity} {game.homeTeam.teamName} | ||
</span> | ||
</div> | ||
</div> | ||
</li> | ||
))} | ||
</ul> | ||
</section> | ||
); | ||
} |
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,7 @@ | ||
export const endpoints = { | ||
latestGames: | ||
"https://cdn.nba.com/static/json/liveData/scoreboard/todaysScoreboard_00.json", | ||
latestStandings: "https://stats.nba.com/stats/leaguestandingsv3", | ||
upcomingGames: | ||
"https://cdn.nba.com/static/json/staticData/scheduleLeagueV2_1.json", | ||
}; |
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,11 +1,11 @@ | ||
import { leagueSchedule } from "./leagueSchedule"; | ||
import { upcomingGames } from "./upcomingGames"; | ||
import { leagueStandings } from "./leagueStandings"; | ||
import { miscHandlers } from "./miscHandlers"; | ||
import { scoresTodayAllTeams } from "./scoresToday"; | ||
|
||
export const handlers = [ | ||
...miscHandlers, | ||
...scoresTodayAllTeams, | ||
...leagueSchedule, | ||
...leagueStandings, | ||
...upcomingGames, | ||
]; |
Oops, something went wrong.