terry-wallet-login #15
@@ -53,7 +53,7 @@ export function WalletLoginModal() {
|
|||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { closeLoginModal, completeLogin, loginModalOpen } = useWallet();
|
const { closeLoginModal, completeLogin, loginModalOpen } = useWallet();
|
||||||
const [selected, setSelected] = useState<WalletKind | null>(null);
|
const [selected, setSelected] = useState<WalletKind | null>(null);
|
||||||
const [mobileDevice, setMobileDevice] = useState(false);
|
const [mobileDevice, setMobileDevice] = useState(() => isMobileDevice());
|
||||||
const [state, setState] = useState<LoginState>("idle");
|
const [state, setState] = useState<LoginState>("idle");
|
||||||
const [error, setError] = useState("");
|
const [error, setError] = useState("");
|
||||||
const [pendingLogin, setPendingLogin] = useState<PendingLogin | null>(null);
|
const [pendingLogin, setPendingLogin] = useState<PendingLogin | null>(null);
|
||||||
@@ -74,6 +74,9 @@ export function WalletLoginModal() {
|
|||||||
t(key).replaceAll("{wallet}", walletName(kind));
|
t(key).replaceAll("{wallet}", walletName(kind));
|
||||||
const walletHint = () =>
|
const walletHint = () =>
|
||||||
mobileDevice ? t("walletChooseMobile") : t("walletDesktopHint");
|
mobileDevice ? t("walletChooseMobile") : t("walletDesktopHint");
|
||||||
|
const visibleWallets = mobileDevice
|
||||||
|
? wallets
|
||||||
|
: wallets.filter(supportsDesktopExtension);
|
||||||
const busy = state !== "idle";
|
const busy = state !== "idle";
|
||||||
|
|
||||||
const close = () => {
|
const close = () => {
|
||||||
@@ -179,7 +182,7 @@ export function WalletLoginModal() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-5 grid gap-2">
|
<div className="mt-5 grid gap-2">
|
||||||
{wallets.map((kind) => {
|
{visibleWallets.map((kind) => {
|
||||||
const active = selected === kind;
|
const active = selected === kind;
|
||||||
const connecting = active && state === "connecting";
|
const connecting = active && state === "connecting";
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user