Skip to content

Commit

Permalink
Merge pull request #22 from sameoldlab/fix-dialog-close
Browse files Browse the repository at this point in the history
close on destroy
  • Loading branch information
sameoldlab authored Jul 30, 2024
2 parents c20738e + c40fce4 commit 133e81d
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 12 deletions.
26 changes: 16 additions & 10 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [[ "fractl-ui", "@fractl-ui/types", "x-*", "@fractl-ui/*"]],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [
[
"fractl-ui",
"@fractl-ui/types",
"x-*"
]
],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/sweet-bugs-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fractl-ui": patch
---

fixed hideen scrollbar on modal close
8 changes: 7 additions & 1 deletion packages/ui/src/components/AccountModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
} from '@fractl-ui/types'
import Zorb from './zorb/Zorb.svelte'
import Modal from './Common/Modal.svelte'
import { onDestroy } from 'svelte'
export let accountData: AccountData
export let config: ConfigConnected
Expand All @@ -19,8 +20,13 @@
$: symbol = accountData.balance?.symbol
let open: () => void
let close: () => void
onDestroy(() => {
close()
})
const handleDisconnect = async (connector: Connector) => {
close()
await config.disconnect(connector)
}
</script>
Expand All @@ -42,7 +48,7 @@
{name || truncate(address)}
</button>

<Modal titleText="Connected" bind:open customTrigger>
<Modal titleText="Connected" bind:open bind:close customTrigger>
<!-- header>div*2+div.balance+hr+div>div.header -->
<div class="fcl__layout-3col">
{#if avatar}
Expand Down
5 changes: 4 additions & 1 deletion packages/ui/src/components/Common/Modal.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import '../../styles/index.css'
import { createEventDispatcher } from 'svelte'
import { createEventDispatcher, onDestroy } from 'svelte'
const dispatch = createEventDispatcher()
export let titleText = 'Title Text'
Expand Down Expand Up @@ -48,6 +48,9 @@
dialog.close()
dispatch('close')
}
onDestroy(()=>{
dispatch('close')
})
</script>

<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/src/components/ConnectModal/ConnectModal.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script lang="ts">
import { onDestroy, onMount } from 'svelte'

Check failure on line 3 in packages/ui/src/components/ConnectModal/ConnectModal.svelte

View workflow job for this annotation

GitHub Actions / build

'onMount' is defined but never used
import copyEN from '../../copy/copy.EN.js'
import Modal from '../Common/Modal.svelte'
import Scannable from './Scannable.svelte'
Expand All @@ -17,6 +19,7 @@
// export let accountStatus: string
// export let chainStatus
// export let showBalance: string
onDestroy(()=>{close()})
$: if (state.status === 'connected') close()
let activeRequest: Connector | null = null //config.connectors[3]
Expand Down

0 comments on commit 133e81d

Please sign in to comment.