-
Notifications
You must be signed in to change notification settings - Fork 87
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
fix: Language selector: add prop for display lang for bug fix #2622
Conversation
|
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.
@werdnanoslen Yeah, these stories are misleading. That prop would be used with a saved i18n locale. So instead of passing a static value as in the story, it would use I'll make sure to write unit tests with this in mind, but maybe we consider getting rid of the stories. |
@kleinschmidtj if I'm understanding correctly, it should be possible to give your storybook example a useState (see Pagination.stories.tsx as an example), where the react state can serve as a mock for "saving and pulling the value from somewhere" |
Oh excellent @brandonlenz ! I have never done that and wasn't sure that was something I could do. I will look there. Thank you. |
@brandonlenz @werdnanoslen Created two templates to test this out: http://localhost:9009/?path=/story/components-languageselector--languages-display-prop-sandbox Thanks to you both! |
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.
Approving conceptually but I haven't reviewed the code. Good addition!
@kleinschmidtj Nice! 🚢 |
Summary
langs
array.Related Issues or PRs
closes #2621
How To Test
Use the new prop and confirm it overrides the existing behavior where the label is pulled from the first item in the
langs
array.Screenshots (optional)