-
Notifications
You must be signed in to change notification settings - Fork 227
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
feat(select): typescript #540
Conversation
This reverts commit d486cef.
Codecov Report
@@ Coverage Diff @@
## feat/two-typescript #540 +/- ##
=======================================================
- Coverage 96.02% 95.97% -0.05%
=======================================================
Files 60 60
Lines 2315 2362 +47
Branches 221 249 +28
=======================================================
+ Hits 2223 2267 +44
- Misses 47 48 +1
- Partials 45 47 +2
Continue to review full report at Codecov.
|
packages/select/index.tsx
Outdated
nativeControlClassName: string; | ||
notchedOutlineClassName: string; | ||
outlined: boolean; | ||
options: (string | React.HTMLProps<HTMLOptionElement>)[]; |
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.
when would options be a string vs an element? Can it be restricted to make its handling easier?
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.
If people just want to do
options = ['poodle', 'golden_retreiver', 'alaskan']
or
options = [{
label: 'Poodle', value: 'poodle'
}, {
label: 'Golden Retriever', value: 'golden_retriever'
}, ...]
Any suggestions? If we changed it, it would be a breaking change
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.
Oh it seems fine, but maybe making a type alias for it?
packages/select/index.tsx
Outdated
const notchedOutlineAdapter = { | ||
notchOutline: () => this.setState({outlineIsNotched: true}), | ||
closeOutline: () => this.setState({outlineIsNotched: false}), | ||
hasOutline: () => !!this.props.outlined, | ||
}; | ||
|
||
return Object.assign({}, | ||
return Object.assign( |
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.
spread?
{disabled: true}, | ||
]; | ||
|
||
const variants = [{}, {box: true}, {outlined: true}]; |
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 is a bit hard to follow.
The first 3 arrays of objects, as is, are not maps themselves. Should they be renamed?
Where is variantKey coming from?
Are any of the values being used (e.g. true or 'pomsky'?)
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.
ya it is a bit hacked together. I wanted to programatically add:
<Select box ... />
<Select outlined ... />
in an array format.
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.
variantKey is either ''
, box
, or outlined
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 updated the screenshot and moved the {value: pomsky} out, which in turn created a different screenshot. But I the maps
make more sense.
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
related: #48