From c3b05a72b7185112ece6e42c99e9a828c8298f04 Mon Sep 17 00:00:00 2001
From: Melonai <einebeere@gmail.com>
Date: Thu, 8 Jul 2021 23:29:20 +0200
Subject: State display for incoming and own requests

---
 assets/src/components/share/DataSelector.svelte | 40 +++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 assets/src/components/share/DataSelector.svelte

(limited to 'assets/src/components/share/DataSelector.svelte')

diff --git a/assets/src/components/share/DataSelector.svelte b/assets/src/components/share/DataSelector.svelte
new file mode 100644
index 0000000..6838a05
--- /dev/null
+++ b/assets/src/components/share/DataSelector.svelte
@@ -0,0 +1,40 @@
+<script lang="ts">
+    import { startShareConnection } from "../../network/channel/share_connection";
+
+    import data from "../../stores/data";
+
+    let value = "";
+
+    const submit = () => {
+        data.set(value);
+        startShareConnection();
+    };
+
+    // TODO: Accept data other than text.
+</script>
+
+<form on:submit|preventDefault={submit}>
+    <!-- TODO: Prettier input field -->
+    <input type="text" bind:value />
+    <input class="set-data-button" type="submit" value="Share" />
+</form>
+
+<style>
+    form {
+        display: flex;
+        flex-wrap: nowrap;
+    }
+
+    input {
+        border: none;
+        font-size: 14px;
+        color: black;
+        background-color: white;
+        padding: 10px 20px;
+        box-sizing: border-box;
+    }
+
+    .set-data-button {
+        margin-left: 0.5rem;
+    }
+</style>
-- 
cgit 1.4.1

