2019-04-11 15:54:23 +02:00
|
|
|
import SideBar, { SideBarModuleState } from './Contents/SideBar'
|
2019-04-13 12:11:11 +02:00
|
|
|
import Home, { HomeState } from './Contents/Home'
|
2019-04-14 09:42:00 +02:00
|
|
|
import Notifications, { NotificationsState } from './Contents/Notifications'
|
2019-04-14 15:51:28 +02:00
|
|
|
import Favourites, { FavouritesState } from './Contents/Favourites'
|
2019-04-14 08:48:55 +02:00
|
|
|
import Local, { LocalState } from './Contents/Local'
|
2019-04-14 09:27:11 +02:00
|
|
|
import Public, { PublicState } from './Contents/Public'
|
2019-04-14 10:44:20 +02:00
|
|
|
import Search, { SearchModuleState } from './Contents/Search'
|
2018-04-09 14:10:25 +02:00
|
|
|
import Lists from './Contents/Lists'
|
2019-04-14 13:44:48 +02:00
|
|
|
import Hashtag, { HashtagModuleState } from './Contents/Hashtag'
|
2019-04-14 10:29:36 +02:00
|
|
|
import DirectMessages, { DirectMessagesState } from './Contents/DirectMessages'
|
2019-05-12 07:34:34 +02:00
|
|
|
import FollowRequests, { FollowRequestsState } from './Contents/FollowRequests'
|
2019-04-14 10:12:20 +02:00
|
|
|
import Mentions, { MentionsState } from './Contents/Mentions'
|
2019-05-16 16:02:05 +02:00
|
|
|
import { Module, MutationTree, ActionTree } from 'vuex'
|
2019-04-11 15:54:23 +02:00
|
|
|
import { RootState } from '@/store'
|
2018-03-29 17:20:15 +02:00
|
|
|
|
2019-05-16 16:02:05 +02:00
|
|
|
export interface ContentsState {
|
|
|
|
loading: boolean
|
|
|
|
}
|
2019-04-11 15:54:23 +02:00
|
|
|
|
|
|
|
export interface ContentsModuleState extends ContentsState {
|
2019-05-12 07:34:34 +02:00
|
|
|
SideBar: SideBarModuleState
|
|
|
|
Home: HomeState
|
|
|
|
Notifications: NotificationsState
|
|
|
|
Mentions: MentionsState
|
|
|
|
DirectMessages: DirectMessagesState
|
|
|
|
Favourites: FavouritesState
|
|
|
|
Local: LocalState
|
|
|
|
Public: PublicState
|
|
|
|
Search: SearchModuleState
|
2019-04-14 13:44:48 +02:00
|
|
|
Hashtag: HashtagModuleState
|
2019-05-12 07:34:34 +02:00
|
|
|
FollowRequests: FollowRequestsState
|
2019-04-11 15:54:23 +02:00
|
|
|
}
|
|
|
|
|
2019-05-16 16:02:05 +02:00
|
|
|
const state = (): ContentsState => ({
|
|
|
|
loading: false
|
|
|
|
})
|
|
|
|
|
|
|
|
export const MUTATION_TYPES = {
|
|
|
|
CHANGE_LOADING: 'changeLoading'
|
|
|
|
}
|
|
|
|
|
|
|
|
const mutations: MutationTree<ContentsState> = {
|
|
|
|
[MUTATION_TYPES.CHANGE_LOADING]: (state, loading: boolean) => {
|
|
|
|
state.loading = loading
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const actions: ActionTree<ContentsState, RootState> = {
|
|
|
|
changeLoading: ({ commit }, loading) => {
|
|
|
|
commit(MUTATION_TYPES.CHANGE_LOADING, loading)
|
|
|
|
}
|
|
|
|
}
|
2019-04-11 15:54:23 +02:00
|
|
|
|
|
|
|
const Contents: Module<ContentsState, RootState> = {
|
2018-03-29 17:20:15 +02:00
|
|
|
namespaced: true,
|
2019-04-11 15:54:23 +02:00
|
|
|
state: state,
|
2018-03-29 17:20:15 +02:00
|
|
|
modules: {
|
|
|
|
SideBar,
|
|
|
|
Home,
|
|
|
|
Notifications,
|
|
|
|
Favourites,
|
|
|
|
Local,
|
2018-11-01 18:01:04 +01:00
|
|
|
DirectMessages,
|
2019-03-14 17:02:10 +01:00
|
|
|
Mentions,
|
2018-03-29 17:20:15 +02:00
|
|
|
Public,
|
2018-04-15 13:22:27 +02:00
|
|
|
Search,
|
2018-04-09 14:10:25 +02:00
|
|
|
Lists,
|
2019-05-12 07:34:34 +02:00
|
|
|
Hashtag,
|
|
|
|
FollowRequests
|
2019-05-16 16:02:05 +02:00
|
|
|
},
|
|
|
|
mutations: mutations,
|
|
|
|
actions: actions
|
2018-03-29 17:20:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export default Contents
|