Skip to content
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

Conversation

shanibenaderetmonday
Copy link
Contributor

@shanibenaderetmonday shanibenaderetmonday commented Apr 6, 2022

Description: adding a flag to ColorPicker for showing color name tooltips

Basic

  • Used plop (npm run plop) to create a new component.
  • PR has description.
  • New component is functional and uses Hooks.
  • Component defines PropTypes.

Style

  • Styles are added to NewComponent.modules.scss file inside of the NewComponent folder.
  • Component uses CSS Modules.
  • Design is compatible with Monday Design System.

Storybook

  • Stories were added to /src/NewComponent/__stories__/NewComponent.stories.js file.
  • Stories include all flows of using the component.

Tests

Copy link
Contributor

@laviomri laviomri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very cool! :)

@@ -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
Copy link
Contributor

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)

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Contributor

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

@hadasfa hadasfa merged commit df6a122 into mondaycom:master Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants