-
Notifications
You must be signed in to change notification settings - Fork 317
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: adding a flag to ColorPicker for showing color name tooltips #629
feat: adding a flag to ColorPicker for showing color name tooltips #629
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.
very cool! :)
src/components/ColorPicker/components/ColorPickerContent/ColorPickerColorsGrid.jsx
Outdated
Show resolved
Hide resolved
@@ -159,7 +162,8 @@ ColorPickerContentComponent.defaultProps = { | |||
* Used to force the component render the colorList prop as is. Usually, this flag should not be used. It's intended only for edge cases. | |||
* Usually, only "monday colors" will be rendered (unless blacklist mode is used). This flag will override this behavior. | |||
*/ | |||
forceUseRawColorList: false | |||
forceUseRawColorList: false, | |||
showColorNameTooltip: false |
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.
please add description for the new prop.
Also, if it's incompatible with forceUseRawColorList
, please mention it.
(by the way - why is it incompatible? 🤔 )
And lastly, consider explaining what happens if tooltipContentByColor
is supplied while showColorNameTooltip
is truthy (tooltipContentByColor
will take precendence)
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.
@laviomri it's incompatible with forceUseRawColorList cause it relies on the color structure (that it has name)
@@ -21,12 +21,26 @@ export const ColorPickerColorsGrid = React.forwardRef( | |||
SelectedIndicatorIcon, | |||
colorSize, | |||
tooltipContentByColor, | |||
colorShape | |||
colorShape, | |||
showColorNameTooltip: showColorNameTooltip |
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.
showColorNameTooltip: showColorNameTooltip | |
showColorNameTooltip |
@@ -97,7 +99,8 @@ ColorPicker.propTypes = { | |||
numberOfColorsInLine: PropTypes.number, | |||
focusOnMount: PropTypes.bool, | |||
colorShape: PropTypes.oneOf(Object.values(ColorPicker.colorShapes)), | |||
forceUseRawColorList: PropTypes.bool | |||
forceUseRawColorList: PropTypes.bool, | |||
showColorNameTooltip: PropTypes.bool |
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.
let's add also a description here for the storybook docs
Description: adding a flag to ColorPicker for showing color name tooltips
Basic
npm run plop
) to create a new component.PropTypes
.Style
NewComponent.modules.scss
file inside of theNewComponent
folder.Storybook
/src/NewComponent/__stories__/NewComponent.stories.js
file.Tests