diff options
Diffstat (limited to 'src/components/lists_menu')
| -rw-r--r-- | src/components/lists_menu/lists_menu_content.js | 32 | ||||
| -rw-r--r-- | src/components/lists_menu/lists_menu_content.vue | 16 |
2 files changed, 18 insertions, 30 deletions
diff --git a/src/components/lists_menu/lists_menu_content.js b/src/components/lists_menu/lists_menu_content.js index 37e7868c..99fea0f0 100644 --- a/src/components/lists_menu/lists_menu_content.js +++ b/src/components/lists_menu/lists_menu_content.js @@ -1,28 +1,26 @@ import { mapState } from 'vuex' -import { library } from '@fortawesome/fontawesome-svg-core' -import { - faUsers, - faGlobe, - faBookmark, - faEnvelope, - faHome -} from '@fortawesome/free-solid-svg-icons' +import NavigationEntry from 'src/components/navigation/navigation_entry.vue' -library.add( - faUsers, - faGlobe, - faBookmark, - faEnvelope, - faHome -) +export const getListEntries = state => state.lists.allLists.map(list => ({ + name: 'list-' + list.id, + routeObject: { name: 'lists-timeline', params: { id: list.id } }, + labelRaw: list.title, + iconLetter: list.title[0] +})) -const ListsMenuContent = { +export const ListsMenuContent = { + props: [ + 'showPin' + ], created () { this.$store.dispatch('startFetchingLists') }, + components: { + NavigationEntry + }, computed: { ...mapState({ - lists: state => state.lists.allLists, + lists: getListEntries, currentUser: state => state.users.currentUser, privateMode: state => state.instance.private, federating: state => state.instance.federating diff --git a/src/components/lists_menu/lists_menu_content.vue b/src/components/lists_menu/lists_menu_content.vue index e910d6eb..9c58b092 100644 --- a/src/components/lists_menu/lists_menu_content.vue +++ b/src/components/lists_menu/lists_menu_content.vue @@ -1,17 +1,7 @@ <template> - <ul> - <li - v-for="list in lists.slice().reverse()" - :key="list.id" - > - <router-link - class="menu-item" - :to="{ name: 'lists-timeline', params: { id: list.id } }" - > - {{ list.title }} - </router-link> - </li> - </ul> +<ul> + <NavigationEntry v-for="item in lists" :key="item.name" :show-pin="showPin" :item="item" /> +</ul> </template> <script src="./lists_menu_content.js"></script> |
