-
Notifications
You must be signed in to change notification settings - Fork 1
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
MPDX-8351 Add UseLocalizedConstants() hook #1145
Conversation
Preview branch generated at https://MPDX-8351-constants-localized.d3dytjb8adxkk5.amplifyapp.com |
Bundle sizes [mpdx-react]Compared against 86d678b
|
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.
Amazing work! I love how many lines were deleted, how our tests can be a little simpler now, and that you were able to use basically the same function and just return it from the hook now.
src/components/Contacts/ContactDetails/ContactTasksTab/ContactTaskRow/ContactTaskRow.test.tsx
Show resolved
Hide resolved
src/components/Settings/integrations/Google/Modals/EditGoogleAccountModal.test.tsx
Show resolved
Hide resolved
src/components/Task/Modal/Form/Inputs/SuggestedContactStatus/SuggestedContactStatus.tsx
Outdated
Show resolved
Hide resolved
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 looks really good! I think once we refresh the constants when the language changes, this will be good to go.
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.
Code looks great and is exactly what I had in mind! I'd like to spend some time testing it in preview, then I'll approve it.
src/components/Settings/preferences/accordions/LanguageAccordion/LanguageAccordion.tsx
Outdated
Show resolved
Hide resolved
In preview, it's loading the constants query every time you load the page now. I think it's because |
I tested all of the components with non-trivial changes in preview, and everything is looking great with the translated statuses. |
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.
One of the PRs I just merged created a merge conflict, sorry! But this looks great now! I'm seeing the constants query whenever you change the language but otherwise using the cached constants.
Description
https://jira.cru.org/secure/RapidBoard.jspa?rapidView=3&view=detail&selectedIssue=MPDX-8351&sprint=1276#
UseLocalizedConstants
hook and replacegetLocalizedStatus
LoadConstants
mocksgetContactStatusesByPhase
to theuseContactPartnershipStatus
hookChecklist: