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

View File

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

View File

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