Skip to content

Commit fb81fbb

Browse files
authored
[core-v2.6.0-alpha.4, react-v2.2.5-alpha.4, vue-v2.1.5-alpha.4] : Fix - Add optionality to containerElement, format validation so accountCent… (#1166)
* Add optionality to containerElement, format validation so accountCenter validations are close to eachother, bump versions * Clean up accountCenter init options * Bump react and vue packages
1 parent e71f10f commit fb81fbb

File tree

6 files changed

+24
-26
lines changed

6 files changed

+24
-26
lines changed

packages/core/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export type AccountCenter = {
105105
position?: AccountCenterPosition // default: 'topRight'
106106
expanded?: boolean // default: true
107107
minimal?: boolean // enabled by default for mobile
108+
containerElement?: string // defines the DOM container element for svelte to attach
108109
}
109110

110111
export type AccountCenterOptions = {

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.6.0-alpha.3",
3+
"version": "2.6.0-alpha.4",
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export type AccountCenter = {
141141
position?: AccountCenterPosition
142142
expanded?: boolean
143143
minimal?: boolean
144-
containerElement: string
144+
containerElement?: string
145145
}
146146

147147
export type AccountCenterOptions = {

packages/core/src/validation.ts

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -153,25 +153,30 @@ const notifyOptions = Joi.object({
153153
mobile: notify
154154
})
155155

156+
const accountCenterInitOptions = Joi.object({
157+
enabled: Joi.boolean(),
158+
position: commonPositions,
159+
minimal: Joi.boolean(),
160+
containerElement: Joi.string()
161+
})
162+
163+
const accountCenter = Joi.object({
164+
enabled: Joi.boolean(),
165+
position: commonPositions,
166+
expanded: Joi.boolean(),
167+
minimal: Joi.boolean(),
168+
containerElement: Joi.string()
169+
})
170+
156171
const initOptions = Joi.object({
157172
wallets: walletInit,
158173
chains: chains.required(),
159174
appMetadata: appMetadata,
160175
i18n: Joi.object().unknown(),
161176
apiKey: Joi.string(),
162177
accountCenter: Joi.object({
163-
desktop: Joi.object({
164-
enabled: Joi.boolean(),
165-
minimal: Joi.boolean(),
166-
position: commonPositions,
167-
containerElement: Joi.string()
168-
}),
169-
mobile: Joi.object({
170-
enabled: Joi.boolean(),
171-
minimal: Joi.boolean(),
172-
position: commonPositions,
173-
containerElement: Joi.string()
174-
})
178+
desktop: accountCenterInitOptions,
179+
mobile: accountCenterInitOptions
175180
}),
176181
notify: [notifyOptions, notify]
177182
})
@@ -198,14 +203,6 @@ const setChainOptions = Joi.object({
198203
wallet: Joi.string()
199204
})
200205

201-
const accountCenter = Joi.object({
202-
enabled: Joi.boolean(),
203-
position: commonPositions,
204-
expanded: Joi.boolean(),
205-
minimal: Joi.boolean(),
206-
containerElement: Joi.string()
207-
})
208-
209206
const customNotificationUpdate = Joi.object({
210207
key: Joi.string().required(),
211208
type: Joi.string().allow('pending', 'error', 'success', 'hint'),

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.2.5-alpha.3",
3+
"version": "2.2.5-alpha.4",
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",
@@ -62,7 +62,7 @@
6262
"typescript": "^4.5.5"
6363
},
6464
"dependencies": {
65-
"@web3-onboard/core": "^2.6.0-alpha.3",
65+
"@web3-onboard/core": "^2.6.0-alpha.4",
6666
"@web3-onboard/common": "^2.1.7-alpha.2",
6767
"use-sync-external-store": "1.0.0"
6868
},

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.1.5-alpha.3",
3+
"version": "2.1.5-alpha.4",
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 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
"@vueuse/core": "^8.4.2",
6464
"@vueuse/rxjs": "^8.2.0",
6565
"@web3-onboard/common": "^2.1.7-alpha.2",
66-
"@web3-onboard/core": "^2.6.0-alpha.3",
66+
"@web3-onboard/core": "^2.6.0-alpha.4",
6767
"vue-demi": "^0.12.4"
6868
},
6969
"peerDependencies": {

0 commit comments

Comments
 (0)