biome format --write
This commit is contained in:
parent
8372348148
commit
9262e803ec
415 changed files with 54076 additions and 17419 deletions
|
|
@ -1,7 +1,15 @@
|
|||
import { mapState } from 'vuex'
|
||||
import { mapState as mapPiniaState } from 'pinia'
|
||||
import { TIMELINES, ROOT_ITEMS, routeTo } from 'src/components/navigation/navigation.js'
|
||||
import { getBookmarkFolderEntries, getListEntries, filterNavigation } from 'src/components/navigation/filter.js'
|
||||
import {
|
||||
TIMELINES,
|
||||
ROOT_ITEMS,
|
||||
routeTo,
|
||||
} from 'src/components/navigation/navigation.js'
|
||||
import {
|
||||
getBookmarkFolderEntries,
|
||||
getListEntries,
|
||||
filterNavigation,
|
||||
} from 'src/components/navigation/filter.js'
|
||||
|
||||
import StillImage from 'src/components/still-image/still-image.vue'
|
||||
|
||||
|
|
@ -16,7 +24,7 @@ import {
|
|||
faBell,
|
||||
faInfoCircle,
|
||||
faStream,
|
||||
faList
|
||||
faList,
|
||||
} from '@fortawesome/free-solid-svg-icons'
|
||||
import { useListsStore } from 'src/stores/lists'
|
||||
import { useAnnouncementsStore } from 'src/stores/announcements'
|
||||
|
|
@ -33,72 +41,74 @@ library.add(
|
|||
faBell,
|
||||
faInfoCircle,
|
||||
faStream,
|
||||
faList
|
||||
faList,
|
||||
)
|
||||
|
||||
const NavPanel = {
|
||||
props: ['limit'],
|
||||
methods: {
|
||||
getRouteTo (item) {
|
||||
getRouteTo(item) {
|
||||
return routeTo(item, this.currentUser)
|
||||
}
|
||||
},
|
||||
},
|
||||
components: {
|
||||
StillImage
|
||||
StillImage,
|
||||
},
|
||||
computed: {
|
||||
getters () {
|
||||
getters() {
|
||||
return this.$store.getters
|
||||
},
|
||||
...mapPiniaState(useListsStore, {
|
||||
lists: getListEntries
|
||||
lists: getListEntries,
|
||||
}),
|
||||
...mapPiniaState(useAnnouncementsStore, {
|
||||
supportsAnnouncements: store => store.supportsAnnouncements
|
||||
supportsAnnouncements: (store) => store.supportsAnnouncements,
|
||||
}),
|
||||
...mapPiniaState(useBookmarkFoldersStore, {
|
||||
bookmarks: getBookmarkFolderEntries,
|
||||
}),
|
||||
...mapPiniaState(useServerSideStorageStore, {
|
||||
pinnedItems: store => new Set(store.prefsStorage.collections.pinnedNavItems)
|
||||
pinnedItems: (store) =>
|
||||
new Set(store.prefsStorage.collections.pinnedNavItems),
|
||||
}),
|
||||
...mapState({
|
||||
currentUser: state => state.users.currentUser,
|
||||
followRequestCount: state => state.api.followRequests.length,
|
||||
privateMode: state => state.instance.private,
|
||||
federating: state => state.instance.federating,
|
||||
pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable,
|
||||
bubbleTimeline: state => state.instance.localBubbleInstances.length > 0
|
||||
currentUser: (state) => state.users.currentUser,
|
||||
followRequestCount: (state) => state.api.followRequests.length,
|
||||
privateMode: (state) => state.instance.private,
|
||||
federating: (state) => state.instance.federating,
|
||||
pleromaChatMessagesAvailable: (state) =>
|
||||
state.instance.pleromaChatMessagesAvailable,
|
||||
bubbleTimeline: (state) => state.instance.localBubbleInstances.length > 0,
|
||||
}),
|
||||
pinnedList () {
|
||||
pinnedList() {
|
||||
if (!this.currentUser) {
|
||||
return filterNavigation([
|
||||
{ ...TIMELINES.public, name: 'public' },
|
||||
{ ...TIMELINES.twkn, name: 'twkn' },
|
||||
{ ...ROOT_ITEMS.about, name: 'about' }
|
||||
],
|
||||
{
|
||||
hasChats: this.pleromaChatMessagesAvailable,
|
||||
hasAnnouncements: this.supportsAnnouncements,
|
||||
isFederating: this.federating,
|
||||
isPrivate: this.privateMode,
|
||||
currentUser: this.currentUser,
|
||||
supportsBubbleTimeline: this.bubbleTimeline,
|
||||
supportsBookmarkFolders: this.bookmarks
|
||||
})
|
||||
return filterNavigation(
|
||||
[
|
||||
{ ...TIMELINES.public, name: 'public' },
|
||||
{ ...TIMELINES.twkn, name: 'twkn' },
|
||||
{ ...ROOT_ITEMS.about, name: 'about' },
|
||||
],
|
||||
{
|
||||
hasChats: this.pleromaChatMessagesAvailable,
|
||||
hasAnnouncements: this.supportsAnnouncements,
|
||||
isFederating: this.federating,
|
||||
isPrivate: this.privateMode,
|
||||
currentUser: this.currentUser,
|
||||
supportsBubbleTimeline: this.bubbleTimeline,
|
||||
supportsBookmarkFolders: this.bookmarks,
|
||||
},
|
||||
)
|
||||
}
|
||||
return filterNavigation(
|
||||
[
|
||||
...Object
|
||||
.entries({ ...TIMELINES })
|
||||
...Object.entries({ ...TIMELINES })
|
||||
.filter(([k]) => this.pinnedItems.has(k))
|
||||
.map(([k, v]) => ({ ...v, name: k })),
|
||||
...this.lists.filter((k) => this.pinnedItems.has(k.name)),
|
||||
...this.bookmarks.filter((k) => this.pinnedItems.has(k.name)),
|
||||
...Object
|
||||
.entries({ ...ROOT_ITEMS })
|
||||
...Object.entries({ ...ROOT_ITEMS })
|
||||
.filter(([k]) => this.pinnedItems.has(k))
|
||||
.map(([k, v]) => ({ ...v, name: k }))
|
||||
.map(([k, v]) => ({ ...v, name: k })),
|
||||
],
|
||||
{
|
||||
hasChats: this.pleromaChatMessagesAvailable,
|
||||
|
|
@ -107,11 +117,11 @@ const NavPanel = {
|
|||
supportsBookmarkFolders: this.bookmarks,
|
||||
isFederating: this.federating,
|
||||
isPrivate: this.privateMode,
|
||||
currentUser: this.currentUser
|
||||
}
|
||||
currentUser: this.currentUser,
|
||||
},
|
||||
).slice(0, this.limit)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default NavPanel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue