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