From 16b9a2b06e603754bb86e3dcf2bf47996001f2c2 Mon Sep 17 00:00:00 2001 From: liyasthomas Date: Sat, 28 Aug 2021 23:23:16 +0530 Subject: [PATCH] feat: search --- components/app/Header.vue | 16 +-- components/app/Lunr.vue | 229 +++++++++++++++++++++++++++++++++++ components/app/Search.vue | 34 +++--- components/app/Shortcuts.vue | 6 +- helpers/shortcuts.js | 147 +++++++++++++--------- package-lock.json | 15 ++- package.json | 1 + 7 files changed, 358 insertions(+), 90 deletions(-) create mode 100644 components/app/Lunr.vue diff --git a/components/app/Header.vue b/components/app/Header.vue index 8be8e3f4..927ba78e 100644 --- a/components/app/Header.vue +++ b/components/app/Header.vue @@ -20,13 +20,13 @@ class="rounded" @click.native="showInstallPrompt()" /> - + /> - + @@ -98,19 +98,19 @@ import { defineActionHandler } from "~/helpers/actions" export default defineComponent({ setup() { const showSupport = ref(false) - // const showSearch = ref(false) + const showSearch = ref(false) defineActionHandler("modals.support.toggle", () => { showSupport.value = !showSupport.value }) - // defineActionHandler("modals.search.toggle", () => { - // showSearch.value = !showSearch.value - // }) + defineActionHandler("modals.search.toggle", () => { + showSearch.value = !showSearch.value + }) return { currentUser: useReadonlyStream(currentUser$, null), showSupport, - // showSearch, + showSearch, } }, data() { diff --git a/components/app/Lunr.vue b/components/app/Lunr.vue new file mode 100644 index 00000000..3c9eee18 --- /dev/null +++ b/components/app/Lunr.vue @@ -0,0 +1,229 @@ + + + + + diff --git a/components/app/Search.vue b/components/app/Search.vue index 9f7d5a51..dfe9425b 100644 --- a/components/app/Search.vue +++ b/components/app/Search.vue @@ -18,7 +18,15 @@ pb-6 " /> +
-
+
{{ $t(map.section) }}
@@ -49,10 +54,7 @@ group hover:bg-primaryLight " - @click=" - runAction(shortcut.action) - hideModal() - " + @click="runAction(shortcut.action)" > {{ shortcut.icon }} @@ -77,7 +79,7 @@