From c499946400c775f311d52236d9d1fef3f19a68ff Mon Sep 17 00:00:00 2001
From: Adam Carpenter <atc@53hor.net>
Date: Thu, 30 Apr 2020 21:31:30 -0400
Subject: moved search into InventorySearch and started work on filters;
 updated quantity display

---
 iridescence/src/components/InventorySearch.vue | 36 ++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 iridescence/src/components/InventorySearch.vue

(limited to 'iridescence/src/components/InventorySearch.vue')

diff --git a/iridescence/src/components/InventorySearch.vue b/iridescence/src/components/InventorySearch.vue
new file mode 100644
index 0000000..fbcaabb
--- /dev/null
+++ b/iridescence/src/components/InventorySearch.vue
@@ -0,0 +1,36 @@
+<template>
+  <div id="inventorySearch">
+    <input
+      class="input is-primary is-medium"
+      type="text"
+      placeholder="Find something in particular..."
+      v-model.trim="term"
+      @input="updateSearch"
+      autofocus
+    />
+    <content class="has-text-centered" v-if="noResults">
+      <p>We couldn't find anything like that...</p>
+    </content>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "InventorySearch",
+  data() {
+    return {
+      term: ""
+    };
+  },
+  computed: {
+    noResults() {
+      return !this.$store.getters.inventory.length;
+    }
+  },
+  methods: {
+    updateSearch() {
+      this.$store.commit("filterTerm", this.term);
+    }
+  }
+};
+</script>
-- 
cgit v1.2.3

