Skip to content

Commit

Permalink
Add a tooltip on hover (#1043)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc authored and petrjasek committed Aug 22, 2024
1 parent ab520ce commit 6049399
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions assets/search/components/SearchResultsBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {Dropdown} from './../../../components/Dropdown';

import {SearchResultTagsList} from './SearchResultTagsList';
import {IDateFilter} from 'interfaces/common';
import {ToolTip} from 'ui/components/ToolTip';

interface ISortOption {
label: string;
Expand Down Expand Up @@ -235,19 +236,26 @@ class SearchResultsBarComponent extends React.Component<IProps, IState> {
>
{gettext('Clear All')}
</button>
<button
data-test-id="toggle-search-bar"
onClick={this.toggleTagSection}
className="icon-button icon-button--tertiary icon-button--bordered"
>
<i className={classNames(
'icon--arrow-right',
{
'icon--collapsible-open': isTagSectionShown,
'icon--collapsible-closed': !isTagSectionShown,
<ToolTip key={`${isTagSectionShown}--state`} placement="left">
<button
title={
isTagSectionShown
? gettext('Hide search terms')
: gettext('Show search terms')
}
)} />
</button>
data-test-id="toggle-search-bar"
onClick={this.toggleTagSection}
className="icon-button icon-button--tertiary icon-button--bordered"
>
<i className={classNames(
'icon--arrow-right',
{
'icon--collapsible-open': isTagSectionShown,
'icon--collapsible-closed': !isTagSectionShown,
}
)} />
</button>
</ToolTip>
</div>
</div>
)}
Expand Down

0 comments on commit 6049399

Please sign in to comment.