2016-10-28 03:01:48 +11:00
|
|
|
import UserPanel from './components/user_panel/user_panel.vue'
|
2016-11-07 06:11:23 +11:00
|
|
|
import NavPanel from './components/nav_panel/nav_panel.vue'
|
2016-11-28 05:44:56 +11:00
|
|
|
import Notifications from './components/notifications/notifications.vue'
|
2017-05-13 02:54:12 +10:00
|
|
|
import UserFinder from './components/user_finder/user_finder.vue'
|
2018-02-04 02:27:33 +11:00
|
|
|
import InstanceSpecificPanel from './components/instance_specific_panel/instance_specific_panel.vue'
|
2018-01-27 01:11:34 +11:00
|
|
|
import ChatPanel from './components/chat_panel/chat_panel.vue'
|
2016-10-27 04:03:55 +11:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'app',
|
|
|
|
components: {
|
2016-11-07 06:11:23 +11:00
|
|
|
UserPanel,
|
2016-11-28 05:44:56 +11:00
|
|
|
NavPanel,
|
2017-05-13 02:54:12 +10:00
|
|
|
Notifications,
|
2018-01-27 01:11:34 +11:00
|
|
|
UserFinder,
|
2018-02-04 02:27:33 +11:00
|
|
|
ChatPanel,
|
|
|
|
InstanceSpecificPanel
|
2016-11-04 02:58:32 +11:00
|
|
|
},
|
2017-01-18 03:27:39 +11:00
|
|
|
data: () => ({
|
|
|
|
mobileActivePanel: 'timeline'
|
|
|
|
}),
|
2016-11-04 02:58:32 +11:00
|
|
|
computed: {
|
2016-11-28 05:44:56 +11:00
|
|
|
currentUser () { return this.$store.state.users.currentUser },
|
2017-02-17 02:59:06 +11:00
|
|
|
background () {
|
|
|
|
return this.currentUser.background_image || this.$store.state.config.background
|
|
|
|
},
|
2017-02-17 03:44:36 +11:00
|
|
|
logoStyle () { return { 'background-image': `url(${this.$store.state.config.logo})` } },
|
2017-02-17 02:59:06 +11:00
|
|
|
style () { return { 'background-image': `url(${this.background})` } },
|
2018-01-27 01:11:34 +11:00
|
|
|
sitename () { return this.$store.state.config.name },
|
2018-02-04 10:36:10 +11:00
|
|
|
chat () { return this.$store.state.chat.channel.state === 'joined' },
|
2018-02-04 02:27:33 +11:00
|
|
|
showInstanceSpecificPanel () { return this.$store.state.config.showInstanceSpecificPanel}
|
2017-01-18 03:27:39 +11:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
activatePanel (panelName) {
|
|
|
|
this.mobileActivePanel = panelName
|
2017-02-19 07:55:16 +11:00
|
|
|
},
|
|
|
|
scrollToTop () {
|
|
|
|
window.scrollTo(0, 0)
|
2017-07-02 20:25:34 +10:00
|
|
|
},
|
|
|
|
logout () {
|
|
|
|
this.$store.dispatch('logout')
|
2017-01-18 03:27:39 +11:00
|
|
|
}
|
2016-10-27 04:03:55 +11:00
|
|
|
}
|
|
|
|
}
|