Move the filter menu into the index page

A filter makes sense only on the news feed page in my opinion. As a
comparison: The way how full text search is implemented makes sense in
the menu bar, which is always visible. Why? The search results are shown
in a popover. Therefore those are different from the news feed. The news
feed however is only visible on the index page. Therefore I believe, it
makes sense to put the filter menu there and only there.
This commit is contained in:
Robert Schäfer 2019-05-28 20:51:14 +02:00
parent f8c0335712
commit f3b088f862
3 changed files with 21 additions and 24 deletions

View File

@ -1,26 +1,21 @@
<template> <template>
<dropdown> <ds-card>
<a <ds-form>
slot="default" <ds-radio buttons v-model="filter" label="Filter" :options="['friends', 'friends-of-a-friend', 'all']" />
class="filter-menu" </ds-form>
href="#" </ds-card>
>
<ds-icon
name="filter"
/>
Filter
</a>
</dropdown>
</template> </template>
<script> <script>
export default {} import Dropdown from '~/components/Dropdown'
</script> export default {
components: {
<style> Dropdown
.filter-menu { },
display: flex; data() {
align-items: center; return {
height: 100%; filter: 'all'
}
}
} }
</style> </script>

View File

@ -19,7 +19,6 @@
/> />
</div> </div>
<div class="main-navigation-right"> <div class="main-navigation-right">
<filter-menu />
<no-ssr> <no-ssr>
<locale-switch class="topbar-locale-switch" placement="bottom" offset="23" /> <locale-switch class="topbar-locale-switch" placement="bottom" offset="23" />
</no-ssr> </no-ssr>
@ -99,7 +98,6 @@ import Modal from '~/components/Modal'
import NotificationMenu from '~/components/notifications/NotificationMenu' import NotificationMenu from '~/components/notifications/NotificationMenu'
import Dropdown from '~/components/Dropdown' import Dropdown from '~/components/Dropdown'
import HcAvatar from '~/components/Avatar/Avatar.vue' import HcAvatar from '~/components/Avatar/Avatar.vue'
import FilterMenu from '~/components/FilterMenu/FilterMenu.vue'
import seo from '~/mixins/seo' import seo from '~/mixins/seo'
export default { export default {
@ -110,7 +108,6 @@ export default {
Modal, Modal,
NotificationMenu, NotificationMenu,
HcAvatar, HcAvatar,
FilterMenu,
}, },
mixins: [seo], mixins: [seo],
data() { data() {

View File

@ -1,5 +1,8 @@
<template> <template>
<div> <div>
<ds-flex-item>
<filter-menu />
</ds-flex-item>
<ds-flex v-if="Post && Post.length" :width="{ base: '100%' }" gutter="base"> <ds-flex v-if="Post && Post.length" :width="{ base: '100%' }" gutter="base">
<hc-post-card <hc-post-card
v-for="(post, index) in uniq(Post)" v-for="(post, index) in uniq(Post)"
@ -24,6 +27,7 @@
</template> </template>
<script> <script>
import FilterMenu from '~/components/FilterMenu/FilterMenu.vue'
import gql from 'graphql-tag' import gql from 'graphql-tag'
import uniqBy from 'lodash/uniqBy' import uniqBy from 'lodash/uniqBy'
import HcPostCard from '~/components/PostCard' import HcPostCard from '~/components/PostCard'
@ -31,6 +35,7 @@ import HcLoadMore from '~/components/LoadMore.vue'
export default { export default {
components: { components: {
FilterMenu,
HcPostCard, HcPostCard,
HcLoadMore, HcLoadMore,
}, },