mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
cleanup
This commit is contained in:
parent
c45433c8db
commit
4dec449516
3 changed files with 2 additions and 6 deletions
|
@ -186,7 +186,6 @@ export const ShapesSwitcher = ({
|
|||
setAppState,
|
||||
onImageAction,
|
||||
appState,
|
||||
penDetected,
|
||||
setDeviceType,
|
||||
}: {
|
||||
canvas: HTMLCanvasElement | null;
|
||||
|
@ -194,10 +193,9 @@ export const ShapesSwitcher = ({
|
|||
setAppState: React.Component<any, AppState>["setState"];
|
||||
onImageAction: (data: { pointerType: PointerType | null }) => void;
|
||||
appState: AppState;
|
||||
penDetected: boolean;
|
||||
setDeviceType: (obj: Partial<DeviceType>) => void;
|
||||
}) => {
|
||||
const pd = useDeviceType().penDetected;
|
||||
const penDetected = useDeviceType().penDetected;
|
||||
return (
|
||||
<>
|
||||
{SHAPES.map(({ value, icon, key }, index) => {
|
||||
|
@ -220,7 +218,7 @@ export const ShapesSwitcher = ({
|
|||
aria-keyshortcuts={shortcut}
|
||||
data-testid={value}
|
||||
onChange={({ pointerType }) => {
|
||||
if (!pd && pointerType === "pen") {
|
||||
if (!penDetected && pointerType === "pen") {
|
||||
setAppState({ penMode: true });
|
||||
setDeviceType({ penDetected: true });
|
||||
}
|
||||
|
|
|
@ -360,7 +360,6 @@ const LayerUI = ({
|
|||
insertOnCanvasDirectly: pointerType !== "mouse",
|
||||
});
|
||||
}}
|
||||
penDetected={deviceType.penDetected}
|
||||
setDeviceType={setDeviceType}
|
||||
/>
|
||||
</Stack.Row>
|
||||
|
|
|
@ -85,7 +85,6 @@ export const MobileMenu = ({
|
|||
insertOnCanvasDirectly: pointerType !== "mouse",
|
||||
});
|
||||
}}
|
||||
penDetected={deviceType.penDetected}
|
||||
setDeviceType={setDeviceType}
|
||||
/>
|
||||
</Stack.Row>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue