Skip to content

Commit f0d9c4a

Browse files
committed
Loader fix for wallets
1 parent 3752a34 commit f0d9c4a

File tree

1 file changed

+47
-34
lines changed
  • packages/modal-ui/src/components/Body

1 file changed

+47
-34
lines changed

packages/modal-ui/src/components/Body/Body.tsx

Lines changed: 47 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -169,46 +169,60 @@ const Body = (props: BodyProps) => {
169169
<BodyContext.Provider value={{ bodyState, setBodyState }}>
170170
<div class="w3a--h-[760px] w3a--p-6 w3a--flex w3a--flex-col w3a--flex-1 w3a--relative">
171171
<Show
172-
when={props.modalState.currentPage === PAGES.LOGIN && props.showExternalWalletPage && props.modalState.status === MODAL_STATUS.INITIALIZED}
172+
when={props.modalState.status !== MODAL_STATUS.INITIALIZED}
173173
fallback={
174-
<Show when={props.modalState.currentPage === PAGES.LOGIN}>
175-
<Loader
176-
adapter={props.modalState.detailedLoaderAdapter}
177-
adapterName={props.modalState.detailedLoaderAdapter}
178-
modalStatus={props.modalState.status}
179-
onClose={props.onCloseLoader}
180-
appLogo={props.appLogo}
181-
/>
182-
</Show>
174+
<>
175+
<Show
176+
when={
177+
props.modalState.currentPage === PAGES.LOGIN && props.showExternalWalletPage && props.modalState.status === MODAL_STATUS.INITIALIZED
178+
}
179+
>
180+
<Login
181+
{...props}
182+
showPasswordLessInput={props.showPasswordLessInput}
183+
showExternalWalletButton={props.showExternalWalletButton}
184+
handleSocialLoginClick={props.handleSocialLoginClick}
185+
socialLoginsConfig={props.socialLoginsConfig}
186+
areSocialLoginsVisible={props.areSocialLoginsVisible}
187+
isEmailPrimary={props.isEmailPrimary}
188+
isExternalPrimary={props.isExternalPrimary}
189+
handleExternalWalletBtnClick={handleExternalWalletBtnClick}
190+
isEmailPasswordLessLoginVisible={props.isEmailPasswordLessLoginVisible}
191+
isSmsPasswordLessLoginVisible={props.isSmsPasswordLessLoginVisible}
192+
/>
193+
</Show>
194+
<Show
195+
when={
196+
props.modalState.currentPage === PAGES.CONNECT_WALLET &&
197+
!props.showExternalWalletPage &&
198+
props.modalState.status === MODAL_STATUS.INITIALIZED
199+
}
200+
>
201+
<ConnectWallet
202+
onBackClick={handleBackClick}
203+
modalStatus={props.modalState.status}
204+
showBackButton={props.areSocialLoginsVisible || props.showPasswordLessInput}
205+
handleExternalWalletClick={props.preHandleExternalWalletClick}
206+
chainNamespace={props.chainNamespace}
207+
walletConnectUri={props.modalState.walletConnectUri}
208+
config={props.modalState.externalWalletsConfig}
209+
walletRegistry={props.walletRegistry}
210+
/>
211+
</Show>
212+
</>
183213
}
184214
>
185-
<Login
186-
{...props}
187-
showPasswordLessInput={props.showPasswordLessInput}
188-
showExternalWalletButton={props.showExternalWalletButton}
189-
handleSocialLoginClick={props.handleSocialLoginClick}
190-
socialLoginsConfig={props.socialLoginsConfig}
191-
areSocialLoginsVisible={props.areSocialLoginsVisible}
192-
isEmailPrimary={props.isEmailPrimary}
193-
isExternalPrimary={props.isExternalPrimary}
194-
handleExternalWalletBtnClick={handleExternalWalletBtnClick}
195-
isEmailPasswordLessLoginVisible={props.isEmailPasswordLessLoginVisible}
196-
isSmsPasswordLessLoginVisible={props.isSmsPasswordLessLoginVisible}
197-
/>
198-
</Show>
199-
<Show when={props.modalState.currentPage === PAGES.CONNECT_WALLET && !props.showExternalWalletPage}>
200-
<ConnectWallet
201-
onBackClick={handleBackClick}
215+
<Loader
216+
adapter={props.modalState.detailedLoaderAdapter}
217+
adapterName={props.modalState.detailedLoaderAdapter}
202218
modalStatus={props.modalState.status}
203-
showBackButton={props.areSocialLoginsVisible || props.showPasswordLessInput}
204-
handleExternalWalletClick={props.preHandleExternalWalletClick}
205-
chainNamespace={props.chainNamespace}
206-
walletConnectUri={props.modalState.walletConnectUri}
207-
config={props.modalState.externalWalletsConfig}
208-
walletRegistry={props.walletRegistry}
219+
onClose={props.onCloseLoader}
220+
appLogo={props.appLogo}
209221
/>
210222
</Show>
223+
211224
<Footer />
225+
212226
<Show when={bodyState.showWalletDetails}>
213227
<div
214228
class="w3a--absolute w3a--h-full w3a--w-full w3a--top-0 w3a--left-0 w3a--bottom-sheet-bg w3a--rounded-3xl"
@@ -226,7 +240,6 @@ const Body = (props: BodyProps) => {
226240
extension={bodyState.walletDetails.imgExtension}
227241
/>
228242
</div>
229-
230243
<ul class="w3a--flex w3a--flex-col w3a--gap-y-2">
231244
{deviceDetails().platform === "desktop" ? desktopInstallLinks() : mobileInstallLinks()}
232245
</ul>

0 commit comments

Comments
 (0)