Skip to content

Commit bda3475

Browse files
fix: Add option to hide the where is my wallet notice (#1786)
* fix: Add option to hide the where is my wallet notice * chore: Bump version * Format and update docs --------- Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com>
1 parent 71cb735 commit bda3475

File tree

11 files changed

+45
-43
lines changed

11 files changed

+45
-43
lines changed

docs/src/routes/docs/[...3]modules/[...1]core/+page.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This is the core package that contains all of the UI and logic to be able to sea
1919

2020
:::admonition type="tip"
2121
_note: Release 2.24.0 moves the default position of the account center from topRight to bottomRight. To reset your application to topRight, include the following when initializing onboard:_
22+
2223
```typescript
2324
accountCenter: {
2425
desktop: {
@@ -31,6 +32,7 @@ _note: Release 2.24.0 moves the default position of the account center from topR
3132
}
3233
}
3334
```
35+
3436
:::
3537

3638
## Install
@@ -279,6 +281,10 @@ type ConnectModalOptions = {
279281
* Defaults to `https://www.blocknative.com/blog/metamask-wont-connect-web3-wallet-troubleshooting`
280282
*/
281283
wheresMyWalletLink?: string
284+
/**
285+
* Hide the where is my wallet link notice displayed in the connect modal
286+
*/
287+
hideWhereIsMyWallet?: boolean
282288
/**
283289
* @deprecated Has no effect unless `@web3-onboard/unstoppable-resolution`
284290
* package has been added and passed into the web3-onboard initialization

packages/core/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
This is the core package that contains all of the UI and logic to be able to seamlessly connect user's wallets to your app and track the state of those wallets. Onboard no longer contains any wallet specific code, so wallets need to be passed in upon initialization.
88

99
_Tip: Release 2.24.0 moves the default position of the account center from topRight to bottomRight. To reset your application to topRight, include the following when initializing onboard:_
10+
1011
```typescript
1112
accountCenter: {
1213
desktop: {
@@ -246,6 +247,10 @@ type ConnectModalOptions = {
246247
* Defaults to `https://www.blocknative.com/blog/metamask-wont-connect-web3-wallet-troubleshooting`
247248
*/
248249
wheresMyWalletLink?: string
250+
/**
251+
* Hide the where is my wallet link notice displayed in the connect modal
252+
*/
253+
hideWhereIsMyWallet?: boolean
249254
/**
250255
* @deprecated Has no effect unless `@web3-onboard/unstoppable-resolution`
251256
* package has been added and passed into the web3-onboard initialization

packages/core/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/core",
3-
"version": "2.20.4-alpha.1",
3+
"version": "2.20.4-alpha.2",
44
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized 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/core/src/types.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export interface AppState {
179179
locale: Locale
180180
notify: Notify
181181
notifications: Notification[]
182-
connect: ConnectModalOptions,
182+
connect: ConnectModalOptions
183183
appMetadata: AppMetadata
184184
}
185185

@@ -243,6 +243,10 @@ export type ConnectModalOptions = {
243243
* metamask-wont-connect-web3-wallet-troubleshooting`
244244
*/
245245
wheresMyWalletLink?: string
246+
/**
247+
* Hide the where is my wallet link notice displayed in the connect modal
248+
*/
249+
hideWhereIsMyWallet?: boolean
246250
/**
247251
* @deprecated Has no effect unless `@web3-onboard/unstoppable-resolution`
248252
* package has been added and passed into the web3-onboard initialization
@@ -429,7 +433,7 @@ export type Action =
429433
| AddNotificationAction
430434
| RemoveNotificationAction
431435
| UpdateAllWalletsAction
432-
| UpdateConnectModalAction
436+
| UpdateConnectModalAction
433437
| UpdateAppMetadataAction
434438

435439
export type AddChainsAction = { type: 'add_chains'; payload: Chain[] }

packages/core/src/validation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ const connectModalOptions = Joi.object({
202202
autoConnectAllPreviousWallet: Joi.boolean(),
203203
iDontHaveAWalletLink: Joi.string(),
204204
wheresMyWalletLink: Joi.string(),
205+
hideWhereIsMyWallet: Joi.boolean(),
205206
disableUDResolution: Joi.boolean()
206207
})
207208

packages/core/src/views/connect/SelectingWallet.svelte

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,25 @@
8888
connectingWalletLabel !== wallet.label}
8989
/>
9090
{/each}
91-
<div class="notice-container">
92-
<Warning>
93-
<div>{$_('connect.selectingWallet.whyDontISeeMyWallet', {
94-
default: en.connect.selectingWallet.whyDontISeeMyWallet
95-
})}</div>
96-
<a
97-
class="link pointer"
98-
href={connect.wheresMyWalletLink || wheresMyWalletDefault}
99-
target="_blank"
100-
rel="noreferrer noopener">{$_('connect.selectingWallet.learnMore', {
101-
default: en.connect.selectingWallet.learnMore
102-
})}</a
103-
>
104-
</Warning>
105-
</div>
91+
{#if !connect.hideWhereIsMyWallet}
92+
<div class="notice-container">
93+
<Warning>
94+
<div>
95+
{$_('connect.selectingWallet.whyDontISeeMyWallet', {
96+
default: en.connect.selectingWallet.whyDontISeeMyWallet
97+
})}
98+
</div>
99+
<a
100+
class="link pointer"
101+
href={connect.wheresMyWalletLink || wheresMyWalletDefault}
102+
target="_blank"
103+
rel="noreferrer noopener"
104+
>{$_('connect.selectingWallet.learnMore', {
105+
default: en.connect.selectingWallet.learnMore
106+
})}</a
107+
>
108+
</Warning>
109+
</div>
110+
{/if}
106111
</div>
107112
</div>

packages/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@web3-onboard/cede-store": "^2.0.2",
2828
"@web3-onboard/blocto": "2.0.0",
2929
"@web3-onboard/coinbase": "^2.2.3",
30-
"@web3-onboard/core": "^2.20.3",
30+
"@web3-onboard/core": "^2.20.4-alpha.2",
3131
"@web3-onboard/dcent": "^2.2.7",
3232
"@web3-onboard/enkrypt": "^2.0.3",
3333
"@web3-onboard/fortmatic": "^2.0.18",

packages/demo/src/App.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293
],
294294
connect: {
295295
// disableClose: true,
296-
autoConnectLastWallet: true,
296+
// hideWhereIsMyWallet: true,
297297
autoConnectAllPreviousWallet: true
298298
},
299299
appMetadata: {

packages/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/react",
3-
"version": "2.8.9-alpha.1",
3+
"version": "2.8.9-alpha.2",
44
"description": "A collection of React hooks for integrating Web3-Onboard in to React and Next.js projects. 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, 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",
@@ -63,7 +63,7 @@
6363
},
6464
"dependencies": {
6565
"@web3-onboard/common": "^2.3.3",
66-
"@web3-onboard/core": "^2.20.4-alpha.1",
66+
"@web3-onboard/core": "^2.20.4-alpha.2",
6767
"use-sync-external-store": "1.0.0"
6868
},
6969
"peerDependencies": {

packages/vue/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/vue",
3-
"version": "2.7.8-alpha.1",
3+
"version": "2.7.8-alpha.2",
44
"description": "A collection of Vue Composables for integrating Web3-Onboard in to a Vue or Nuxt project. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, 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",
@@ -63,7 +63,7 @@
6363
"@vueuse/core": "^8.4.2",
6464
"@vueuse/rxjs": "^8.2.0",
6565
"@web3-onboard/common": "^2.3.3",
66-
"@web3-onboard/core": "^2.20.4-alpha.1",
66+
"@web3-onboard/core": "^2.20.4-alpha.2",
6767
"vue-demi": "^0.12.4"
6868
},
6969
"peerDependencies": {

yarn.lock

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3906,25 +3906,6 @@
39063906
"@walletconnect/window-getters" "^1.0.1"
39073907
tslib "1.14.1"
39083908

3909-
"@web3-onboard/core@^2.20.3":
3910-
version "2.20.3"
3911-
resolved "https://registry.yarnpkg.com/@web3-onboard/core/-/core-2.20.3.tgz#e123979f9360057cd184d715fdedc9f0bbf45941"
3912-
integrity sha512-2fm8kJ4T4DXvPNU7rjWCAxFFEZXx2Xz7LiUCg+qXvhiHzJBBxGOBbL81HwZk9hR3eZzWwQt9tLmbFx0G2uREow==
3913-
dependencies:
3914-
"@web3-onboard/common" "^2.3.3"
3915-
bignumber.js "^9.0.0"
3916-
bnc-sdk "^4.6.7"
3917-
bowser "^2.11.0"
3918-
ethers "5.5.3"
3919-
eventemitter3 "^4.0.7"
3920-
joi "17.9.1"
3921-
lodash.merge "^4.6.2"
3922-
lodash.partition "^4.6.0"
3923-
nanoid "^4.0.0"
3924-
rxjs "^7.5.5"
3925-
svelte "^3.49.0"
3926-
svelte-i18n "^3.3.13"
3927-
39283909
"@web3-react/abstract-connector@^6.0.7":
39293910
version "6.0.7"
39303911
resolved "https://registry.yarnpkg.com/@web3-react/abstract-connector/-/abstract-connector-6.0.7.tgz#401b3c045f1e0fab04256311be49d5144e9badc6"

0 commit comments

Comments
 (0)