From 07d9be692871431ace25ccd6dfaf49820833e90b Mon Sep 17 00:00:00 2001 From: Jason Henriquez Date: Sun, 22 Oct 2023 16:26:20 -0500 Subject: [PATCH 1/6] Implement styling for new subscribe button --- .../ft-subscribe-button.css | 48 +++++++++++++++++-- .../ft-subscribe-button.js | 17 +++++++ .../ft-subscribe-button.vue | 34 ++++++++++--- src/renderer/main.js | 2 + .../SubscribedChannels/SubscribedChannels.vue | 2 +- static/locales/en-US.yaml | 2 + 6 files changed, 94 insertions(+), 11 deletions(-) diff --git a/src/renderer/components/ft-subscribe-button/ft-subscribe-button.css b/src/renderer/components/ft-subscribe-button/ft-subscribe-button.css index 4d2871b3326e9..c658890de0745 100644 --- a/src/renderer/components/ft-subscribe-button/ft-subscribe-button.css +++ b/src/renderer/components/ft-subscribe-button/ft-subscribe-button.css @@ -1,8 +1,50 @@ +.buttonList { + margin: 5px; + margin-block-end: 10px; + border-radius: 4px; + block-size: fit-content; + box-shadow: 0px 1px 2px rgb(0 0 0 / 50%); + display: flex; + flex-wrap: nowrap; + /* addresses odd clipping behavior when adjusting window size*/ + background-color: var(--primary-color); +} + /* Ensures style here overrides style of .btn */ .subscribeButton.btn { - align-self: center; - block-size: 50%; - margin-block-end: 10px; min-inline-size: 150px; white-space: initial; } + +.subscribeButton.btn, .profileDropdownToggle.btn { + align-self: center; + margin-block: 0; + margin-inline: 0; +} + +.hasProfileDropdownToggle > .subscribeButton.btn { + min-inline-size: 100px; + padding-inline: 5px; + border-inline-end: 2px solid var(--primary-color-active) !important; + border-start-end-radius: 0; + border-end-end-radius: 0; + box-sizing: content-box; +} + +.hasProfileDropdownToggle > .subscribeButton.btn, .profileDropdownToggle.btn { + padding-block: 5px; + padding-inline: 6px; + box-shadow: none; + flex: auto; + block-size: 2em; +} + +.profileDropdownToggle.btn { + border-inline-start: none !important; + border-start-start-radius: 0; + border-end-start-radius: 0; + display: inline-block; + min-inline-size: 1em; + padding-inline: 10px; + box-sizing: content-box; +} diff --git a/src/renderer/components/ft-subscribe-button/ft-subscribe-button.js b/src/renderer/components/ft-subscribe-button/ft-subscribe-button.js index ba07a6a4a9547..ed35bfc7c3b43 100644 --- a/src/renderer/components/ft-subscribe-button/ft-subscribe-button.js +++ b/src/renderer/components/ft-subscribe-button/ft-subscribe-button.js @@ -25,12 +25,21 @@ export default defineComponent({ type: String, required: true }, + hideProfileDropdownToggle: { + type: Boolean, + default: false + }, subscriptionCountText: { default: '', type: String, required: false } }, + data: function () { + return { + isProfileDropdownOpen: false + } + }, computed: { profileList: function () { return this.$store.getters.getProfileList @@ -60,6 +69,10 @@ export default defineComponent({ subscribedValue += ' ' + this.subscriptionCountText } return subscribedValue + }, + + isProfileDropdownEnabled: function () { + return !this.hideProfileDropdownToggle && this.profileList.length > 1 } }, @@ -124,6 +137,10 @@ export default defineComponent({ } }, + toggleProfileDropdown: function() { + this.isProfileDropdownOpen = !this.isProfileDropdownOpen + }, + unsubscribe: function(profile, channelId) { const parsedProfile = deepCopy(profile) const index = parsedProfile.subscriptions.findIndex((channel) => { diff --git a/src/renderer/components/ft-subscribe-button/ft-subscribe-button.vue b/src/renderer/components/ft-subscribe-button/ft-subscribe-button.vue index 11bf54e7e66c6..2aea54f752c6a 100644 --- a/src/renderer/components/ft-subscribe-button/ft-subscribe-button.vue +++ b/src/renderer/components/ft-subscribe-button/ft-subscribe-button.vue @@ -1,11 +1,31 @@