From 98cb9abac773e8fbce94eafea1025919b6f26360 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 22 Feb 2021 16:24:04 +0200 Subject: [PATCH 1/2] Add timeline menu toggle to nav panel --- CHANGELOG.md | 2 + src/components/nav_panel/nav_panel.js | 36 ++++++---- src/components/nav_panel/nav_panel.vue | 70 +++++++++++++++---- src/components/timeline_menu/timeline_menu.js | 31 ++------ .../timeline_menu/timeline_menu.vue | 48 +------------ .../timeline_menu/timeline_menu_content.js | 29 ++++++++ .../timeline_menu/timeline_menu_content.vue | 66 +++++++++++++++++ src/i18n/en.json | 1 + 8 files changed, 183 insertions(+), 100 deletions(-) create mode 100644 src/components/timeline_menu/timeline_menu_content.js create mode 100644 src/components/timeline_menu/timeline_menu_content.vue diff --git a/CHANGELOG.md b/CHANGELOG.md index cf4be7da..15e63d00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - Display 'people voted' instead of 'votes' for multi-choice polls +- Changed the "Timelines" link in side panel to toggle show all timeline options inside the panel +- Renamed "Timeline" to "Home Timeline" to be more clear ## [2.2.3] - 2021-01-18 ### Added diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js index 81d49cc2..37bcb409 100644 --- a/src/components/nav_panel/nav_panel.js +++ b/src/components/nav_panel/nav_panel.js @@ -1,4 +1,4 @@ -import { timelineNames } from '../timeline_menu/timeline_menu.js' +import TimelineMenuContent from '../timeline_menu/timeline_menu_content.vue' import { mapState, mapGetters } from 'vuex' import { library } from '@fortawesome/fontawesome-svg-core' @@ -7,10 +7,12 @@ import { faGlobe, faBookmark, faEnvelope, - faHome, + faChevronDown, + faChevronUp, faComments, faBell, - faInfoCircle + faInfoCircle, + faStream } from '@fortawesome/free-solid-svg-icons' library.add( @@ -18,10 +20,12 @@ library.add( faGlobe, faBookmark, faEnvelope, - faHome, + faChevronDown, + faChevronUp, faComments, faBell, - faInfoCircle + faInfoCircle, + faStream ) const NavPanel = { @@ -30,16 +34,20 @@ const NavPanel = { this.$store.dispatch('startFetchingFollowRequests') } }, + components: { + TimelineMenuContent + }, + data () { + return { + showTimelines: false + } + }, + methods: { + toggleTimelines () { + this.showTimelines = !this.showTimelines + } + }, computed: { - onTimelineRoute () { - return !!timelineNames()[this.$route.name] - }, - timelinesRoute () { - if (this.$store.state.interface.lastTimeline) { - return this.$store.state.interface.lastTimeline - } - return this.currentUser ? 'friends' : 'public-timeline' - }, ...mapState({ currentUser: state => state.users.currentUser, followRequestCount: state => state.api.followRequests.length, diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue index 0c83d0fe..7ae7b1d6 100644 --- a/src/components/nav_panel/nav_panel.vue +++ b/src/components/nav_panel/nav_panel.vue @@ -3,19 +3,33 @@
state.users.currentUser, + privateMode: state => state.instance.private, + federating: state => state.instance.federating + }) + } +} + +export default TimelineMenuContent diff --git a/src/components/timeline_menu/timeline_menu_content.vue b/src/components/timeline_menu/timeline_menu_content.vue new file mode 100644 index 00000000..bed1b679 --- /dev/null +++ b/src/components/timeline_menu/timeline_menu_content.vue @@ -0,0 +1,66 @@ + + + diff --git a/src/i18n/en.json b/src/i18n/en.json index 4cc2af0e..45280eff 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -124,6 +124,7 @@ "dms": "Direct Messages", "public_tl": "Public Timeline", "timeline": "Timeline", + "home_timeline": "Home Timeline", "twkn": "Known Network", "bookmarks": "Bookmarks", "user_search": "User Search", From 92a9ce67c595bf54a95cca917ba07772bec0f041 Mon Sep 17 00:00:00 2001 From: Shpuld Shpludson Date: Sat, 27 Feb 2021 18:23:11 +0000 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a599ddb..a294c106 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added - Added reason field for registration when approval is required ->>>>>>> develop ## [2.2.3] - 2021-01-18 ### Added