-
Notifications
You must be signed in to change notification settings - Fork 5
[FSSS-164] Extract UISelect from Sort to its own component #299
Conversation
✔️ Deploy Preview for basestore ready! 🔨 Explore the source changes: 7805b39 🔍 Inspect the deploy log: https://app.netlify.com/sites/basestore/deploys/61f9f3ca44d9cc00082c7abf 😎 Browse the preview: https://deploy-preview-299--basestore.netlify.app |
Preview is readyThis pull request generated a Preview👀 Preview: https://preview-299--base.preview.vtex.app |
Gatsby Cloud Build Reportbasestore 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 4m PerformanceLighthouse report
|
Gatsby Cloud Build Reportbasestore 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 5m PerformanceLighthouse report
|
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.
The extraction is looking good! I left some questions for us to think about.
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.
Nice improvement! 😍
b516976
to
9f6df2d
Compare
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.
Great job!
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.
Well done!
👏
Co-authored-by: Fanny Chien <fannychienn@gmail.com>
Co-authored-by: Fanny Chien <fannychienn@gmail.com>
40a8fd4
to
590cac3
Compare
* Extract UISelect from Sort to its own component * Rename data-ui-select to data-select * Change attribute className to classes * Remove whitespace * Remove aria-label property from Sort * Make 'id' a required attribute for Select * Change 'SelectOptions' type to Record * Use className attribute instead of classes Co-authored-by: Fanny Chien <fannychienn@gmail.com>
* Extract UISelect from Sort to its own component * Rename data-ui-select to data-select * Change attribute className to classes * Remove whitespace * Remove aria-label property from Sort * Make 'id' a required attribute for Select * Change 'SelectOptions' type to Record * Use className attribute instead of classes Co-authored-by: Fanny Chien <fannychienn@gmail.com>
What's the purpose of this pull request?
This PR extracts the UISelect component that was being used by the Sort component internally to its own component.
How it works?
This essentially:
sort.scss
stylesheet completelyselect.scss
stylesheetSelect
component that wraps theUISelect
from faststoreid
attribute to link thelabel
component with theUISelect
className
attribute, it will forward that attribute to theclassName
prop in the outer div. Optional.labelText
attribute, it will render a label together with the select. Optional.aria-label
attribute to theUISelect
aria-label
. This attribute is required.options
attribute which is aRecord<string, string>
so it can build the available options that will be displayed when the user clicks the Select component. This attribute is required.How to test it?
yarn test
Verify that all the tests still pass, so the original behaviour is kept.
Also open the local instance and verify that no styles are broken, meaning the change did not affect the styles as well.
References
Thanks to @renatamottam