Skip to content

Commit 875ac8f

Browse files
authored
Merge pull request #64 from cosmology-tech/develop
debug tailwind
2 parents 22a1f73 + e5e4c3f commit 875ac8f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

examples/tailwindcss/components/react/modal.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable @next/next/no-img-element */
2-
import type { WalletModalProps } from '@cosmos-kit/core';
2+
import type { ChainWalletBase, WalletModalProps } from '@cosmos-kit/core';
33
import { WalletStatus } from '@cosmos-kit/core';
44
import { useCallback, Fragment, useState, useMemo, useEffect } from 'react';
55
import { Dialog, Transition } from '@headlessui/react';
@@ -34,6 +34,7 @@ export const TailwindModal = ({
3434
const [currentView, setCurrentView] = useState<ModalView>(
3535
ModalView.WalletList
3636
);
37+
const [qrWallet, setQRWallet] = useState<ChainWalletBase | undefined>();
3738

3839
const current = walletRepo?.current;
3940
const currentWalletData = current?.walletInfo;
@@ -71,8 +72,11 @@ export const TailwindModal = ({
7172

7273
// 1ms timeout prevents _render from determining the view to show first
7374
setTimeout(() => {
74-
if (walletRepo?.getWallet(name)?.walletInfo.mode === 'wallet-connect')
75+
const wallet = walletRepo?.getWallet(name);
76+
if (wallet?.walletInfo.mode === 'wallet-connect') {
7577
setCurrentView(ModalView.QRCode);
78+
setQRWallet(wallet);
79+
}
7680
}, 1);
7781
},
7882
[walletRepo]
@@ -131,7 +135,8 @@ export const TailwindModal = ({
131135
<QRCode
132136
onClose={onCloseModal}
133137
onReturn={() => setCurrentView(ModalView.WalletList)}
134-
qrUri={current?.qrUrl}
138+
qrUri={qrWallet?.qrUrl}
139+
name={qrWallet?.walletInfo.prettyName}
135140
/>
136141
);
137142
case ModalView.Error:

examples/tailwindcss/components/react/views/QRCode.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ export const QRCode = ({
99
onClose,
1010
onReturn,
1111
qrUri,
12+
name,
1213
}: {
1314
onClose: () => void;
1415
onReturn: () => void;
1516
qrUri?: string;
17+
name?: string;
1618
}) => {
1719
return (
1820
<div className="mt-3 text-center sm:mt-1.5 sm:text-left">
@@ -29,7 +31,7 @@ export const QRCode = ({
2931
as="h3"
3032
className="font-medium leading-6 text-center text-gray-900 dark:text-white"
3133
>
32-
Keplr Mobile
34+
{name}
3335
</Dialog.Title>
3436
<button
3537
type="button"

0 commit comments

Comments
 (0)