From 13822682d5a9c9e4b9e624a5c3dc8a3089cff77e Mon Sep 17 00:00:00 2001 From: ibro Date: Wed, 31 Jul 2024 16:51:41 +0100 Subject: [PATCH] Merge pull-request #25 from sameoldlab/function-api export connectModal as function update example Remove custom element workarounds - Moves style imports to script return state after connection attempt enable svelte imports - alows use of connect modal from compiled svelte or direclty importing components --- examples/svelte/src/App.svelte | 29 ++++++++++--------- .../ui/src/components/AccountModal.svelte | 2 +- .../ui/src/components/Common/Modal.svelte | 2 +- packages/ui/src/components/FractlModal.svelte | 4 +-- packages/ui/src/index.ts | 2 +- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/examples/svelte/src/App.svelte b/examples/svelte/src/App.svelte index a8f3d98..0322f41 100644 --- a/examples/svelte/src/App.svelte +++ b/examples/svelte/src/App.svelte @@ -15,20 +15,23 @@ const evm = addEvmConnection($wagmiConfig) let account - const connect = async (conf) => create(conf).then((connect) => connect() - .then(res => { - account = { - config: res, - accountData: res.accountData - } - console.log(res) - }) - .catch(err => console.error(err)) + const connect = async (conf) => + create(conf).then((connect) => + connect() + .then((res) => { + account = { + config: res, + accountData: res.accountData + } + console.log(res) + }) + .catch((err) => console.error(err)) ) +
- - + +
@@ -43,8 +46,8 @@

{#if account} - - {/if} + + {/if}