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

Danielle/535 add current entry number in header of entry page #615

Conversation

Danielle254
Copy link
Contributor

Before: no entry number in header of entry page

535 before

After: entry number added to header of entry page

option 2

  • Updated existing h1 to <Heading/> component
  • Retrieved entry name (Entry 1, 2, etc)
  • Rendered entry name as <Heading/> component

Color is up for debate as is spacing.

Copy link

appwrite bot commented Oct 18, 2024

Gridiron Survivor Application 6616ea581ef9f5521c7d

Function ID Status Action
Your function deployment has failed. Please check the logs for more details and retry.

Project name: Gridiron Survivor Application
Project ID: 6616ea581ef9f5521c7d

Function ID Status Action
userAuth 6626fef885a9f630442b failed Failed 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?
Appwrite has a Discord community with over 16 000 members. Come join us!

Copy link

vercel bot commented Oct 18, 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 Oct 24, 2024 1:47pm
gridiron-survivor-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 1:47pm

Copy link
Collaborator

@shashilo shashilo left a comment

Choose a reason for hiding this comment

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

image
Title says Entry Entry 3 when my entry name is Entry 3.

Week {week} pick
</h1>

<Heading
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not test that H1 is on the screen and has the correct value as well?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ryandotfurrer How come all headings do not have pb-8 by default? Heading's usually have margin from the next element.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shashilo complete

<Heading
as='h2'
className='pb-8 text-muted-foreground'
data-testid='entry-name'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's follow BEM naming convention. This should be data-testid='week__entry-name'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shashilo complete

Copy link
Contributor

@kepsteen kepsteen left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@choir241 choir241 closed this Oct 22, 2024
@choir241 choir241 reopened this Oct 22, 2024
as='h2'
className='pb-8 text-muted-foreground'
data-testid='week__entry-name'
>{entryName}
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry if this is a dumb question, but is there a reason we're not just using currentEntry.name here instead of creating state for it? It never changes, 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.

@mhchen currenEntry.name is inside of a function call and thus not available to the greater Week component. That's why I saved that piece of data to state when the function is called. I was not 100% confident in this approach though so please feel free to dissect this!

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh nope, you’re right. Turns out it was a dumb question!

I’m so used to a different data fetching paradigm that I forgot this is necessary sometimes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Mike does bring up a good point here. This is not part of this ticket, but because we're now tracking 2 pieces of data from the response object, we should refactor the state to store the pick history and the entry name. A good ticket to refactor some code into the backlog.

@Danielle254 Danielle254 merged commit 0ac4e38 into develop Oct 25, 2024
5 checks passed
@Danielle254 Danielle254 deleted the danielle/535-add-current-entry-number-in-header-of-entry-page branch October 25, 2024 16:23
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.

5 participants