-
Notifications
You must be signed in to change notification settings - Fork 10
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
5430 other petitioners ui #5570
Conversation
sutt0n
commented
Jun 22, 2020
•
edited
Loading
edited
…f-cms into 5430-other-petitioners-ui
…-other-petitioners-ui
expect(result.showOtherPetitioners).toEqual(false); | ||
}); | ||
|
||
it('paginates if showingAdditionalPetitioners is false', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about if showingAdditionalPetitioners
is false, but there aren't enough otherPetitioners
to paginate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no logic to check the length to paginate or not. It's a "show 4 or show all" kinda thing
> | ||
<address aria-labelledby="secondary-label"> | ||
{otherPetitioner.name && | ||
OtherPetitionerDisplay(otherPetitioner, constants)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this passing through of constants in props a bit strange. Could you just import them from state directly in the component where you need them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was copied and pasted after I consolidated the AddressDisplay
components that was defined in two differently spots, but yeah, I'll do that. 😄
toggleShowAdditionalPetitionersSequence(); | ||
}} | ||
> | ||
<FontAwesomeIcon icon={['far', 'address-card']} size="sm" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can include this icon on the Button rather than directly importing the FontAwesomeIcon here.
const showingAdditionalPetitioners = | ||
get(state.showingAdditionalPetitioners) || false; | ||
|
||
store.set(state.showingAdditionalPetitioners, !showingAdditionalPetitioners); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's a store.toggle
method for just this purpose -- assuming the tests pass, means fewer lines of code, better coverage by tiny percentages. :D
<p> | ||
<span className="address-line">{contact.address1}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: For both this and the OtherPetitionerDisplay
, this could be a good opportunity to create a common component for AddressDisplay
. Perhaps then this component could be named ContactDisplay
? Devex, if you like.