Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bridge-ui-v2): token dropdown click away #14224

Merged
merged 44 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
bec2657
minor change
jscriptcoder Jul 17, 2023
20b7d90
Merge branch 'main' into bridge_eth
jscriptcoder Jul 18, 2023
3a84b4f
wip
jscriptcoder Jul 18, 2023
82d6d88
wip
jscriptcoder Jul 19, 2023
8adfaea
wip
jscriptcoder Jul 19, 2023
ce37706
wip
jscriptcoder Jul 19, 2023
614a564
wip
jscriptcoder Jul 19, 2023
ccd044b
max button
jscriptcoder Jul 19, 2023
0c49995
wip
jscriptcoder Jul 19, 2023
2908484
wip
jscriptcoder Jul 19, 2023
a222c3f
wip
jscriptcoder Jul 19, 2023
626b928
wip
jscriptcoder Jul 19, 2023
93ceb18
wip
jscriptcoder Jul 19, 2023
3d9bf59
amount input validation
jscriptcoder Jul 19, 2023
2ab59ae
Merge branch 'main' into bridge_eth
jscriptcoder Jul 19, 2023
1be9386
minor change
jscriptcoder Jul 19, 2023
b1831d7
Merge branch 'bridge_eth' of https://github.com/taikoxyz/taiko-mono i…
jscriptcoder Jul 19, 2023
8d5fbec
minor comment
jscriptcoder Jul 19, 2023
5354874
minor TODO
jscriptcoder Jul 19, 2023
0be1db3
fix test
jscriptcoder Jul 19, 2023
8e51d03
remove unnecessary file
jscriptcoder Jul 19, 2023
5780ea5
fix error
jscriptcoder Jul 19, 2023
3ba05aa
fix ts error
jscriptcoder Jul 19, 2023
9e49964
fix lint
jscriptcoder Jul 19, 2023
c1f27b9
minor change
jscriptcoder Jul 19, 2023
a3b7074
minor change
jscriptcoder Jul 19, 2023
893b37e
fix lint
jscriptcoder Jul 19, 2023
b459d39
align to new design
jscriptcoder Jul 19, 2023
d67cc8e
minor change
jscriptcoder Jul 19, 2023
86189c6
wip
jscriptcoder Jul 19, 2023
a07fd21
wip
jscriptcoder Jul 20, 2023
9621dda
merge main
jscriptcoder Jul 20, 2023
46dbaa3
wip
jscriptcoder Jul 20, 2023
1f64023
wip
jscriptcoder Jul 20, 2023
0691e81
wip
jscriptcoder Jul 20, 2023
9c34ede
wip
jscriptcoder Jul 20, 2023
3b76b8c
wip
jscriptcoder Jul 20, 2023
7587459
wip
jscriptcoder Jul 20, 2023
3c62249
wip
jscriptcoder Jul 20, 2023
4948994
inssuficient balance and allowance
jscriptcoder Jul 20, 2023
348be82
fix ts
jscriptcoder Jul 20, 2023
c46764c
minor change
jscriptcoder Jul 20, 2023
28e4fc6
fix token dropdown
jscriptcoder Jul 20, 2023
48bd235
Merge branch 'main' into fix_token_dropdown
jscriptcoder Jul 20, 2023
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
21 changes: 21 additions & 0 deletions packages/bridge-ui-v2/src/components/ClickMask/ClickMask.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script lang="ts">
import { onMount } from 'svelte';
import { noop, onDestroy } from 'svelte/internal';

export let active = false;
export let fn = noop;

let mask: HTMLDivElement;

onMount(() => {
mask?.addEventListener('click', fn);
});

onDestroy(() => {
mask?.removeEventListener('click', fn);
});

$: displayClass = active ? 'block' : 'hidden';
</script>

<div class="{displayClass} fixed top-0 right-0 bottom-0 left-0" bind:this={mask} />
1 change: 1 addition & 0 deletions packages/bridge-ui-v2/src/components/ClickMask/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as ClickMask } from './ClickMask.svelte';
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { noop } from 'svelte/internal';

import { ClickMask } from '$components/ClickMask';
import type { Token } from '$libs/token';
import { classNames } from '$libs/util/classNames';

Expand All @@ -11,6 +12,7 @@
export let tokens: Token[] = [];
export let value: Maybe<Token> = null;
export let selectToken: (token: Token) => void = noop;
export let closeMenu: () => void = noop;

$: menuClasses = classNames(
'menu absolute right-0 w-[265px] p-3 mt-2 rounded-[10px] bg-neutral-background z-10',
Expand Down Expand Up @@ -44,3 +46,5 @@
</li>
{/each}
</ul>

<ClickMask fn={closeMenu} active={menuOpen} />
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</button>

{#if isDesktopOrLarger}
<DropdownView {id} {menuOpen} {tokens} {value} {selectToken} />
<DropdownView {id} {menuOpen} {tokens} {value} {selectToken} {closeMenu} />
{:else}
<DialogView {id} {menuOpen} {tokens} {value} {selectToken} {closeMenu} />
{/if}
Expand Down