From 5e3d859b572ee3a83b91425956a7cd4c099a7325 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 27 Jun 2021 12:46:00 -0500 Subject: [PATCH] Subscriptions: move subscribe button to top-right corner of banner --- .../features/account/components/header.js | 5 +- .../ui/components/subscription_button.js | 22 ++++++--- app/styles/components/account-header.scss | 49 ++++++++++--------- 3 files changed, 44 insertions(+), 32 deletions(-) diff --git a/app/soapbox/features/account/components/header.js b/app/soapbox/features/account/components/header.js index fa9708bdb..aac0186c4 100644 --- a/app/soapbox/features/account/components/header.js +++ b/app/soapbox/features/account/components/header.js @@ -279,6 +279,10 @@ class Header extends ImmutablePureComponent { {info} +
+ +
+ @@ -335,7 +339,6 @@ class Header extends ImmutablePureComponent { }
- {me && account.get('id') !== me && account.getIn(['pleroma', 'accepts_chat_messages'], false) === true && ); + if (requested || following) { + return ( + + ); } - return subscriptionButton; + return null; } } diff --git a/app/styles/components/account-header.scss b/app/styles/components/account-header.scss index ec0b6f2e4..55386987a 100644 --- a/app/styles/components/account-header.scss +++ b/app/styles/components/account-header.scss @@ -15,6 +15,31 @@ z-index: 1; } + &__subscribe { + position: absolute; + top: 10px; + right: 10px; + z-index: 1; + + .subscription-button { + color: var(--primary-text-color); + margin-bottom: 4px; + display: block; + vertical-align: top; + background-color: var(--background-color); + text-transform: uppercase; + font-size: 13px; + font-weight: 500; + padding: 4px; + border-radius: 4px; + opacity: 0.7; + + &:not(.button-active) i.fa { + margin: 0; + } + } + } + &__image { overflow: hidden; height: 350px; @@ -150,30 +175,6 @@ .button { margin-right: 10px; } - .subscription-button { - padding: 0; - height: 36px; - line-height: 36px; - width: 36px; - margin-right: 10px; - font-size: 20px; - text-align: center; - border: 1px solid var(--brand-color); - background: transparent; - color: var(--primary-text-color); - - &:hover, - &.active { - border-color: $error-red; - background: $error-red; - color: #fff; - } - - @media (max-width: 430px) { - display: none; - } - } - .button-active { border-color: #008000; background: #008000;