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

Feature: improved tooltips for components #3326

Merged
merged 1 commit into from
Feb 28, 2018

Conversation

edbrett
Copy link
Contributor

@edbrett edbrett commented Feb 28, 2018

Improves the use of tooltips in buttons and dropdowns. Now both can accept a much simpler tooltip object:
{ text: "my excellent message" }

However if you would like more customisation then you can pass any option from react tippy props as well:
{ text: "my message", delay: 3000 }

This was to reduce the importing of the Tip component throughout the project when its application was always the same.

In addition a tooltip has been added for the Dropdown component to allow the header section of the dashboard to have individual tooltips without extra code.

FINALLY, I also added a state prop which prevent tooltips from being shown in the header when a dropdown is open. This makes the user a lot happier I think.

@edbrett edbrett requested a review from pjosh February 28, 2018 13:44
Copy link
Contributor

@pjosh pjosh left a comment

Choose a reason for hiding this comment

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

very nice! 👍 👍

constructor(props) {
super(props);
this.state = {
disableTooltips: false
Copy link
Contributor

Choose a reason for hiding this comment

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

good move!

position="top"
arrow
disabled={isDeviceTouch}
html={<Tip text={tooltip.text} />}
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, probably we will never use other component instead of <Tip> and if this happens we can overwrite it with {...tooltip}. I love it! good job.

@edbrett edbrett merged commit 15fda98 into develop Feb 28, 2018
@edbrett edbrett deleted the feature/tooltips-improvements branch February 28, 2018 16:31
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.

2 participants