snapshot of https://github.com/excalidraw/excalidraw.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Tests / test (push) Failing after 15s
Some checks failed
Tests / test (push) Failing after 15s
This commit is contained in:
28
packages/excalidraw/components/LockButton.tsx
Normal file
28
packages/excalidraw/components/LockButton.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import clsx from "clsx";
|
||||
|
||||
import { IconButton } from "./IconButton";
|
||||
import { LockedIcon, UnlockedIcon } from "./icons";
|
||||
|
||||
type LockButtonProps = {
|
||||
title?: string;
|
||||
checked: boolean;
|
||||
onChange?(): void;
|
||||
isMobile?: boolean;
|
||||
disabled?: boolean;
|
||||
};
|
||||
|
||||
export const LockButton = (props: LockButtonProps) => {
|
||||
return (
|
||||
<IconButton
|
||||
className={clsx("ToolIcon__lock", { "is-mobile": props.isMobile })}
|
||||
type="toggle"
|
||||
icon={props.checked ? LockedIcon : UnlockedIcon}
|
||||
checked={props.checked}
|
||||
disabled={props.disabled}
|
||||
title={`${props.title} — Q`}
|
||||
aria-label={`${props.title}`}
|
||||
data-testid="toolbar-lock"
|
||||
onSelect={() => props.onChange?.()}
|
||||
/>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user