client: remove user search from explore page

User search is now located on the general search page.
Also cleaned up other unused code.

Changelog: Removed
This commit is contained in:
Johann150 2022-11-19 19:34:25 +01:00
parent a7f3133f89
commit 33e09b9901
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -11,57 +11,19 @@
<div v-else-if="tab === 'remoteUsers'">
<XUsers origin="remote"/>
</div>
<div v-else-if="tab === 'search'">
<div class="_isolated">
<MkInput v-model="searchQuery" :debounce="true" type="search">
<template #prefix><i class="fas fa-search"></i></template>
<template #label>{{ i18n.ts.searchUser }}</template>
</MkInput>
<MkRadios v-model="searchOrigin">
<option value="combined">{{ i18n.ts.all }}</option>
<option value="local">{{ i18n.ts.local }}</option>
<option value="remote">{{ i18n.ts.remote }}</option>
</MkRadios>
</div>
<XUserList v-if="searchQuery" ref="searchEl" class="_gap" :pagination="searchPagination"/>
</div>
</div>
</MkStickyContainer>
</template>
<script lang="ts" setup>
import { computed, watch } from 'vue';
import { computed } from 'vue';
import XFeatured from './explore.featured.vue';
import XUsers from './explore.users.vue';
import MkFolder from '@/components/ui/folder.vue';
import MkInput from '@/components/form/input.vue';
import MkRadios from '@/components/form/radios.vue';
import { definePageMetadata } from '@/scripts/page-metadata';
import { i18n } from '@/i18n';
import XUserList from '@/components/user-list.vue';
const props = defineProps<{
tag?: string;
}>();
let tab = $ref('featured');
let tagsEl = $ref<InstanceType<typeof MkFolder>>();
let searchQuery = $ref(null);
let searchOrigin = $ref('combined');
watch(() => props.tag, () => {
if (tagsEl) tagsEl.toggleContent(props.tag == null);
});
const searchPagination = {
endpoint: 'users/search' as const,
limit: 10,
params: computed(() => searchQuery ? {
query: searchQuery,
origin: searchOrigin,
} : null),
};
const headerTabs = $computed(() => [{
key: 'featured',
@ -75,9 +37,6 @@ const headerTabs = $computed(() => [{
key: 'remoteUsers',
icon: 'fas fa-users',
title: i18n.ts.remote,
}, {
key: 'search',
title: i18n.ts.search,
}]);
definePageMetadata(computed(() => ({