File size: 906 Bytes
9b906ea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
import BlockDrawerLeftIcon from "#/icons/block-drawer-left.svg?react";
import {
  mobileTopBarIconButtonClassName,
  mobileTopBarIconClassName,
} from "#/utils/mobile-top-bar-icon-button-classes";
import { useSidebarMobileNav } from "./sidebar-mobile-nav-context";

export function SidebarMobileMenuToggle() {
  const { t } = useTranslation("openhands");
  const { isOpen, toggle } = useSidebarMobileNav();

  return (
    <button
      type="button"
      data-testid="sidebar-mobile-menu-toggle"
      onClick={toggle}
      aria-expanded={isOpen}
      aria-label={
        isOpen ? t(I18nKey.SIDEBAR$CLOSE_MENU) : t(I18nKey.SIDEBAR$OPEN_MENU)
      }
      className={mobileTopBarIconButtonClassName}
    >
      <BlockDrawerLeftIcon className={mobileTopBarIconClassName} aria-hidden />
    </button>
  );
}