HandButton.tsx 813 B

1234567891011121314151617181920212223242526272829303132
  1. import "./ToolIcon.scss";
  2. import clsx from "clsx";
  3. import { ToolButton } from "./ToolButton";
  4. import { handIcon } from "./icons";
  5. import { KEYS } from "../keys";
  6. type LockIconProps = {
  7. title?: string;
  8. name?: string;
  9. checked: boolean;
  10. onChange?(): void;
  11. isMobile?: boolean;
  12. };
  13. export const HandButton = (props: LockIconProps) => {
  14. return (
  15. <ToolButton
  16. className={clsx("Shape", { fillable: false })}
  17. type="radio"
  18. icon={handIcon}
  19. name="editor-current-shape"
  20. checked={props.checked}
  21. title={`${props.title} — H`}
  22. keyBindingLabel={!props.isMobile ? KEYS.H.toLocaleUpperCase() : undefined}
  23. aria-label={`${props.title} — H`}
  24. aria-keyshortcuts={KEYS.H}
  25. data-testid={`toolbar-hand`}
  26. onChange={() => props.onChange?.()}
  27. />
  28. );
  29. };