cleanup
This commit is contained in:
parent
c45433c8db
commit
4dec449516
@ -186,7 +186,6 @@ export const ShapesSwitcher = ({
|
|||||||
setAppState,
|
setAppState,
|
||||||
onImageAction,
|
onImageAction,
|
||||||
appState,
|
appState,
|
||||||
penDetected,
|
|
||||||
setDeviceType,
|
setDeviceType,
|
||||||
}: {
|
}: {
|
||||||
canvas: HTMLCanvasElement | null;
|
canvas: HTMLCanvasElement | null;
|
||||||
@ -194,10 +193,9 @@ export const ShapesSwitcher = ({
|
|||||||
setAppState: React.Component<any, AppState>["setState"];
|
setAppState: React.Component<any, AppState>["setState"];
|
||||||
onImageAction: (data: { pointerType: PointerType | null }) => void;
|
onImageAction: (data: { pointerType: PointerType | null }) => void;
|
||||||
appState: AppState;
|
appState: AppState;
|
||||||
penDetected: boolean;
|
|
||||||
setDeviceType: (obj: Partial<DeviceType>) => void;
|
setDeviceType: (obj: Partial<DeviceType>) => void;
|
||||||
}) => {
|
}) => {
|
||||||
const pd = useDeviceType().penDetected;
|
const penDetected = useDeviceType().penDetected;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{SHAPES.map(({ value, icon, key }, index) => {
|
{SHAPES.map(({ value, icon, key }, index) => {
|
||||||
@ -220,7 +218,7 @@ export const ShapesSwitcher = ({
|
|||||||
aria-keyshortcuts={shortcut}
|
aria-keyshortcuts={shortcut}
|
||||||
data-testid={value}
|
data-testid={value}
|
||||||
onChange={({ pointerType }) => {
|
onChange={({ pointerType }) => {
|
||||||
if (!pd && pointerType === "pen") {
|
if (!penDetected && pointerType === "pen") {
|
||||||
setAppState({ penMode: true });
|
setAppState({ penMode: true });
|
||||||
setDeviceType({ penDetected: true });
|
setDeviceType({ penDetected: true });
|
||||||
}
|
}
|
||||||
|
@ -360,7 +360,6 @@ const LayerUI = ({
|
|||||||
insertOnCanvasDirectly: pointerType !== "mouse",
|
insertOnCanvasDirectly: pointerType !== "mouse",
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
penDetected={deviceType.penDetected}
|
|
||||||
setDeviceType={setDeviceType}
|
setDeviceType={setDeviceType}
|
||||||
/>
|
/>
|
||||||
</Stack.Row>
|
</Stack.Row>
|
||||||
|
@ -85,7 +85,6 @@ export const MobileMenu = ({
|
|||||||
insertOnCanvasDirectly: pointerType !== "mouse",
|
insertOnCanvasDirectly: pointerType !== "mouse",
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
penDetected={deviceType.penDetected}
|
|
||||||
setDeviceType={setDeviceType}
|
setDeviceType={setDeviceType}
|
||||||
/>
|
/>
|
||||||
</Stack.Row>
|
</Stack.Row>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user