Skip to content

Commit fd53f35

Browse files
Merge branch 'master' into feat/connect-sign
2 parents d3cd9a8 + 713cf03 commit fd53f35

File tree

17 files changed

+1373
-2164
lines changed

17 files changed

+1373
-2164
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"version": "10.9.0-alpha.0",
2+
"version": "10.9.1",
33
"npmClient": "npm"
44
}

package-lock.json

Lines changed: 1261 additions & 2092 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
"eslint": "^9.39.1",
2020
"eslint-import-resolver-typescript": "^4.4.4",
2121
"husky": "^9.1.7",
22-
"lerna": "^9.0.0",
23-
"lint-staged": "^16.2.6",
22+
"lerna": "^9.0.3",
23+
"lint-staged": "^16.2.7",
2424
"mocha": "^11.7.5",
25-
"prettier": "^3.6.2",
26-
"rimraf": "^6.1.0",
25+
"prettier": "^3.7.3",
26+
"rimraf": "^6.1.2",
2727
"ts-node": "^10.9.2",
2828
"ts-patch": "^3.3.0",
2929
"tsconfig-paths": "^4.2.0",
@@ -53,8 +53,8 @@
5353
},
5454
"name": "web3auth",
5555
"optionalDependencies": {
56-
"@nx/nx-linux-x64-gnu": "^22.0.2",
57-
"@rollup/rollup-linux-x64-gnu": "^4.52.5"
56+
"@nx/nx-linux-x64-gnu": "^22.1.3",
57+
"@rollup/rollup-linux-x64-gnu": "^4.53.3"
5858
},
5959
"private": true,
6060
"repository": {

packages/modal/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3auth/modal",
3-
"version": "10.9.0-alpha.0",
3+
"version": "10.9.1",
44
"description": "Multi chain wallet aggregator for web3Auth",
55
"keywords": [
66
"web3Auth/ui",
@@ -65,11 +65,11 @@
6565
"@toruslabs/eslint-config-vue": "^4.1.5",
6666
"@toruslabs/isomorphic-style-loader": "^5.4.0",
6767
"@toruslabs/vue-components": "^8.1.2",
68-
"@types/react": "^19.2.2",
69-
"@types/react-dom": "^19.2.2",
68+
"@types/react": "^19.2.7",
69+
"@types/react-dom": "^19.2.3",
7070
"@wagmi/core": "^2.20.1",
7171
"@wagmi/vue": "^0.2.2",
72-
"autoprefixer": "^10.4.21",
72+
"autoprefixer": "^10.4.22",
7373
"css-loader": "^7.1.2",
7474
"live-server": "^1.2.2",
7575
"postcss": "^8.5.6",
@@ -82,26 +82,26 @@
8282
"style-loader": "^4.0.0",
8383
"tailwindcss": "^3.4.17",
8484
"url-loader": "^4.1.1",
85-
"viem": "^2.35.1",
86-
"vue": "^3.5.24",
85+
"viem": "^2.40.3",
86+
"vue": "^3.5.25",
8787
"wagmi": "^2.16.6"
8888
},
8989
"dependencies": {
90-
"@hcaptcha/react-hcaptcha": "^1.14.0",
91-
"@toruslabs/base-controllers": "^8.9.0",
90+
"@hcaptcha/react-hcaptcha": "^1.16.0",
91+
"@toruslabs/base-controllers": "^8.10.0",
9292
"@toruslabs/http-helpers": "^8.1.1",
93-
"@web3auth/auth": "^10.7.0",
94-
"@web3auth/no-modal": "^10.9.0-alpha.0",
95-
"bowser": "^2.12.1",
93+
"@web3auth/auth": "^10.8.0",
94+
"@web3auth/no-modal": "^10.9.0",
95+
"bowser": "^2.13.1",
9696
"classnames": "^2.5.1",
9797
"clsx": "^2.1.1",
98-
"color": "^5.0.2",
98+
"color": "^5.0.3",
9999
"copy-to-clipboard": "^3.3.3",
100100
"deepmerge": "^4.3.1",
101-
"i18next": "^25.6.1",
101+
"i18next": "^25.7.1",
102102
"react-i18next": "^15.7.2",
103103
"react-qrcode-logo": "^3.0.0",
104-
"tailwind-merge": "^3.3.1"
104+
"tailwind-merge": "^3.4.0"
105105
},
106106
"exports": {
107107
".": {

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

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ANALYTICS_EVENTS, type ChainNamespaceType, log, type WALLET_CONNECTOR_TYPE, WALLET_CONNECTORS } from "@web3auth/no-modal";
2-
import { FormEvent, useContext, useMemo, useState } from "react";
2+
import { FormEvent, useContext, useEffect, useMemo, useState } from "react";
33

44
import { CONNECT_WALLET_PAGES } from "../../constants";
55
import { AnalyticsContext } from "../../context/AnalyticsContext";
@@ -19,7 +19,7 @@ function ConnectWallet(props: ConnectWalletProps) {
1919
walletConnectUri,
2020
metamaskConnectUri,
2121
walletRegistry,
22-
allExternalButtons,
22+
allRegistryButtons,
2323
customConnectorButtons,
2424
connectorVisibilityMap,
2525
deviceDetails,
@@ -62,21 +62,21 @@ function ConnectWallet(props: ConnectWalletProps) {
6262

6363
const allUniqueButtons = useMemo(() => {
6464
const uniqueButtonSet = new Set();
65-
return customConnectorButtons.concat(allExternalButtons).filter((button) => {
65+
return customConnectorButtons.concat(allRegistryButtons).filter((button) => {
6666
if (uniqueButtonSet.has(button.name)) return false;
6767
uniqueButtonSet.add(button.name);
6868
return true;
6969
});
70-
}, [allExternalButtons, customConnectorButtons]);
70+
}, [allRegistryButtons, customConnectorButtons]);
7171

7272
const defaultButtonKeys = useMemo(() => new Set(Object.keys(walletRegistry.default)), [walletRegistry]);
7373

7474
const defaultButtons = useMemo(() => {
7575
// display order: default injected buttons > custom adapter buttons > default non-injected buttons
7676
const buttons = [
77-
...allExternalButtons.filter((button) => button.hasInjectedWallet && defaultButtonKeys.has(button.name)),
77+
...allRegistryButtons.filter((button) => button.hasInjectedWallet && defaultButtonKeys.has(button.name)),
7878
...customConnectorButtons,
79-
...allExternalButtons.filter((button) => !button.hasInjectedWallet && defaultButtonKeys.has(button.name)),
79+
...allRegistryButtons.filter((button) => !button.hasInjectedWallet && defaultButtonKeys.has(button.name)),
8080
].sort((a, b) => {
8181
// favor MetaMask over other wallets
8282
if (a.name === WALLET_CONNECTORS.METAMASK && b.name === WALLET_CONNECTORS.METAMASK) {
@@ -101,7 +101,7 @@ function ConnectWallet(props: ConnectWalletProps) {
101101
return true;
102102
})
103103
.filter((button) => selectedChain === "all" || button.chainNamespaces?.includes(selectedChain as ChainNamespaceType));
104-
}, [allExternalButtons, customConnectorButtons, defaultButtonKeys, selectedChain]);
104+
}, [allRegistryButtons, customConnectorButtons, defaultButtonKeys, selectedChain]);
105105

106106
const installedWalletButtons = useMemo(() => {
107107
const visibilityMap = connectorVisibilityMap;
@@ -126,7 +126,6 @@ function ConnectWallet(props: ConnectWalletProps) {
126126

127127
const handleChainFilterChange = (chain: string) => {
128128
setSelectedChain(chain);
129-
setIsShowAllWallets(false);
130129
};
131130

132131
const filteredButtons = useMemo(() => {
@@ -153,6 +152,16 @@ function ConnectWallet(props: ConnectWalletProps) {
153152
return walletDiscoverySupported ? defaultButtons.length : installedWalletButtons.length;
154153
}, [walletDiscoverySupported, defaultButtons, installedWalletButtons, isShowAllWallets, totalExternalWalletsCount]);
155154

155+
// Automatically show all wallets if there are less than or equal to 15 wallets
156+
// also resets everytime we search causing no. of wallets to change or select different chain
157+
useEffect(() => {
158+
if (walletDiscoverySupported && totalExternalWalletsCount <= 15) {
159+
setIsShowAllWallets(true);
160+
} else {
161+
setIsShowAllWallets(false);
162+
}
163+
}, [walletDiscoverySupported, selectedChain, totalExternalWalletsCount]);
164+
156165
/**
157166
* Wallet click logic
158167
* - For installed wallets
@@ -289,6 +298,7 @@ function ConnectWallet(props: ConnectWalletProps) {
289298
deviceDetails={deviceDetails}
290299
walletConnectUri={walletConnectUri}
291300
buttonRadius={buttonRadius}
301+
isShowAllWallets={isShowAllWallets}
292302
/>
293303
</div>
294304
)}

packages/modal/src/ui/components/ConnectWallet/ConnectWallet.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface ConnectWalletProps {
88
walletConnectUri: string | undefined;
99
metamaskConnectUri: string | undefined;
1010
walletRegistry?: WalletRegistry;
11-
allExternalButtons: ExternalButton[];
11+
allRegistryButtons: ExternalButton[];
1212
customConnectorButtons: ExternalButton[];
1313
connectorVisibilityMap: Record<string, boolean>;
1414
deviceDetails: { platform: platform; browser: browser; os: os };

packages/modal/src/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { useState } from "react";
21
import { useTranslation } from "react-i18next";
32

43
import i18n from "../../../localeImport";
@@ -114,20 +113,20 @@ function ConnectWalletList(props: ConnectWalletListProps) {
114113
deviceDetails,
115114
walletConnectUri,
116115
buttonRadius,
116+
isShowAllWallets,
117117
} = props;
118118

119-
const [showMoreWallets, setShowMoreWallets] = useState(true);
120-
121119
const onShowMoreWalletsClick = () => {
122-
setShowMoreWallets(false);
123120
handleMoreWallets();
124121
};
125122

123+
const showMoreWalletsButton = !isShowAllWallets;
124+
126125
return (
127126
<>
128127
<ul
129128
className={cn("w3a--overflow-y-auto w3a--flex w3a--flex-col w3a--gap-y-2 w3a--h-[280px] w3a--social-container w3a--pr-2.5", {
130-
"w3a--h-[328px]": !showMoreWallets,
129+
"w3a--h-[328px]": !showMoreWalletsButton,
131130
})}
132131
>
133132
{externalButtons.length === 0 ? (
@@ -143,7 +142,7 @@ function ConnectWalletList(props: ConnectWalletListProps) {
143142
/>
144143
)}
145144
</ul>
146-
{showMoreWallets && totalExternalWalletsCount > 15 && !isLoading && initialWalletCount < totalExternalWalletsCount && (
145+
{showMoreWalletsButton && !isLoading && initialWalletCount < totalExternalWalletsCount && (
147146
<MoreWalletsButton
148147
totalExternalWalletsCount={totalExternalWalletsCount}
149148
initialWalletCount={initialWalletCount}

packages/modal/src/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface ConnectWalletListProps {
1111
buttonRadius: ButtonRadiusType;
1212
handleWalletClick: (button: ExternalButton) => void;
1313
handleMoreWallets: () => void;
14+
isShowAllWallets: boolean;
1415
}
1516

1617
export type WalletsFoundProps = Pick<

packages/modal/src/ui/components/Login/Login.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function Login(props: LoginProps) {
5050
isDark,
5151
handleSocialLoginClick,
5252
totalExternalWallets,
53+
remainingUndisplayedWallets,
5354
isEmailPasswordLessLoginVisible,
5455
isSmsPasswordLessLoginVisible,
5556
handleExternalWalletBtnClick,
@@ -509,7 +510,7 @@ function Login(props: LoginProps) {
509510
))}
510511

511512
{/* EXTERNAL WALLETS DISCOVERY */}
512-
{totalExternalWallets > 3 && (
513+
{remainingUndisplayedWallets > 0 && (
513514
<button
514515
type="button"
515516
className={cn("w3a--btn !w3a--justify-between w3a--group w3a--relative w3a--overflow-hidden", {
@@ -520,12 +521,12 @@ function Login(props: LoginProps) {
520521
onClick={handleConnectWallet}
521522
>
522523
<p className="w3a--text-base w3a--font-normal w3a--text-app-gray-900 dark:w3a--text-app-white">{t("modal.external.all-wallets")}</p>
523-
{showExternalWalletCount && totalExternalWallets > 0 && (
524+
{showExternalWalletCount && (
524525
<div
525526
id="external-wallet-count"
526527
className="w3a--absolute w3a--right-4 w3a--top-1/2 w3a--w-auto -w3a--translate-y-1/2 w3a--rounded-full w3a--bg-app-primary-100 w3a--px-2.5 w3a--py-0.5 w3a--text-xs w3a--font-medium w3a--text-app-primary-800 w3a--transition-all w3a--delay-300 w3a--duration-300 group-hover:w3a--translate-x-6 group-hover:w3a--opacity-0 group-hover:w3a--delay-0 dark:w3a--border dark:w3a--border-app-primary-500 dark:w3a--bg-transparent dark:w3a--text-app-primary-500"
527528
>
528-
{totalExternalWallets - 1}
529+
{remainingUndisplayedWallets}
529530
</div>
530531
)}
531532
<img

packages/modal/src/ui/components/Login/Login.type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export interface LoginProps {
3232
isEmailPasswordLessLoginVisible: boolean;
3333
isSmsPasswordLessLoginVisible: boolean;
3434
totalExternalWallets: number;
35+
remainingUndisplayedWallets: number;
3536
logoAlignment?: LogoAlignmentType;
3637
buttonRadius?: ButtonRadiusType;
3738
deviceDetails: { platform: platform; browser: browser; os: os };

0 commit comments

Comments
 (0)