From 1fccf4779bbf4d1c125fd65ed3972b57b3c1be6e Mon Sep 17 00:00:00 2001 From: Grégoire Aubert Date: Mon, 6 Nov 2017 14:18:22 +0100 Subject: Rewrite users page to TS and React --- server/sonar-web/src/main/js/components/ui/buttons.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'server/sonar-web/src/main/js/components/ui') diff --git a/server/sonar-web/src/main/js/components/ui/buttons.tsx b/server/sonar-web/src/main/js/components/ui/buttons.tsx index 0e65602d012..e73bdba9ca5 100644 --- a/server/sonar-web/src/main/js/components/ui/buttons.tsx +++ b/server/sonar-web/src/main/js/components/ui/buttons.tsx @@ -21,14 +21,16 @@ import * as React from 'react'; import * as classNames from 'classnames'; import * as theme from '../../app/theme'; import ClearIcon from '../icons-components/ClearIcon'; -import './buttons.css'; import EditIcon from '../icons-components/EditIcon'; +import Tooltip from '../controls/Tooltip'; +import './buttons.css'; interface ButtonIconProps { children: React.ReactNode; className?: string; color?: string; onClick?: () => void; + tooltip?: string; [x: string]: any; } @@ -43,8 +45,8 @@ export class ButtonIcon extends React.PureComponent { }; render() { - const { children, className, color = theme.darkBlue, onClick, ...props } = this.props; - return ( + const { children, className, color = theme.darkBlue, onClick, tooltip, ...props } = this.props; + const buttonComponent = ( ); + if (tooltip) { + return ( + + {buttonComponent} + + ); + } + return buttonComponent; } } -- cgit v1.2.3