Skip to content

Commit

Permalink
[FIX] - Particle icon imports (#2156)
Browse files Browse the repository at this point in the history
* Bump versions for release and Remove console.log

* Fix particle icon imports
  • Loading branch information
Adamj1232 authored Apr 12, 2024
1 parent 4a1f822 commit 6a726a6
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@web3-onboard/web3auth": "^2.2.3",
"@web3-onboard/xdefi": "^2.0.4",
"@web3-onboard/zeal": "^2.0.4",
"@web3-onboard/particle-network": "^2.0.1-alpha.1",
"@web3-onboard/particle-network": "^2.0.1-alpha.3",
"animejs": "^3.2.1",
"bnc-sdk": "^4.6.6",
"ethers": "^5.7.0",
Expand Down
14 changes: 7 additions & 7 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5908,9 +5908,9 @@
joi "17.9.1"

"@web3-onboard/core@^2.21.6-alpha.1":
version "2.21.5"
resolved "https://registry.yarnpkg.com/@web3-onboard/core/-/core-2.21.5.tgz#aaddc12fc29e134f3ec44a84f863e0c2c490a249"
integrity sha512-e23bmWj0+dC9sbu/TvzPJm0mUikUB/0yAL+Gqh2mmWOpr2GKBpROnRNhevne3IyeDf16mdkUo8wVEO6eGsiANg==
version "2.21.6-alpha.1"
resolved "https://registry.yarnpkg.com/@web3-onboard/core/-/core-2.21.6-alpha.1.tgz#43070f4c187c39199b77f4ae6d5893fb366afc74"
integrity sha512-AB5M3Fc3RisZFNwXmH9CbGRmieaHnCsLMNNvrb6cpTpmmx1UFXj6vDwdQJwX0rrvUNAurdavbDK0DkzvnINofg==
dependencies:
"@web3-onboard/common" "^2.3.4"
bignumber.js "^9.0.0"
Expand Down Expand Up @@ -6074,10 +6074,10 @@
"@web3-onboard/common" "^2.3.3"
lodash.uniqby "^4.7.0"

"@web3-onboard/particle-network@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@web3-onboard/particle-network/-/particle-network-2.0.0.tgz#3120c507c0486b6c0f3e4b7a93967d0d97d83c69"
integrity sha512-2uiXMuKcRKe9lYnbxAa/jmfdtUmQruAyVuQ8QtPj0UQi5nBWHcrK/grmimUHzboxe/UCbn9+Qe8FrrGF1HA9Hw==
"@web3-onboard/particle-network@^2.0.1-alpha.2":
version "2.0.1-alpha.2"
resolved "https://registry.yarnpkg.com/@web3-onboard/particle-network/-/particle-network-2.0.1-alpha.2.tgz#45e60de7033904c1d2304759dff3caf9f8d5db81"
integrity sha512-jc3YdIwQWS2aSV7aGt2Z965e9ulN7Kz6hBew2BVlIu1FLDOFsbca402Btk8SWc/tsURcNgVnfNpwPqLM2rnCEw==
dependencies:
"@particle-network/auth" "^1.2.1"
"@particle-network/provider" "^1.2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/particle-network/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/particle-network",
"version": "2.0.1-alpha.2",
"version": "2.0.1-alpha.3",
"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.",
"keywords": [
"Ethereum",
Expand Down
32 changes: 30 additions & 2 deletions packages/particle-network/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,36 @@ const particleAuth = (options: ParticleAuthModuleOptions): WalletInit => {
return () => ({
label: displayLabel,
getIcon: async () => {
const iconName = authType && setAsDisplay ? authType : 'icon'
return (await import(`./${iconName}.js`)).default
const icons = await Promise.all([
import('./email.js'),
import('./phone.js'),
import('./google.js'),
import('./apple.js'),
import('./twitter.js'),
import('./facebook.js'),
import('./microsoft.js'),
import('./linkedin.js'),
import('./github.js'),
import('./twitch.js'),
import('./discord.js')
])

const iconMap = {
email: icons[0].default,
phone: icons[1].default,
google: icons[2].default,
apple: icons[3].default,
twitter: icons[4].default,
facebook: icons[5].default,
microsoft: icons[6].default,
linkedin: icons[7].default,
github: icons[8].default,
twitch: icons[9].default,
discord: icons[10].default
}
const iconName =
authType && setAsDisplay ? authType : ('icon' as AuthTypes)
return iconMap[iconName]
},
getInterface: async ({ chains }) => {
const { createEIP1193Provider } = await import('@web3-onboard/common')
Expand Down

0 comments on commit 6a726a6

Please sign in to comment.