From 7ee31461f841a70b9c2b73dddd595975d58b4b69 Mon Sep 17 00:00:00 2001 From: Chris Hayes Date: Sun, 11 Aug 2024 03:22:46 -0400 Subject: [PATCH] feat(ui): implement search page for desktop --- components/search/SearchResult.vue | 5 +- components/search/SearchResultList.vue | 39 ++++++ components/search/SearchWidget.vue | 22 +--- components/status/StatusActions.vue | 8 +- components/status/StatusActionsMore.vue | 2 +- composables/screen.ts | 1 + layouts/default.vue | 2 +- pages/[[server]]/search.vue | 152 +++++++++++++++++++++--- 8 files changed, 190 insertions(+), 41 deletions(-) create mode 100644 components/search/SearchResultList.vue diff --git a/components/search/SearchResult.vue b/components/search/SearchResult.vue index fb7d339f..42b10b66 100644 --- a/components/search/SearchResult.vue +++ b/components/search/SearchResult.vue @@ -1,9 +1,10 @@ + + diff --git a/components/search/SearchWidget.vue b/components/search/SearchWidget.vue index 2234e39f..1e4c37d1 100644 --- a/components/search/SearchWidget.vue +++ b/components/search/SearchWidget.vue @@ -4,10 +4,10 @@ const { accounts, hashtags, loading, statuses } = useSearch(query) const index = ref(0) const { t } = useI18n() -const el = ref() +const searchWidgetElem = ref() const input = ref() const router = useRouter() -const { focused } = useFocusWithin(el) +const { focused } = useFocusWithin(searchWidgetElem) defineExpose({ input, @@ -21,15 +21,6 @@ const results = computed(() => { ...hashtags.value.slice(0, 3), ...accounts.value, ...statuses.value, - - // Disable until search page is implemented - // { - // type: 'action', - // to: `/search?q=${query.value}`, - // action: { - // label: `Search for ${query.value}`, - // }, - // }, ] return results @@ -48,10 +39,8 @@ function activate() { if (query.value.length === 0) return - // Disable redirection until search page is implemented if (currentIndex === -1) { - index.value = 0 - // router.push(`/search?q=${query.value}`) + router.push(`/search?q=${query.value}`) return } @@ -63,9 +52,10 @@ function activate() {