Skip to content

Commit 3c9410b

Browse files
authored
Enhancement: Account center updates (#1740)
1 parent de1fb17 commit 3c9410b

File tree

14 files changed

+692
-672
lines changed

14 files changed

+692
-672
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,22 @@ title: Core
1717

1818
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.
1919

20+
:::admonition type="tip"
21+
_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+
```typescript
23+
accountCenter: {
24+
desktop: {
25+
enabled: true,
26+
position: 'topRight'
27+
},
28+
mobile: {
29+
enabled: true,
30+
position: 'topRight'
31+
}
32+
}
33+
```
34+
:::
35+
2036
## Install
2137

2238
Install the core module:

packages/core/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66

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

9+
_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+
```typescript
11+
accountCenter: {
12+
desktop: {
13+
enabled: true,
14+
position: 'topRight'
15+
},
16+
mobile: {
17+
enabled: true,
18+
position: 'topRight'
19+
}
20+
}
21+
```
22+
923
## Quick start
1024

1125
Checkout our full library of quick start examples for connecting and interacting with EVM based wallets

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.19.2",
3+
"version": "2.20.0-alpha.1",
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/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export const APP_INITIAL_STATE: AppState = {
77
chains: [],
88
accountCenter: {
99
enabled: true,
10-
position: 'topRight',
10+
position: 'bottomRight',
1111
expanded: false,
12-
minimal: configuration.device.type === 'mobile'
12+
minimal: true
1313
},
1414
notify: {
1515
enabled: true,

packages/core/src/views/Index.svelte

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,9 @@
378378
.container {
379379
padding: 16px;
380380
font-family: var(--onboard-font-family-normal, var(--font-family-normal));
381-
width: 100%;
382381
pointer-events: none;
383382
touch-action: none;
383+
width: 100%;
384384
}
385385
386386
.z-indexed {
@@ -442,18 +442,7 @@
442442
{#if $accountCenter$.position.includes('bottom')}
443443
<div id="w3o-transaction-preview-container" style="margin-bottom: 8px;" />
444444
{/if}
445-
<div
446-
style={!$accountCenter$.expanded &&
447-
$accountCenter$.minimal &&
448-
$accountCenter$.position.includes('Right')
449-
? 'margin-left: auto'
450-
: !$accountCenter$.expanded &&
451-
$accountCenter$.minimal &&
452-
$accountCenter$.position.includes('Left')
453-
? 'margin-right: auto'
454-
: ''}
455-
id="account-center-with-notify"
456-
>
445+
<div id="account-center-with-notify">
457446
{#await accountCenterComponent then AccountCenter}
458447
{#if AccountCenter}
459448
<svelte:component this={AccountCenter} />
@@ -491,21 +480,11 @@
491480
{#if $accountCenter$.position.includes('bottom')}
492481
<div id="w3o-transaction-preview-container" style="margin-bottom: 8px;" />
493482
{/if}
494-
<div
495-
style={!$accountCenter$.expanded &&
496-
$accountCenter$.minimal &&
497-
$accountCenter$.position.includes('Right')
498-
? 'margin-left: auto'
499-
: !$accountCenter$.expanded &&
500-
$accountCenter$.minimal &&
501-
$accountCenter$.position.includes('Left')
502-
? 'margin-right: auto'
503-
: ''}
504-
>
483+
<div>
505484
{#if $accountCenter$.enabled && $wallets$.length}
506485
{#await accountCenterComponent then AccountCenter}
507486
{#if AccountCenter}
508-
<svelte:component this={AccountCenter} />
487+
<svelte:component this={AccountCenter} />
509488
{/if}
510489
{/await}
511490
{/if}

0 commit comments

Comments
 (0)