From d4e7c7c72086d72b0e056ebecd99ecb071da0739 Mon Sep 17 00:00:00 2001
From: mat <github@matdoes.dev>
Date: Tue, 22 Feb 2022 19:27:01 +0000
Subject: split the search bar into its own component

---
 src/lib/SearchUser.svelte | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 src/lib/SearchUser.svelte

(limited to 'src/lib/SearchUser.svelte')

diff --git a/src/lib/SearchUser.svelte b/src/lib/SearchUser.svelte
new file mode 100644
index 0000000..3c841ce
--- /dev/null
+++ b/src/lib/SearchUser.svelte
@@ -0,0 +1,27 @@
+<script lang="ts">
+	import { goto } from '$app/navigation'
+
+	export let value = ''
+</script>
+
+<form
+	action="/player"
+	method="post"
+	class="user-form"
+	on:submit={e => {
+		goto(`/player/${value}`)
+		e.preventDefault()
+	}}
+>
+	<input
+		type="text"
+		placeholder="Enter username"
+		name="user-search"
+		autocomplete="off"
+		autocorrect="off"
+		autocapitalize="off"
+		spellcheck="false"
+		aria-label="Enter username"
+		bind:value
+	/>
+</form>
-- 
cgit 

