refactor: reuse common ui dialogs and message for mobile and LayerUI (#5611)

* refactor: Move common UI dialogs to component

* refactor

* fix
This commit is contained in:
Aakansha Doshi 2022-08-26 11:46:34 +05:30 committed by GitHub
parent 43b13d8e3a
commit 2b4462c941
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -381,7 +381,7 @@ const LayerUI = ({
);
};
const dialogs = (
return (
<>
{appState.isLoading && <LoadingMessage delay={250} />}
{appState.errorMessage && (
@ -409,12 +409,7 @@ const LayerUI = ({
}
/>
)}
</>
);
return device.isMobile ? (
<>
{dialogs}
{device.isMobile && (
<MobileMenu
appState={appState}
elements={elements}
@ -434,9 +429,9 @@ const LayerUI = ({
renderTopRightUI={renderTopRightUI}
renderCustomStats={renderCustomStats}
/>
</>
) : (
<>
)}
{!device.isMobile && (
<div
className={clsx("layer-ui__wrapper", {
"disable-pointerEvents":
@ -453,7 +448,6 @@ const LayerUI = ({
: {}
}
>
{dialogs}
{renderFixedSideContainer()}
<Footer
appState={appState}
@ -485,6 +479,7 @@ const LayerUI = ({
</button>
)}
</div>
)}
{appState.isLibraryOpen && (
<div className="layer-ui__sidebar">{libraryMenu}</div>
)}