From 731da8049b235433680320921d660abd120e6ec2 Mon Sep 17 00:00:00 2001 From: Alex Corey Date: Wed, 10 Apr 2019 08:48:52 -0400 Subject: [PATCH] Adds tooltip to username and help icon. --- src/app.scss | 2 +- src/components/PageHeaderToolbar.jsx | 157 ++++++++++++++++----------- 2 files changed, 92 insertions(+), 67 deletions(-) diff --git a/src/app.scss b/src/app.scss index 35c266786b..a525b7e724 100644 --- a/src/app.scss +++ b/src/app.scss @@ -6,7 +6,6 @@ // // masthead overrides // - .pf-c-page__header-brand { max-width: 255px; } @@ -291,3 +290,4 @@ margin-right: 20px; } } + diff --git a/src/components/PageHeaderToolbar.jsx b/src/components/PageHeaderToolbar.jsx index e7d60981d7..d2e8f04746 100644 --- a/src/components/PageHeaderToolbar.jsx +++ b/src/components/PageHeaderToolbar.jsx @@ -11,6 +11,7 @@ import { Toolbar, ToolbarGroup, ToolbarItem, + Tooltip } from '@patternfly/react-core'; import { QuestionCircleIcon, @@ -22,7 +23,10 @@ const DOCLINK = 'https://docs.ansible.com/ansible-tower/latest/html/userguide/in class PageHeaderToolbar extends Component { constructor (props) { super(props); - this.state = { isHelpOpen: false, isUserOpen: false }; + this.state = { + isHelpOpen: false, + isUserOpen: false, + }; this.onHelpSelect = this.onHelpSelect.bind(this); this.onHelpToggle = this.onHelpToggle.bind(this); @@ -54,77 +58,98 @@ class PageHeaderToolbar extends Component { const { isHelpOpen, isUserOpen } = this.state; const { isAboutDisabled, onAboutClick, onLogoutClick } = this.props; - const dropdownIconColor = { - color: 'white' - }; + // const dropdownIconColor = { + // color: 'white' + // }; return ( {({ i18n }) => ( - - - - - )} - dropdownItems={[ - - {i18n._(t`Help`)} - , - - {i18n._(t`About`)} - - ]} - /> - - - - - - )} - dropdownItems={[ - - {i18n._(t`User Details`)} - , - - {i18n._(t`Logout`)} - - ]} - /> - + Help + } + > + + + + + )} + dropdownItems={[ + + {i18n._(t`Help`)} + , + + {i18n._(t`About`)} + + ]} + /> + + + User + } + > + + + +   User Name + + )} + dropdownItems={[ + + {i18n._(t`User Details`)} + , + + {i18n._(t`Logout`)} + + ]} + /> + + )}