Skip to content

Commit

Permalink
feat(ui): add no results found state
Browse files Browse the repository at this point in the history
  • Loading branch information
sentriz committed Jul 13, 2021
1 parent ad03b6d commit f9f1652
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/components/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</div>
</div>
<loading-spinner v-if="loading" />
<search-no-results v-else-if="respPages.length === 0" />
</div>
<search-sidebar :hash="sidebarHash" />
<uploader-clipboard />
Expand All @@ -37,6 +38,7 @@ import SearchFilter from './SearchFilter.vue'
import LoadingSpinner from './LoadingSpinner.vue'
import UploaderClipboard from './UploaderClipboard.vue'
import UploaderFile from './UploaderFile.vue'
import SearchNoResults from './SearchNoResults.vue'
import { watch, computed, onMounted, ref } from 'vue'
import type { Component } from 'vue'
Expand Down Expand Up @@ -66,7 +68,7 @@ const sidebarHash = computed(() => (route.params.hash as string) || '')
const reqQuery = ref('')
const reqPageNum = ref(0)
const reqQueryDebounced = useDebounce(reqQuery, 100)
const reqQueryDebounced = useDebounce(reqQuery, 200)
const reqPageSize = 25
type Sort = { label: string; icon: Component; field: string; order: SortOrder }
Expand Down
5 changes: 5 additions & 0 deletions frontend/components/SearchNoResults.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<div class="p-3 text-center text-gray-500 bg-gray-100 rounded">
no results found. try uploading some screenshots or adjust your search query
</div>
</template>

0 comments on commit f9f1652

Please sign in to comment.