Skip to content

feat(MenuToggle): add plain with text variant#6627

Merged
tlabaj merged 3 commits into
patternfly:mainfrom
nicolethoen:plain_menu_toggle
Dec 6, 2021
Merged

feat(MenuToggle): add plain with text variant#6627
tlabaj merged 3 commits into
patternfly:mainfrom
nicolethoen:plain_menu_toggle

Conversation

@nicolethoen
Copy link
Copy Markdown
Contributor

What: Closes #6561

Added a new Menu Toggle example.

@patternfly-build
Copy link
Copy Markdown
Collaborator

patternfly-build commented Nov 18, 2021

Copy link
Copy Markdown
Contributor

@gabipodolnikova gabipodolnikova left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Member

@mcarrano mcarrano left a comment

Choose a reason for hiding this comment

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

This looks good. @mcoker @mceledonia I think we covered this before, but I assume we are good with the idea that there is no hover effect on these plain variations?

@mceledonia
Copy link
Copy Markdown

What will it look like in terms of dev time if we add a hover state here to the caret? It will be subtle but consistent with our other icon action patterns. It would have the same colors/states, secondary text color (default) -> primary text color (hover) just to give it a small sense of feedback.

I know this isn't what we do on other dropdowns/selects, but it does feel like it needs some kind of state change since other similar components all do.

That being said I am sort of on the fence here, if the juice isn't worth the squeeze I think the component will be fine without a hover state.

image

CC @mcoker @mcarrano

isExpanded && styles.modifiers.expanded,
variant === 'primary' && styles.modifiers.primary,
isPlain && styles.modifiers.plain,
(isPlain || variant === 'plainText') && styles.modifiers.plain,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you move the logic of checking the variant to line 39 where isPlain is set.

@mcoker
Copy link
Copy Markdown
Contributor

mcoker commented Nov 30, 2021

What will it look like in terms of dev time if we add a hover state here to the caret?

@mceledonia pretty easy, we can try and get that in this release if you'd like. I'm assuming it should apply to all plain text toggles? Dropdown, options menu, select, etc?

@nicolethoen
Copy link
Copy Markdown
Contributor Author

@mcoker
If you update the hover styles, that shouldn't require an update on the react side, right?
I opened a core issue and you can prioritize it however @mcarrano and @mceledonia see fit.

@nicolethoen
Copy link
Copy Markdown
Contributor Author

Here is the new issue patternfly/patternfly#4552

@mcarrano
Copy link
Copy Markdown
Member

mcarrano commented Dec 2, 2021

Thanks @nicolethoen . I will add this issue to the next milestone.

const { children, className, icon, badge, isExpanded, isDisabled, variant, innerRef, ...props } = this.props;

const isPlain = variant === 'plain';
const isPlainText = variant === 'plainText';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you could combine these into one then line 58 would not have to change.
const isPlain = variant === 'plain' || variant === 'plainText'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Then i'd have to change the logic on lines 71-72. which I could do. But it's not true that if plaintext then plain. Plaintext also uses the expand/collapse arrow, unlike plain.

Copy link
Copy Markdown
Member

@mcarrano mcarrano left a comment

Choose a reason for hiding this comment

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

This looks good. As stated, we can clean up the hover styles in a future core issue.

@tlabaj tlabaj merged commit 1f4ca5e into patternfly:main Dec 6, 2021
@patternfly-build
Copy link
Copy Markdown
Collaborator

Your changes have been released in:

  • eslint-plugin-patternfly-react@4.17.0
  • @patternfly/react-catalog-view-extension@4.29.0
  • @patternfly/react-charts@6.31.0
  • @patternfly/react-code-editor@4.19.0
  • @patternfly/react-console@4.29.0
  • @patternfly/react-core@4.178.0
  • @patternfly/react-docs@5.39.0
  • @patternfly/react-icons@4.29.0
  • @patternfly/react-inline-edit-extension@4.23.0
  • demo-app-ts@4.138.0
  • @patternfly/react-integration@4.140.0
  • @patternfly/react-log-viewer@4.23.0
  • @patternfly/react-styles@4.28.0
  • @patternfly/react-table@4.47.0
  • @patternfly/react-tokens@4.30.0
  • @patternfly/react-topology@4.25.0
  • @patternfly/react-virtualized-extension@4.25.0
  • transformer-cjs-imports@4.16.0

Thanks for your contribution! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Menu toggle: add plain variant with text

8 participants