diff options
| author | Henry Jameson <me@hjkos.com> | 2022-08-11 21:00:27 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2022-08-11 21:00:27 +0300 |
| commit | 77127e2a588abb5bf329506ff7e006021b086e90 (patch) | |
| tree | 77e89d3e89fe1cc687bf7c3044dbe63732c0030a /src/components/lists_menu | |
| parent | 04f8c2d29d0e9c5e0341b067e5e783b90c95064b (diff) | |
you can now pin lists
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> |
