From 21d1f557f64cceda54755e2817d4799f1dbbea4f Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Fri, 3 Jul 2020 12:56:31 +0300 Subject: [PATCH] change styles for the dropdown, make things work nicely on mobile --- src/App.vue | 2 +- src/components/nav_panel/nav_panel.js | 26 +++- src/components/nav_panel/nav_panel.vue | 5 +- src/components/popover/popover.js | 6 +- src/components/popover/popover.vue | 5 +- src/components/side_drawer/side_drawer.vue | 53 +++---- .../status_popover/status_popover.vue | 2 +- src/components/timeline/timeline.vue | 11 ++ src/components/timeline_menu/timeline_menu.js | 14 ++ .../timeline_menu/timeline_menu.vue | 140 ++++++++++++++++-- src/i18n/de.json | 2 +- src/i18n/en.json | 2 +- src/i18n/fi.json | 2 +- 13 files changed, 204 insertions(+), 66 deletions(-) diff --git a/src/App.vue b/src/App.vue index 7b9ad3dc..cad25ba1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -112,7 +112,7 @@ {{ $t("login.hint") }} - + diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js index 8f7edb7f..eda01d35 100644 --- a/src/components/nav_panel/nav_panel.js +++ b/src/components/nav_panel/nav_panel.js @@ -1,18 +1,30 @@ import { mapState } from 'vuex' +const timelineRoutes = [ + 'friends', + 'dms', + 'public-timeline', + 'public-external-timeline' +] + const NavPanel = { created () { if (this.currentUser && this.currentUser.locked) { this.$store.dispatch('startFetchingFollowRequests') } }, - computed: mapState({ - currentUser: state => state.users.currentUser, - chat: state => state.chat.channel, - followRequestCount: state => state.api.followRequests.length, - privateMode: state => state.instance.private, - federating: state => state.instance.federating - }) + computed: { + onTimelineRoute () { + return timelineRoutes.includes(this.$route.name) + }, + ...mapState({ + currentUser: state => state.users.currentUser, + chat: state => state.chat.channel, + followRequestCount: state => state.api.followRequests.length, + privateMode: state => state.instance.private, + federating: state => state.instance.federating + }) + } } export default NavPanel diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue index ed70f019..1622eafa 100644 --- a/src/components/nav_panel/nav_panel.vue +++ b/src/components/nav_panel/nav_panel.vue @@ -3,7 +3,10 @@
  • - + {{ $t("nav.timeline") }}
  • diff --git a/src/components/popover/popover.js b/src/components/popover/popover.js index a40a9195..695f73b9 100644 --- a/src/components/popover/popover.js +++ b/src/components/popover/popover.js @@ -18,7 +18,9 @@ const Popover = { // Takes a x/y object and tells how many pixels to offset from // anchor point on either axis offset: Object, - // Additional styles you may want for the popover container + // Replaces the classes you may want for the popover container. + // Use 'popover-default' in addition to get the default popover + // styles with your custom class. popoverClass: String }, data () { @@ -106,7 +108,7 @@ const Popover = { // single translate or translate3d resulted in blurry text. this.styles = { opacity: 1, - transform: `translateX(${Math.floor(translateX)}px) translateY(${Math.floor(translateY)}px)` + transform: `translateX(${Math.round(translateX)}px) translateY(${Math.round(translateY)}px)` } }, showPopover () { diff --git a/src/components/popover/popover.vue b/src/components/popover/popover.vue index a271cb1b..5c99c509 100644 --- a/src/components/popover/popover.vue +++ b/src/components/popover/popover.vue @@ -14,7 +14,7 @@ ref="content" :style="styles" class="popover" - :class="popoverClass" + :class="popoverClass || 'popover-default'" >
-
  • + + {{ $t("nav.public_tl") }} + +
  • +
+
    +
  • + + {{ $t("nav.interactions") }} + +
  • +
  • @@ -80,23 +77,7 @@
  • - - {{ $t("nav.public_tl") }} - -
  • -
  • - - {{ $t("nav.twkn") }} - -
  • -
  • diff --git a/src/components/status_popover/status_popover.vue b/src/components/status_popover/status_popover.vue index f5948207..2a8503e8 100644 --- a/src/components/status_popover/status_popover.vue +++ b/src/components/status_popover/status_popover.vue @@ -1,7 +1,7 @@