fix: library actions inside the sidebar (#5638)

This commit is contained in:
Aakansha Doshi 2022-08-29 19:26:03 +05:30 committed by GitHub
parent 59a1d192d2
commit 553b493f37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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