Skip to content

Commit 6a726a6

Browse files
authored
[FIX] - Particle icon imports (#2156)
* Bump versions for release and Remove console.log * Fix particle icon imports
1 parent 4a1f822 commit 6a726a6

File tree

4 files changed

+39
-11
lines changed

4 files changed

+39
-11
lines changed

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"@web3-onboard/web3auth": "^2.2.3",
8989
"@web3-onboard/xdefi": "^2.0.4",
9090
"@web3-onboard/zeal": "^2.0.4",
91-
"@web3-onboard/particle-network": "^2.0.1-alpha.1",
91+
"@web3-onboard/particle-network": "^2.0.1-alpha.3",
9292
"animejs": "^3.2.1",
9393
"bnc-sdk": "^4.6.6",
9494
"ethers": "^5.7.0",

docs/yarn.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5908,9 +5908,9 @@
59085908
joi "17.9.1"
59095909

59105910
"@web3-onboard/core@^2.21.6-alpha.1":
5911-
version "2.21.5"
5912-
resolved "https://registry.yarnpkg.com/@web3-onboard/core/-/core-2.21.5.tgz#aaddc12fc29e134f3ec44a84f863e0c2c490a249"
5913-
integrity sha512-e23bmWj0+dC9sbu/TvzPJm0mUikUB/0yAL+Gqh2mmWOpr2GKBpROnRNhevne3IyeDf16mdkUo8wVEO6eGsiANg==
5911+
version "2.21.6-alpha.1"
5912+
resolved "https://registry.yarnpkg.com/@web3-onboard/core/-/core-2.21.6-alpha.1.tgz#43070f4c187c39199b77f4ae6d5893fb366afc74"
5913+
integrity sha512-AB5M3Fc3RisZFNwXmH9CbGRmieaHnCsLMNNvrb6cpTpmmx1UFXj6vDwdQJwX0rrvUNAurdavbDK0DkzvnINofg==
59145914
dependencies:
59155915
"@web3-onboard/common" "^2.3.4"
59165916
bignumber.js "^9.0.0"
@@ -6074,10 +6074,10 @@
60746074
"@web3-onboard/common" "^2.3.3"
60756075
lodash.uniqby "^4.7.0"
60766076

6077-
"@web3-onboard/particle-network@^2.0.0":
6078-
version "2.0.0"
6079-
resolved "https://registry.yarnpkg.com/@web3-onboard/particle-network/-/particle-network-2.0.0.tgz#3120c507c0486b6c0f3e4b7a93967d0d97d83c69"
6080-
integrity sha512-2uiXMuKcRKe9lYnbxAa/jmfdtUmQruAyVuQ8QtPj0UQi5nBWHcrK/grmimUHzboxe/UCbn9+Qe8FrrGF1HA9Hw==
6077+
"@web3-onboard/particle-network@^2.0.1-alpha.2":
6078+
version "2.0.1-alpha.2"
6079+
resolved "https://registry.yarnpkg.com/@web3-onboard/particle-network/-/particle-network-2.0.1-alpha.2.tgz#45e60de7033904c1d2304759dff3caf9f8d5db81"
6080+
integrity sha512-jc3YdIwQWS2aSV7aGt2Z965e9ulN7Kz6hBew2BVlIu1FLDOFsbca402Btk8SWc/tsURcNgVnfNpwPqLM2rnCEw==
60816081
dependencies:
60826082
"@particle-network/auth" "^1.2.1"
60836083
"@particle-network/provider" "^1.2.0"

packages/particle-network/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/particle-network",
3-
"version": "2.0.1-alpha.2",
3+
"version": "2.0.1-alpha.3",
44
"description": "Particle Network SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",

packages/particle-network/src/index.ts

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,36 @@ const particleAuth = (options: ParticleAuthModuleOptions): WalletInit => {
6666
return () => ({
6767
label: displayLabel,
6868
getIcon: async () => {
69-
const iconName = authType && setAsDisplay ? authType : 'icon'
70-
return (await import(`./${iconName}.js`)).default
69+
const icons = await Promise.all([
70+
import('./email.js'),
71+
import('./phone.js'),
72+
import('./google.js'),
73+
import('./apple.js'),
74+
import('./twitter.js'),
75+
import('./facebook.js'),
76+
import('./microsoft.js'),
77+
import('./linkedin.js'),
78+
import('./github.js'),
79+
import('./twitch.js'),
80+
import('./discord.js')
81+
])
82+
83+
const iconMap = {
84+
email: icons[0].default,
85+
phone: icons[1].default,
86+
google: icons[2].default,
87+
apple: icons[3].default,
88+
twitter: icons[4].default,
89+
facebook: icons[5].default,
90+
microsoft: icons[6].default,
91+
linkedin: icons[7].default,
92+
github: icons[8].default,
93+
twitch: icons[9].default,
94+
discord: icons[10].default
95+
}
96+
const iconName =
97+
authType && setAsDisplay ? authType : ('icon' as AuthTypes)
98+
return iconMap[iconName]
7199
},
72100
getInterface: async ({ chains }) => {
73101
const { createEIP1193Provider } = await import('@web3-onboard/common')

0 commit comments

Comments
 (0)