willianjusten / nba-remix Goto Github PK
View Code? Open in Web Editor NEWA simple app to show NBA games and scores/details.
Home Page: https://nba.willianjusten.com.br
A simple app to show NBA games and scores/details.
Home Page: https://nba.willianjusten.com.br
I was navigating right now (21:55) and instead of showing games from 25/02 it was showing games for tomorrow but with the date showing correctly. Probably it's something related to timezone, we need to fix this.
In order to release the first version, it would be nice to have SEO, Metatags and Analytics to check how we grow =)
There's one game that this is happening, we just need to debug (see the API response and understand what's happening there).
How to do it:
There's a package with all Logos here =>https://www.npmjs.com/package/react-nba-logos
We just need to create a wrapper that will receive the TeamAcronym (ta) and display the correct logo.
Example:
<Logo team='TOR' /> // this should display Toronto Logo
Let's have this issue to add our inspirations/ideas/anything interesting to use.
When changing between pages it doesn't give any feedback, maybe we can add the nprogress to our project.
This includes:
This includes:
For now, the way that we handle dates is very fragile, we should take care about timezones and conversions to be sure everything runs fine.
The background now is a JPG image but it's not looking cool on bigger screens, I can see some pixels and I don't like it. Maybe we can make everything with CSS, blurring the NBA logo and adding the shadows.
As you can see, those lines and L59-L67 are the same, just changing the team, maybe we can create a subcomponent like:
const TeamInfo = (team) => (
<div className="flex w-1/4 flex-col items-center text-center">
<TeamLogo team={hTeam.triCode} size={48} />
<p className="mt-1 whitespace-nowrap text-sm font-semibold">
{TEAM_NAME[hTeam.triCode as keyof typeof TEAM_NAME]}
</p>
<p className="text-xs text-gray-400">
{`${hTeam.win}-${hTeam.loss}`}
</p>
</div>
)
Originally posted by @willianjusten in #34 (comment)
Remix is great with catching Errors and displaying it correctly, lets improve the code here and make the site safer also.
Here is the doc about it: https://remix.run/docs/en/v1/guides/errors
If you watch this video, will see that if we try to see game details from another day and then go back, we are redirected to the home with the day of today, it would be better to persist the day that we were seeing before.
Those types should be moved after to a types
file so everybody can use it.
Originally posted by @willianjusten in #36 (comment)
Let's do exactly like we did to other pages, first let get the data from standings, the route is:
http://data.nba.net/prod/v1/current/standings_all.json
And you can see the page here:
https://www.nba.com/standings?GroupBy=conf&Season=2021-22&Section=overall
This issue is only to handle the logic of displaying correct periods/time of the game. It doesn't need visual yet.
The GameCard will have this visual:
But it has some variations as well:
The clock should appear in the middle and it should inform which quarter as well, like: Q1 - 10:34
From the API, we have some parts that we can use in order to make this logic, follow a snippet from the API
startTimeUTC: '2022-02-09T00:00:00.000Z',
period: {
current: 4,
type: 0,
maxRegular: 4,
isHalftime: false,
isEndOfPeriod: false
},
For now, all of our API calls are being done directly to each page. I think we could 2 things:
Our project is very simple but it's always good to have better practices as well.
This includes:
It looks weird on Firefox:
That's most likely because of the blur thing, maybe we should apply a fallback background in order to not have this.
Originally posted by @willianjusten in #58 (comment)
When the game is live, we need to update the scores, that's very important. Follow below some ideas of how to do it.
https://sergiodxa.com/articles/automatic-revalidation-in-remix#revalidate-on-interval
It looks weird on Firefox:
That's most likely because of the blur thing, maybe we should apply a fallback background in order to not have this.
Originally posted by @willianjusten in #58 (comment)
This includes:
Configure the following steps:
Show favorite team scores first
If team is in the Western Conference, show standings for Western Conference first
For example, my favorite team is the Dallas Mavericks. I would like to see the Mavericks games first, and the Western Conference standings ahead of the Eastern.
Both routes are almost the same, so it should be easier and better to make it only one reusable thing to both routes.
Today we have this app/components/DayPickerInput/api.ts
that format dates provided to DateSelector
.
This could be moved to app/utils/handleApiDates
and maybe renamed to app/utils/handleDates
.
The GameCard has allways a hover effect, that isn't needed on the game page:
The header menu has a little flick when hover it:
Storybook will help us to see different variations of our components, like the GameCard, that has some different states.
The API has some stuff that is not so meaningful like ta
, tc
and so on, it would be interesting to create a mapper like:
teamName: tn,
teamCity: tc,
teamAcronym: ta
This would help our code to be more readable.
As soon as we get the initial page done on #37 , let's create the visual.
I believe we can have something very similar to the NBA Page, only having the same background that we are using and the table could use our bg-glass
class, what do you guys think?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.