-
Notifications
You must be signed in to change notification settings - Fork 842
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
Moved useColorPicker to services #3067
Moved useColorPicker to services #3067
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
someone is already working on this issue PR: #2918 |
jenkins test this |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3067/ |
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.
Thanks for this, @mridulgogia
Moving and renaming to useColorPickerState
looks good.
I think we need to add to the API of useColorStop
to have it be worthwhile as a global export:
- Rename to
useColorStopsState
for consistency - Like
useColorPickerState
,useColorStopsState
should accept an array ofColorStops
so consumers can initialize with a given state.
added initialColorStops param
Added initialColorStops as param
…gia/eui into Refactor/useColorPicker
Co-Authored-By: Greg Thompson <thompsongl@users.noreply.github.com>
Co-Authored-By: Greg Thompson <thompsongl@users.noreply.github.com>
jenkins test this |
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.
Just about ready.
The name should be useColorStopsState
, not useColorStopState
(the component is name EuiColorStops
, so consistency is important).
After that and fixing the merge conflict, this will be ready to merge
Preview documentation changes for this PR: https://eui.elastic.co/pr_3067/ |
jenkins test this |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3067/ |
export const useColorStopsState = ( | ||
initialColorStops: colorStopsType[] = [ |
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.
Just noticed this, sorry.
The function signature changed from (useRandomColor: boolean)
to (initialColorStops: colorStopsType[], useRandomColor: boolean)
so any example that was using useColorStopsState(true)
now causes errors.
You'll need to update the files where this service is used to pass the correct params.
jenkins test this |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3067/ |
jenkins test this |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3067/ |
Summary
#2895
Moved useColorPicker from src-docs/src/views/color_picker/utils.js ->src/services
Summarize your PR. If it includes design elements include a screenshot or gif.
Checklist