Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alex/Add labels for home and away #521

Merged
merged 12 commits into from
Sep 19, 2024
Merged

Conversation

alexappleget
Copy link
Contributor

@alexappleget alexappleget commented Sep 11, 2024

Closes #520

  • Display "Home" and "Away" above the teams when picking so users know.
  • Display an '@' symbol in between the teams.

Notes:

  • The reason I changed things in the 'WeeklyPickButton.stories.tsx" file was to handle build errors. Since I added the "homeAway={competition.homeAway}" to the WeeklyPickButton component to pass it in... I had to also add it inside the stories.tsx file.

image

Copy link

appwrite bot commented Sep 11, 2024

Gridiron Survivor Application 6616ea581ef9f5521c7d

Function ID Status Action
Your function has been successfully deployed.

Project name: Gridiron Survivor Application
Project ID: 6616ea581ef9f5521c7d

Function ID Status Action
userAuth 6626fef885a9f630442b ready Ready View Logs

Only deployments on the production branch are activated automatically. If you'd like to activate this deployment, navigate to your deployments. Learn more about Appwrite Function deployments.

💡 Did you know?
Cursor pagination performs better than offset pagination when loading further pages

Copy link

vercel bot commented Sep 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gridiron-survivor ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 19, 2024 6:06pm
gridiron-survivor-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 19, 2024 6:06pm

@@ -59,25 +59,34 @@ const WeekTeams = ({
>
{schedule.map((scheduledGame) => (
<div
className="grid w-full grid-cols-2 gap-4 pb-8"
className="grid w-full grid-cols-[1fr_auto_1fr] gap-4 pb-8"
style={{ direction: 'rtl' }}
Copy link
Member

@ryandotfurrer ryandotfurrer Sep 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this here? This is typically used to support languages that are written right to left, unlike english which is written left to right.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was shashi's suggestion. he wanted to flip everything in the grid layout so that the away teams were on the left and home teams were on right. because the data always rendered vise versa

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay that's what I thought it was doing. I wonder if CSS the order property would be more applicable here? @shashilo what are your thougths? I'm also worried about the a11y implication here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct. The data receive from ESPN is reversed. We don't alter the source data, we have to work with it.

<>
{index > 0 && (
<div className="h-20 flex self-end items-center">
<span className="mx-2">@</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this probably does not need additional margin

@@ -7,6 +7,7 @@ import { Label } from '../Label/Label';
import { RadioGroupItem } from '../RadioGroup/RadioGroup';

type WeeklyPickButtonProps = {
homeAway: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I feel like this is not a very clear prop name, and, while this is a p1 fix, maybe we should revisit it in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its already being prop drilled from another component as "competition.homeAway" and homeAway is a prop from an interface [] with 20 other props lol. but the actual prop itself is just a string.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So obviously leave here as is. I wonder if this is worth putting as a ticket. @shashilo, thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this.

@@ -15,10 +16,14 @@ describe('WeeklyPickButton', () => {
it('renders correctly', () => {
render(
<RadioGroup>
<WeeklyPickButton team={weeklyPickData.team} src={weeklyPickData.src} />
<WeeklyPickButton homeAway={weeklyPickData.homeAway} team={weeklyPickData.team} src={weeklyPickData.src} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to write 2 separate tests for this. 1 to check that the team is home and 1 that checks the team is away.

@@ -17,6 +17,7 @@ const meta = {
},
},
argTypes: {
homeAway: { description: 'Location of game' },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we adding locations of the games to the data in a separate ticket?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to add this to make the build pass. Not sure on it tho. @shashilo thoughts?

<div style={{ direction: 'ltr' }} className="flex items-center mt-4">
<RadioGroupItem
value={team}
id={team}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the teamName, teamLogo, teamId? A bit ambiguous/unclear variable naming here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didn't write this. it was copy and pasted to add my changes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by copy and pasted, like merge conflicts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i actually copied and pasted it. when i add in wrappers... in this case the <></> wrapper, i copy everything, delete, add the wrapper, then paste everything back inside. I see now I need to be careful with it to avoid confusion. The reason why I added the <></> is because i had to add {homeAway} on top and everything has to be inside the same parent element so i added the empty fragments

Copy link
Member

@ryandotfurrer ryandotfurrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@shashilo shashilo merged commit 3e840ed into develop Sep 19, 2024
5 checks passed
@shashilo shashilo deleted the alex/add-labels-for-home-and-away branch September 19, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FEE: Add labels for Home and Away for team picks
4 participants