Browse Source

passing penDetected to ShapesSwitcher

Zsolt Viczian 3 years ago
parent
commit
15d88d0fe0
3 changed files with 4 additions and 1 deletions
  1. 2 1
      src/components/Actions.tsx
  2. 1 0
      src/components/LayerUI.tsx
  3. 1 0
      src/components/MobileMenu.tsx

+ 2 - 1
src/components/Actions.tsx

@@ -186,14 +186,15 @@ export const ShapesSwitcher = ({
   setAppState,
   onImageAction,
   appState,
+  penDetected,
 }: {
   canvas: HTMLCanvasElement | null;
   elementType: AppState["elementType"];
   setAppState: React.Component<any, AppState>["setState"];
   onImageAction: (data: { pointerType: PointerType | null }) => void;
   appState: AppState;
+  penDetected: boolean;
 }) => {
-  const penDetected = useDeviceType().penDetected;
   return (
     <>
       {SHAPES.map(({ value, icon, key }, index) => {

+ 1 - 0
src/components/LayerUI.tsx

@@ -352,6 +352,7 @@ const LayerUI = ({
                               insertOnCanvasDirectly: pointerType !== "mouse",
                             });
                           }}
+                          penDetected={deviceType.penDetected}
                         />
                       </Stack.Row>
                     </Island>

+ 1 - 0
src/components/MobileMenu.tsx

@@ -83,6 +83,7 @@ export const MobileMenu = ({
                           insertOnCanvasDirectly: pointerType !== "mouse",
                         });
                       }}
+                      penDetected={deviceType.penDetected}
                     />
                   </Stack.Row>
                 </Island>