diff options
Diffstat (limited to 'src/components/user_search')
| -rw-r--r-- | src/components/user_search/user_search.js | 49 | ||||
| -rw-r--r-- | src/components/user_search/user_search.vue | 57 |
2 files changed, 0 insertions, 106 deletions
diff --git a/src/components/user_search/user_search.js b/src/components/user_search/user_search.js deleted file mode 100644 index 5c29d8f2..00000000 --- a/src/components/user_search/user_search.js +++ /dev/null @@ -1,49 +0,0 @@ -import FollowCard from '../follow_card/follow_card.vue' -import map from 'lodash/map' - -const userSearch = { - components: { - FollowCard - }, - props: [ - 'query' - ], - data () { - return { - username: '', - userIds: [], - loading: false - } - }, - computed: { - users () { - return this.userIds.map(userId => this.$store.getters.findUser(userId)) - } - }, - mounted () { - this.search(this.query) - }, - watch: { - query (newV) { - this.search(newV) - } - }, - methods: { - newQuery (query) { - this.$router.push({ name: 'user-search', query: { query } }) - this.$refs.userSearchInput.focus() - }, - search (query) { - if (!query) { - return - } - this.loading = true - this.userIds = [] - this.$store.dispatch('searchUsers', query) - .then((res) => { this.userIds = map(res, 'id') }) - .finally(() => { this.loading = false }) - } - } -} - -export default userSearch diff --git a/src/components/user_search/user_search.vue b/src/components/user_search/user_search.vue deleted file mode 100644 index e1c6074c..00000000 --- a/src/components/user_search/user_search.vue +++ /dev/null @@ -1,57 +0,0 @@ -<template> - <div class="user-search panel panel-default"> - <div class="panel-heading"> - {{ $t('nav.user_search') }} - </div> - <div class="user-search-input-container"> - <input - ref="userSearchInput" - v-model="username" - class="user-finder-input" - :placeholder="$t('finder.find_user')" - @keyup.enter="newQuery(username)" - > - <button - class="btn search-button" - @click="newQuery(username)" - > - <i class="icon-search" /> - </button> - </div> - <div - v-if="loading" - class="text-center loading-icon" - > - <i class="icon-spin3 animate-spin" /> - </div> - <div - v-else - class="panel-body" - > - <FollowCard - v-for="user in users" - :key="user.id" - :user="user" - class="list-item" - /> - </div> - </div> -</template> - -<script src="./user_search.js"></script> - -<style lang="scss"> -.user-search-input-container { - margin: 0.5em; - display: flex; - justify-content: center; - - .search-button { - margin-left: 0.5em; - } -} - -.loading-icon { - padding: 1em; -} -</style> |
