@@ -5,6 +5,7 @@ import { categories, categorySearch, favoritedCollections, filteredCollections,
55const searchbar = ref <{ input: HTMLElement }>()
66
77const categorized = ref (getIconList (categorySearch .value ))
8+ const availableCategories = computed (() => categorized .value .filter (c => c .collections .length > 0 ))
89
910let categorizeDebounceTimer: NodeJS .Timeout | null = null
1011
@@ -55,7 +56,8 @@ onKeyStroke('/', (e) => {
5556})
5657onMounted (() => searchbar .value ?.input .focus ())
5758
58- const isMacOS = navigator .platform .toUpperCase ().includes (' MAC' )
59+ const platform = (navigator as any ).userAgentData ?.platform || navigator .platform || ' '
60+ const isMacOS = platform .toUpperCase ().includes (' MAC' )
5961
6062function onKeydown(e : KeyboardEvent ) {
6163 if (e .key === ' Enter' && (e .metaKey || e .ctrlKey )) {
@@ -93,11 +95,11 @@ function onKeydown(e: KeyboardEvent) {
9395 </RouterLink >
9496 </div >
9597
96- <div of-y-auto >
98+ <div of-y-auto relative space-y-6 >
9799 <!-- Category listing -->
98- <template v-for =" c of categorized " :key =" c .name " >
99- <div v-if = " (c.collections).length " px4 >
100- <div px-2 op50 mt6 text-lg >
100+ <template v-for =" c of availableCategories " :key =" c .name " >
101+ <div px4 >
102+ <div px-2 text-op-50 text-lg sticky top-0 bg-base z-1 >
101103 {{ c.name }}
102104 </div >
103105 <CollectionEntries
@@ -109,12 +111,13 @@ function onKeydown(e: KeyboardEvent) {
109111 </template >
110112
111113 <div
112- v-if =" categorized.every(c => !c.collections.length) "
114+ v-if =" availableCategories.length === 0 "
113115 class =" flex flex-col flex-grow w-full py-6 justify-center items-center"
114116 >
115117 <Icon icon =" ph:x-circle-bold" class =" text-4xl mb-2 opacity-20" />
116118 <span class =" text-lg opacity-60" >There is no result corresponding to your search query.</span >
117119 </div >
120+
118121 <Footer />
119122 </div >
120123 </div >
0 commit comments