willianjusten / nba-remix

A simple app to show NBA games and scores/details.
https://nba.willianjusten.com.br
210 stars 31 forks source link

Create a subcomponent from the TeamInfo component #35

Closed helderberto closed 2 years ago

helderberto commented 2 years ago

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 https://github.com/willianjusten/nba-remix/pull/34#r805405377

helderberto commented 2 years ago

I'll create the TeamInfo component.