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