Skip to content

Commit 7c7d47d

Browse files
committed
loader fix
1 parent ae5922f commit 7c7d47d

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ const Body = (props: BodyProps) => {
171171
return (
172172
<BodyContext.Provider value={{ bodyState, setBodyState }}>
173173
<div class="w3a--h-auto w3a--p-6 w3a--flex w3a--flex-col w3a--flex-1 w3a--relative">
174+
{/* Content */}
174175
<Show
175176
when={props.modalState.status !== MODAL_STATUS.INITIALIZED}
176177
fallback={
@@ -228,13 +229,20 @@ const Body = (props: BodyProps) => {
228229
appLogo={props.appLogo}
229230
/>
230231
</Show>
232+
233+
{/* Footer */}
231234
<Footer />
235+
236+
{/* Wallet Details */}
232237
<Show when={bodyState.showWalletDetails}>
233238
<div
234239
class="w3a--absolute w3a--h-full w3a--w-full w3a--top-0 w3a--left-0 w3a--bottom-sheet-bg w3a--rounded-3xl"
235240
onClick={() => setBodyState({ showWalletDetails: false })}
236241
/>
237-
<div class="w3a--absolute w3a--bottom w3a--left-0 w3a--bg-app-light-surface-main dark:w3a--bg-app-dark-surface-main w3a--rounded-3xl w3a--p-4 w3a--bottom-sheet-width w3a--flex w3a--flex-col w3a--gap-y-2 w3a--shadow-sm w3a--border w3a--border-app-gray-100 dark:w3a--border-app-gray-600">
242+
<div
243+
class="w3a--absolute w3a--bottom w3a--left-0 w3a--bg-app-light-surface-main dark:w3a--bg-app-dark-surface-main w3a--rounded-3xl w3a--p-4 w3a--bottom-sheet-width w3a--flex w3a--flex-col
244+
w3a--gap-y-2 w3a--shadow-sm w3a--border w3a--border-app-gray-100 dark:w3a--border-app-gray-600"
245+
>
238246
<div
239247
class="w3a--h-1 w3a--w-16 w3a--bg-app-gray-200 dark:w3a--bg-app-gray-700 w3a--mx-auto w3a--rounded-full w3a--cursor-pointer"
240248
onClick={() => setBodyState({ showWalletDetails: false })}

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ const ConnectWallet = (props: ConnectWalletProps) => {
213213
// if doesn't have wallet connect & doesn't have install links, must be a custom adapter
214214
if (button.hasInjectedWallet || (!button.hasWalletConnect && !button.hasInstallLinks)) {
215215
props.handleExternalWalletClick({ adapter: button.name });
216-
} else if (button.hasWalletConnect) {
216+
} else if (button.hasWalletConnect && props.walletConnectUri) {
217217
setSelectedButton(button);
218218
setSelectedWallet(true);
219219
setCurrentPage(CONNECT_WALLET_PAGES.SELECTED_WALLET);
@@ -254,7 +254,10 @@ const ConnectWallet = (props: ConnectWalletProps) => {
254254
when={selectedWallet()}
255255
fallback={
256256
<div class="w3a--contents">
257-
<Show when={totalExternalWallets() > 15}>
257+
<Show
258+
when={totalExternalWallets() > 15 && !isLoading()}
259+
fallback={<div class="w3a--w-full w3a--h-[46px] w3a--animate-pulse w3a--rounded-full w3a--bg-app-gray-200 dark:w3a--bg-app-gray-700" />}
260+
>
258261
<input
259262
type="text"
260263
value={walletSearch()}
@@ -268,6 +271,7 @@ const ConnectWallet = (props: ConnectWalletProps) => {
268271
placeholder={
269272
isLoading() ? t("modal.external.search-wallet-loading") : t("modal.external.search-wallet", { count: `${totalExternalWallets()}` })
270273
}
274+
disabled={isLoading()}
271275
class="w3a--appearance-none w3a--px-4 w3a--py-2.5 w3a--border w3a--text-app-gray-900 w3a--border-app-gray-300 w3a--bg-app-gray-50 dark:w3a--bg-app-gray-700 dark:w3a--border-app-gray-600 dark:w3a--text-app-white placeholder:w3a--text-app-gray-500 dark:placeholder:w3a--text-app-gray-400 placeholder:w3a--text-sm placeholder:w3a--font-normal w3a--rounded-full w3a--outline-none focus:w3a--outline-none active:w3a--outline-none"
272276
/>
273277
</Show>
@@ -288,7 +292,13 @@ const ConnectWallet = (props: ConnectWalletProps) => {
288292
<Show
289293
when={!isLoading()}
290294
fallback={
291-
<div class="w3a--text-app-white w3a--flex-1 w3a--h-full w3a--w-full w3a--animate-pulse w3a--rounded-lg w3a--bg-app-gray-200 dark:w3a--bg-app-gray-700" />
295+
<div class="w3a--flex w3a--flex-col w3a--gap-y-2 w3a--pr-1.5">
296+
<For each={Array(6).fill(0)}>
297+
{(_) => (
298+
<div class="w3a--w-full w3a--h-[54px] w3a--animate-pulse w3a--rounded-lg w3a--bg-app-gray-200 dark:w3a--bg-app-gray-700" />
299+
)}
300+
</For>
301+
</div>
292302
}
293303
>
294304
<div class="w3a--flex w3a--flex-col w3a--gap-y-2 w3a--pr-1.5">
@@ -327,16 +337,16 @@ const ConnectWallet = (props: ConnectWalletProps) => {
327337
</div>
328338
}
329339
>
330-
<div class="w3a--relative w3a--bg-app-gray-200 w3a--rounded-lg w3a--h-[300px] w3a--w-[300px] w3a--mx-auto w3a--flex w3a--items-center w3a--justify-center">
340+
<div class="w3a--relative w3a--bg-app-gray-100 dark:w3a--bg-app-white w3a--rounded-lg w3a--h-[300px] w3a--w-[300px] w3a--mx-auto w3a--flex w3a--items-center w3a--justify-center">
331341
<QRCodeCanvas
332342
value={props.walletConnectUri || ""}
333343
level="low"
334344
backgroundColor="transparent"
335345
backgroundAlpha={0}
336346
foregroundColor="#000000"
337347
foregroundAlpha={1}
338-
width={280}
339-
height={280}
348+
width={300}
349+
height={300}
340350
x={0}
341351
y={0}
342352
maskType={MaskType.FLOWER_IN_SQAURE}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface ModalProps {
1515

1616
const Modal: Component<ModalProps> = (props: ModalProps) => {
1717
const mergedProps = mergeProps(
18-
{ open: false, padding: true, placement: "center", shadow: true, border: true, showCloseIcon: false },
18+
{ open: false, padding: true, placement: "center", shadow: true, border: false, showCloseIcon: false },
1919
props as ModalProps
2020
);
2121

0 commit comments

Comments
 (0)