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) O3-4081: Help button has no icon when hovering over it #1182

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default function HelpMenu() {
className={classNames(styles.helpMenuButton)}
>
<Help size={24} />
{!helpMenuOpen && <span className={styles.helpLabel}>Help</span>} {/* Label is hidden when menu is open */}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @virajwathsalag , sorry this took so long to get a review. I don't know why whoever wrote this initially chose to implement it as a <button> wrapping an icon component; this seems like a natural fit for the IconButton component, which handles the label tooltip. Could you please rework this code to use the IconButton?

</button>
{helpMenuOpen && (
<div id="help-menu-popup" ref={popupRef} className={styles.helpMenuPopup}>
Expand Down
19 changes: 19 additions & 0 deletions packages/apps/esm-help-menu-app/src/help-menu/help.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,23 @@
background-color: colors.$gray-20;
cursor: pointer;
}

&:hover .helpLabel {
display: block;
}
}

.helpLabel {
display: none;
position: absolute;
right: calc(100% + 8px);
top: 50%;
transform: translateY(-50%);
font-size: 0.875rem;
background-color: colors.$gray-100;
color: white;
padding: layout.$spacing-01 layout.$spacing-02;
border-radius: layout.$spacing-01;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
white-space: nowrap;
}
Loading