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

Fix prop error and missing classes in Navigation component #24878

Merged
merged 2 commits into from
Aug 30, 2020

Conversation

joshuatf
Copy link
Contributor

@joshuatf joshuatf commented Aug 27, 2020

Description

Doesn't trigger the onClick prop if not passed in favor of just using the href prop and doesn't trigger href if children exist.

Also adds some missing classes for easier styling by the consumer.

Testing

  1. Run npm run storybook:dev
  2. Go to Components->Navigation.
  3. Check that all links work as expected (especially the "External link").
  4. Check that no console errors occur.

@joshuatf joshuatf changed the title Fix missing onClick prop error in Navigation component Fix prop error and missing classes in Navigation component Aug 28, 2020
@psealock psealock added the [Feature] Navigation Component A navigational waterfall component for hierarchy of items. label Aug 30, 2020
Copy link
Contributor

@psealock psealock left a comment

Choose a reason for hiding this comment

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

This is all looking good and working well.

<Text variant="body.small">
<span>{ title }</span>
<Text
className="components-navigation__menu-item-title"
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL you could do this. Me and several others have created parent spans just to add a class.

@psealock psealock merged this pull request into WordPress:feature/navigation Aug 30, 2020
psealock pushed a commit that referenced this pull request Aug 31, 2020
* Don't trigger onClick prop when not provided

* Add class names for external styling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Navigation Component A navigational waterfall component for hierarchy of items.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants