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

(feat) Delay display of menu item tooltips by 500ms #567

Merged
merged 1 commit into from
Nov 10, 2022
Merged
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 @@ -16,6 +16,7 @@ const ImplementerToolsButton: React.FC = () => {
aria-label={t("implementerTools", "Implementer Tools")}
aria-labelledby="Implementer Tools"
className={styles.toolStyles}
enterDelayMs={500}
name="ImplementerToolsIcon"
onClick={togglePopup}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ const Navbar: React.FC<NavbarProps> = ({
[navMenuItems.length, layout]
);

const render = useCallback(() => {
return (
const render = useCallback(
() => (
<>
<OfflineBanner />
<Header className={styles.topNavHeader} aria-label="OpenMRS">
Expand Down Expand Up @@ -112,6 +112,7 @@ const Navbar: React.FC<NavbarProps> = ({
? styles.headerGlobalBarButton
: styles.activePanel
}`}
enterDelayMs={500}
name="Users"
isActive={isActivePanel("userMenu")}
onClick={(event) => {
Expand All @@ -127,14 +128,15 @@ const Navbar: React.FC<NavbarProps> = ({
</HeaderGlobalAction>
<HeaderGlobalAction
aria-label="App Menu"
tooltipAlignment="end"
aria-labelledby="App Menu"
enterDelayMs={500}
isActive={isActivePanel("appMenu")}
tooltipAlignment="end"
className={`${
isActivePanel("appMenu")
? styles.headerGlobalBarButton
: styles.activePanel
}`}
aria-labelledby="App Menu"
onClick={(event) => {
togglePanel("appMenu");
event.stopPropagation();
Expand Down Expand Up @@ -170,18 +172,19 @@ const Navbar: React.FC<NavbarProps> = ({
/>
</Header>
</>
);
}, [
showHamburger,
session,
user,
allowedLocales,
isActivePanel,
layout,
hidePanel,
togglePanel,
onLogout,
]);
),
[
showHamburger,
session,
user,
allowedLocales,
isActivePanel,
layout,
hidePanel,
togglePanel,
onLogout,
]
);

return <div>{session && <HeaderContainer render={render} />}</div>;
};
Expand Down