This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
Create OrderSelect and Label components #905
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
aa1c300
Create Label and OrderSelect components
Aljullu e14f574
Update review list item so it uses 'classnames'
Aljullu a457fa1
Split review order select styles from generic component
Aljullu 0751dbf
Update snapshots
Aljullu d398806
Refactor Label so we don't need to check Symbol
Aljullu b7ed466
Add description to Label and OrderSelect components
Aljullu 850dc62
Use prop-types instead of prop-types-elementtype
Aljullu 1fcd28a
Simplify Label propTypes
Aljullu 672a99c
Update package-lock
Aljullu File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,10 @@ import classNames from 'classnames'; | |
import Label from '../label'; | ||
import './style.scss'; | ||
|
||
/** | ||
* Component used for 'Order by' selectors, which renders a label | ||
* and a <select> with the options provided in the props. | ||
*/ | ||
const OrderSelect = ( { className, componentId, defaultValue, label, onChange, options, screenReaderLabel, readOnly, value } ) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is OrderSelect? I think it would be helpful to include some doc block here explaining what the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in b7ed466. |
||
const selectId = `wc-block-order-select__select-${ componentId }`; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Looking into this, it looks like under the hood,
PropTypes.elementType
is using react-is. So this type also validates string elements (like 'div', 'span' etc). So it should be safe to just remove thePropTypes.string
here and only validatePropTypes.elementType
.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.
Good catch! Changed in 1fcd28a.