Procházet zdrojové kódy

fix: library actions inside the sidebar (#5638)

Aakansha Doshi před 2 roky
rodič
revize
553b493f37
1 změnil soubory, kde provedl 47 přidání a 45 odebrání
  1. 47 45
      src/components/LayerUI.tsx

+ 47 - 45
src/components/LayerUI.tsx

@@ -432,56 +432,58 @@ const LayerUI = ({
       )}
       )}
 
 
       {!device.isMobile && (
       {!device.isMobile && (
-        <div
-          className={clsx("layer-ui__wrapper", {
-            "disable-pointerEvents":
-              appState.draggingElement ||
-              appState.resizingElement ||
-              (appState.editingElement &&
-                !isTextElement(appState.editingElement)),
-          })}
-          style={
-            appState.isLibraryOpen &&
-            appState.isLibraryMenuDocked &&
-            device.canDeviceFitSidebar
-              ? { width: `calc(100% - ${LIBRARY_SIDEBAR_WIDTH}px)` }
-              : {}
-          }
-        >
-          {renderFixedSideContainer()}
-          <Footer
-            appState={appState}
-            actionManager={actionManager}
-            renderCustomFooter={renderCustomFooter}
-            showExitZenModeBtn={showExitZenModeBtn}
-          />
-          {appState.showStats && (
-            <Stats
+        <>
+          <div
+            className={clsx("layer-ui__wrapper", {
+              "disable-pointerEvents":
+                appState.draggingElement ||
+                appState.resizingElement ||
+                (appState.editingElement &&
+                  !isTextElement(appState.editingElement)),
+            })}
+            style={
+              appState.isLibraryOpen &&
+              appState.isLibraryMenuDocked &&
+              device.canDeviceFitSidebar
+                ? { width: `calc(100% - ${LIBRARY_SIDEBAR_WIDTH}px)` }
+                : {}
+            }
+          >
+            {renderFixedSideContainer()}
+            <Footer
               appState={appState}
               appState={appState}
-              setAppState={setAppState}
-              elements={elements}
-              onClose={() => {
-                actionManager.executeAction(actionToggleStats);
-              }}
-              renderCustomStats={renderCustomStats}
+              actionManager={actionManager}
+              renderCustomFooter={renderCustomFooter}
+              showExitZenModeBtn={showExitZenModeBtn}
             />
             />
-          )}
-          {appState.scrolledOutside && (
-            <button
-              className="scroll-back-to-content"
-              onClick={() => {
-                setAppState({
-                  ...calculateScrollCenter(elements, appState, canvas),
-                });
-              }}
-            >
-              {t("buttons.scrollBackToContent")}
-            </button>
-          )}
+            {appState.showStats && (
+              <Stats
+                appState={appState}
+                setAppState={setAppState}
+                elements={elements}
+                onClose={() => {
+                  actionManager.executeAction(actionToggleStats);
+                }}
+                renderCustomStats={renderCustomStats}
+              />
+            )}
+            {appState.scrolledOutside && (
+              <button
+                className="scroll-back-to-content"
+                onClick={() => {
+                  setAppState({
+                    ...calculateScrollCenter(elements, appState, canvas),
+                  });
+                }}
+              >
+                {t("buttons.scrollBackToContent")}
+              </button>
+            )}
+          </div>
           {appState.isLibraryOpen && (
           {appState.isLibraryOpen && (
             <div className="layer-ui__sidebar">{libraryMenu}</div>
             <div className="layer-ui__sidebar">{libraryMenu}</div>
           )}
           )}
-        </div>
+        </>
       )}
       )}
     </>
     </>
   );
   );