-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLinkDevice.svelte
More file actions
61 lines (55 loc) · 1.84 KB
/
Copy pathLinkDevice.svelte
File metadata and controls
61 lines (55 loc) · 1.84 KB
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
<script lang="ts">
import { createEventDispatcher } from 'svelte'
import clipboardCopy from 'clipboard-copy'
import { appName } from '$lib/app-info'
import { addNotification } from '$lib/notifications'
export let pin: string
const dispatch = createEventDispatcher()
const cancelConnection = () => {
dispatch('cancel')
}
const copyCode = async () => {
await clipboardCopy(pin)
addNotification({ msg: 'Copied to clipboard', type: 'success' })
}
</script>
<input type="checkbox" id="my-modal-5" checked class="modal-toggle" />
<div class="modal">
<div
class="modal-box w-narrowModal relative text-center dark:border-slate-600 dark:border"
>
<div class="grid grid-flow-row auto-rows-max gap-7">
<h3 class="text-base">Connect to {appName}</h3>
<div class="grid grid-flow-row auto-rows-max gap-4 justify-items-center">
{#if pin}
<span
on:click={copyCode}
on:keypress={copyCode}
class="btn text-base-100 hover:text-base-100 bg-base-content hover:bg-base-content border-0 btn-lg rounded-full text-deviceCode tracking-[.18em] w-3/4 cursor-pointer font-mono font-light"
>
{pin}
</span>
{/if}
<span class="text-sm text-left">
Enter this code on your connected device.
</span>
<div
class="grid grid-flow-col auto-cols-max gap-4 justify-center items-center text-slate-500"
>
<span
class="rounded-lg border-t-2 border-l-2 border-slate-600 dark:border-slate-50 w-4 h-4 block animate-spin"
/>
Waiting for a response...
</div>
</div>
<div>
<button
class="btn btn-outline text-base mt-4"
on:click={cancelConnection}
>
Cancel Request
</button>
</div>
</div>
</div>
</div>