Skip to content

Commit 7d5c42f

Browse files
authored
Revert "Enhancement: Account Center Updates (#1723)" (#1729)
This reverts commit 0297ebb.
1 parent 0297ebb commit 7d5c42f

File tree

13 files changed

+243
-308
lines changed

13 files changed

+243
-308
lines changed

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,6 @@ 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.23.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-
3620
## Install
3721

3822
Install the core module:

packages/core/README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,6 @@
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.23.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-
239
## Quick start
2410

2511
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.18.1-alpha.3",
3+
"version": "2.18.1-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/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const APP_INITIAL_STATE: AppState = {
77
chains: [],
88
accountCenter: {
99
enabled: true,
10-
position: 'bottomRight',
10+
position: 'topRight',
1111
expanded: false,
1212
minimal: configuration.device.type === 'mobile'
1313
},

packages/core/src/views/Index.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@
378378
.container {
379379
padding: 16px;
380380
font-family: var(--onboard-font-family-normal, var(--font-family-normal));
381+
width: 100%;
381382
pointer-events: none;
382383
touch-action: none;
383384
}
Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<script lang="ts">
22
import { onDestroy } from 'svelte'
33
import { updateAccountCenter } from '../../store/actions.js'
4+
import { wallets$ } from '../../streams.js'
45
import { state } from '../../store/index.js'
56
import { shareReplay, startWith } from 'rxjs/operators'
6-
import AccountCenterPanel from './AccountCenterPanel.svelte'
7-
import TriggerLarge from './AcctCenterTriggerLarge.svelte'
8-
import TriggerSmall from './AcctCenterTriggerSmall.svelte'
7+
import Maximized from './Maximized.svelte'
8+
import Minimized from './Minimized.svelte'
9+
import Micro from './Micro.svelte'
10+
11+
export let mountInContainer = false
912
1013
const accountCenter$ = state
1114
.select('accountCenter')
@@ -22,20 +25,19 @@
2225

2326
<svelte:window on:click={minimize} />
2427

25-
{#key $accountCenter$.position}
26-
{#key $accountCenter$.minimal}
27-
<div class="container flex flex-column items-end" style="width: 315px;">
28-
{#if $accountCenter$.position.includes('bottom')}
29-
<AccountCenterPanel />
30-
{/if}
31-
{#if $accountCenter$.minimal}
32-
<TriggerSmall />
33-
{:else}
34-
<TriggerLarge />
35-
{/if}
36-
{#if $accountCenter$.position.includes('top')}
37-
<AccountCenterPanel />
28+
{#if mountInContainer}
29+
{#if $wallets$.length}
30+
<div class="container flex flex-column fixed z-indexed">
31+
<svelte:self />
32+
</div>
3833
{/if}
39-
</div>
40-
{/key}
41-
{/key}
34+
{:else if !$accountCenter$.expanded && !$accountCenter$.minimal}
35+
<!-- minimized -->
36+
<Minimized />
37+
{:else if !$accountCenter$.expanded && $accountCenter$.minimal}
38+
<!-- micro -->
39+
<Micro />
40+
{:else}
41+
<!-- maximized -->
42+
<Maximized />
43+
{/if}

0 commit comments

Comments
 (0)