-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathModalActivePairing.svelte
79 lines (70 loc) · 1.49 KB
/
ModalActivePairing.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<script>
import { createModalEventDispatcher } from "svelte-modals";
export let isOpen;
export let title;
export let options;
const dispatch = createModalEventDispatcher();
</script>
<style>
.modal {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
color: black;
/* allow click-through to backdrop */
pointer-events: none;
}
.contents {
min-width: 240px;
border-radius: 6px;
padding: 16px;
background: white;
display: flex;
flex-direction: column;
justify-content: space-between;
pointer-events: auto;
}
.button {
color: black;
border-color: black;
}
h2 {
text-align: center;
font-size: 24px;
}
p {
text-align: center;
margin-top: 16px;
}
.actions {
margin-top: 32px;
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 8px;
}
</style>
{#if isOpen}
<div role="dialog" class="modal">
<div class="contents">
<h2>{title}</h2>
<div class="actions">
{#each options as option}
<button class="button" on:click={() => dispatch("select", option)}>
{option.peerMetadata.logo ?? ""}
{option.peerMetadata.name}
</button>
{/each}
<p>or</p>
<button class="button" on:click={() => dispatch("select", "new_pairing")}
>New Pairing</button
>
</div>
</div>
</div>
{/if}