Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/core",
"version": "2.7.0-alpha.3",
"version": "2.7.0-alpha.4",
"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.",
"keywords": [
"Ethereum",
Expand Down
67 changes: 48 additions & 19 deletions packages/core/src/views/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import Connect from './connect/Index.svelte'
import SwitchChain from './chain/SwitchChain.svelte'
import ActionRequired from './connect/ActionRequired.svelte'
import AccountCenter from './account-center/Index.svelte'
import Notify from './notify/Index.svelte'
import { configuration } from '../configuration'
import type { Observable } from 'rxjs'
import type { Notification } from '../types'
Expand Down Expand Up @@ -43,6 +41,14 @@
}
}
const accountCenterComponent = $accountCenter$.enabled
? import('./account-center/Index.svelte').then(mod => mod.default)
: Promise.resolve(null)
const notifyComponent = $notify$.enabled
? import('./notify/Index.svelte').then(mod => mod.default)
: Promise.resolve(null)
$: sharedContainer =
$accountCenter$.enabled &&
$notify$.enabled &&
Expand Down Expand Up @@ -359,11 +365,16 @@
: ''} "
>
{#if $notify$.position.includes('bottom') && $accountCenter$.position.includes('bottom') && samePositionOrMobile}
<Notify
notifications={$notifications$}
position={$notify$.position}
{sharedContainer}
/>
{#await notifyComponent then Notify}
{#if Notify}
<svelte:component
this={Notify}
notifications={$notifications$}
position={$notify$.position}
{sharedContainer}
/>
{/if}
{/await}
{/if}
<div
style={!$accountCenter$.expanded &&
Expand All @@ -376,14 +387,23 @@
? 'margin-right: auto'
: ''}
>
<AccountCenter settings={$accountCenter$} />
{#await accountCenterComponent then AccountCenter}
{#if AccountCenter}
<svelte:component this={AccountCenter} settings={$accountCenter$} />
{/if}
{/await}
</div>
{#if $notify$.position.includes('top') && $accountCenter$.position.includes('top') && samePositionOrMobile}
<Notify
notifications={$notifications$}
position={$notify$.position}
{sharedContainer}
/>
{#await notifyComponent then Notify}
{#if Notify}
<svelte:component
this={Notify}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet! I havent seen this approach before 🎸

notifications={$notifications$}
position={$notify$.position}
{sharedContainer}
/>
{/if}
{/await}
{/if}
</div>
{/if}
Expand All @@ -410,7 +430,11 @@
: ''}
>
{#if $accountCenter$.enabled && $wallets$.length}
<AccountCenter settings={$accountCenter$} />
{#await accountCenterComponent then AccountCenter}
{#if AccountCenter}
<svelte:component this={AccountCenter} settings={$accountCenter$} />
{/if}
{/await}
{/if}
</div>
</div>
Expand All @@ -426,10 +450,15 @@
? 'padding-top:0;'
: ''} "
>
<Notify
notifications={$notifications$}
position={$notify$.position}
{sharedContainer}
/>
{#await notifyComponent then Notify}
{#if Notify}
<svelte:component
this={Notify}
notifications={$notifications$}
position={$notify$.position}
{sharedContainer}
/>
{/if}
{/await}
</div>
{/if}
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/core": "^2.7.0-alpha.3",
"@web3-onboard/core": "^2.7.0-alpha.4",
"@web3-onboard/common": "^2.1.8-alpha.1",
"use-sync-external-store": "1.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@vueuse/core": "^8.4.2",
"@vueuse/rxjs": "^8.2.0",
"@web3-onboard/common": "^2.1.8-alpha.1",
"@web3-onboard/core": "^2.7.0-alpha.3",
"@web3-onboard/core": "^2.7.0-alpha.4",
"vue-demi": "^0.12.4"
},
"peerDependencies": {
Expand Down