logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: a8a82ad12f2f7b9eb8fe7a57a3a7d503c6bbe2ed
parent 1c535284334f34de5897c731f22639d45516805f
Author: HJ <30-hj@users.noreply.git.pleroma.social>
Date:   Thu,  9 Sep 2021 12:19:53 +0000

Merge branch 'showMobileNewPost' into 'develop'

New user option: Always show floating New Post button

See merge request pleroma/pleroma-fe!1395

Diffstat:

MCHANGELOG.md1+
Msrc/App.js3+++
Msrc/App.vue1+
Msrc/components/mobile_post_status_button/mobile_post_status_button.js3+++
Msrc/components/mobile_post_status_button/mobile_post_status_button.vue4++--
Msrc/components/settings_modal/tabs/general_tab.vue5+++++
Msrc/components/shout_panel/shout_panel.vue9++++++++-
Msrc/i18n/en.json1+
Msrc/modules/config.js1+
9 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Implemented user option to change sidebar position to the right side - Implemented user option to hide floating shout panel - Implemented "edit profile" button if viewing own profile which opens profile settings +- Implemented user option to always show floating New Post button (normally mobile-only) ### Fixed - Fixed follow request count showing in the wrong location in mobile view diff --git a/src/App.js b/src/App.js @@ -73,6 +73,9 @@ export default { this.$store.state.instance.instanceSpecificPanelContent }, showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel }, + shoutboxPosition () { + return this.$store.getters.mergedConfig.showNewPostButton || false + }, hideShoutbox () { return this.$store.getters.mergedConfig.hideShoutbox }, diff --git a/src/App.vue b/src/App.vue @@ -53,6 +53,7 @@ v-if="currentUser && shout && !hideShoutbox" :floating="true" class="floating-shout mobile-hidden" + :class="{ 'left': shoutboxPosition }" /> <MobilePostStatusButton /> <UserReportingModal /> diff --git a/src/components/mobile_post_status_button/mobile_post_status_button.js b/src/components/mobile_post_status_button/mobile_post_status_button.js @@ -44,6 +44,9 @@ const MobilePostStatusButton = { return this.autohideFloatingPostButton && (this.hidden || this.inputActive) }, + isPersistent () { + return !!this.$store.getters.mergedConfig.showNewPostButton + }, autohideFloatingPostButton () { return !!this.$store.getters.mergedConfig.autohideFloatingPostButton } diff --git a/src/components/mobile_post_status_button/mobile_post_status_button.vue b/src/components/mobile_post_status_button/mobile_post_status_button.vue @@ -2,7 +2,7 @@ <div v-if="isLoggedIn"> <button class="button-default new-status-button" - :class="{ 'hidden': isHidden }" + :class="{ 'hidden': isHidden, 'always-show': isPersistent }" @click="openPostForm" > <FAIcon icon="pen" /> @@ -47,7 +47,7 @@ } @media all and (min-width: 801px) { - .new-status-button { + .new-status-button:not(.always-show) { display: none; } } diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue @@ -123,6 +123,11 @@ </BooleanSetting> </li> <li> + <BooleanSetting path="alwaysShowNewPostButton"> + {{ $t('settings.always_show_post_button') }} + </BooleanSetting> + </li> + <li> <BooleanSetting path="autohideFloatingPostButton"> {{ $t('settings.autohide_floating_post_button') }} </BooleanSetting> diff --git a/src/components/shout_panel/shout_panel.vue b/src/components/shout_panel/shout_panel.vue @@ -79,12 +79,19 @@ .floating-shout { position: fixed; - right: 0px; bottom: 0px; z-index: 1000; max-width: 25em; } +.floating-shout.left { + left: 0px; +} + +.floating-shout:not(.left) { + right: 0px; +} + .shout-panel { .shout-heading { cursor: pointer; diff --git a/src/i18n/en.json b/src/i18n/en.json @@ -352,6 +352,7 @@ "hide_isp": "Hide instance-specific panel", "hide_shoutbox": "Hide instance shoutbox", "right_sidebar": "Show sidebar on the right side", + "always_show_post_button": "Always show floating New Post button", "hide_wallpaper": "Hide instance wallpaper", "preload_images": "Preload images", "use_one_click_nsfw": "Open NSFW attachments with just one click", diff --git a/src/modules/config.js b/src/modules/config.js @@ -35,6 +35,7 @@ export const defaultState = { loopVideoSilentOnly: true, streaming: false, emojiReactionsOnTimeline: true, + alwaysShowNewPostButton: false, autohideFloatingPostButton: false, pauseOnUnfocused: true, stopGifs: false,