From b37a0f4f23fcb81353a98d45f55cc760b84c5d0f Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Tue, 13 Nov 2018 20:34:56 +0100 Subject: [PATCH] Add direct message tab. --- src/boot/after_store.js | 2 ++ src/components/dm_timeline/dm_timeline.js | 14 ++++++++++++++ src/components/dm_timeline/dm_timeline.vue | 5 +++++ src/components/nav_panel/nav_panel.js | 3 +++ src/components/nav_panel/nav_panel.vue | 5 +++++ src/i18n/en.json | 1 + src/modules/statuses.js | 3 ++- 7 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/components/dm_timeline/dm_timeline.js create mode 100644 src/components/dm_timeline/dm_timeline.vue diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 6b8aef7f..90f25302 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -8,6 +8,7 @@ import FriendsTimeline from '../components/friends_timeline/friends_timeline.vue import TagTimeline from '../components/tag_timeline/tag_timeline.vue' import ConversationPage from '../components/conversation-page/conversation-page.vue' import Mentions from '../components/mentions/mentions.vue' +import DMs from '../components/dm_timeline/dm_timeline.vue' import UserProfile from '../components/user_profile/user_profile.vue' import Settings from '../components/settings/settings.vue' import Registration from '../components/registration/registration.vue' @@ -88,6 +89,7 @@ const afterStoreSetup = ({store, i18n}) => { { name: 'conversation', path: '/notice/:id', component: ConversationPage, meta: { dontScroll: true } }, { name: 'user-profile', path: '/users/:id', component: UserProfile }, { name: 'mentions', path: '/:username/mentions', component: Mentions }, + { name: 'dms', path: '/:username/dms', component: DMs }, { name: 'settings', path: '/settings', component: Settings }, { name: 'registration', path: '/registration', component: Registration }, { name: 'registration', path: '/registration/:token', component: Registration }, diff --git a/src/components/dm_timeline/dm_timeline.js b/src/components/dm_timeline/dm_timeline.js new file mode 100644 index 00000000..8b5393a9 --- /dev/null +++ b/src/components/dm_timeline/dm_timeline.js @@ -0,0 +1,14 @@ +import Timeline from '../timeline/timeline.vue' + +const DMs = { + computed: { + timeline () { + return this.$store.state.statuses.timelines.dms + } + }, + components: { + Timeline + } +} + +export default DMs diff --git a/src/components/dm_timeline/dm_timeline.vue b/src/components/dm_timeline/dm_timeline.vue new file mode 100644 index 00000000..f03da4d3 --- /dev/null +++ b/src/components/dm_timeline/dm_timeline.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js index ea5d7ea4..caab8102 100644 --- a/src/components/nav_panel/nav_panel.js +++ b/src/components/nav_panel/nav_panel.js @@ -5,6 +5,9 @@ const NavPanel = { }, chat () { return this.$store.state.chat.channel + }, + showDMs () { + return this.$store.state.instance.scopeOptionsEnabled } } } diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue index 0b188f9a..950825b7 100644 --- a/src/components/nav_panel/nav_panel.vue +++ b/src/components/nav_panel/nav_panel.vue @@ -12,6 +12,11 @@ {{ $t("nav.mentions") }} +
  • + + {{ $t("nav.dms") }} + +
  • {{ $t("nav.friend_requests") }} diff --git a/src/i18n/en.json b/src/i18n/en.json index 036231bf..cadbaf95 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -32,6 +32,7 @@ "chat": "Local Chat", "friend_requests": "Follow Requests", "mentions": "Mentions", + "dms": "Direct Messages", "public_tl": "Public Timeline", "timeline": "Timeline", "twkn": "The Whole Known Network" diff --git a/src/modules/statuses.js b/src/modules/statuses.js index f980f53d..89e00119 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -41,7 +41,8 @@ export const defaultState = { own: emptyTl(), publicAndExternal: emptyTl(), friends: emptyTl(), - tag: emptyTl() + tag: emptyTl(), + dms: emptyTl() } }