From 6f4aeac0ba0f52c1f61c4f338ad3454e3498c81c Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 27 Jun 2021 11:35:27 -0500 Subject: [PATCH 1/5] Upgrade ForkAwesome to latest git commit on master --- package.json | 2 +- yarn.lock | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b1ddba8d0..81b255c42 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "file-loader": "^6.0.0", "fontsource-montserrat": "^3.0.9", "fontsource-roboto": "^3.0.3", - "fork-awesome": "^1.1.7", + "fork-awesome": "https://github.com/ForkAwesome/Fork-Awesome#964d92e199856be623ccf4c31ffd27603ecb2944", "html-webpack-harddisk-plugin": "^1.0.1", "html-webpack-plugin": "^4.3.0", "http-link-header": "^1.0.2", diff --git a/yarn.lock b/yarn.lock index f993be66e..f5642708a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5480,10 +5480,9 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= -fork-awesome@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/fork-awesome/-/fork-awesome-1.1.7.tgz#1427da1cac3d1713046ee88427e5fcecb9501d21" - integrity sha512-IHI7XCSXrKfUIWslse8c/PaaVDT1oBaYge+ju40ihL2ooiQeBpTr4wvIXhgTd2NuhntlvX+M5jYHAPTzNlmv0g== +"fork-awesome@https://github.com/ForkAwesome/Fork-Awesome#964d92e199856be623ccf4c31ffd27603ecb2944": + version "1.2.0" + resolved "https://github.com/ForkAwesome/Fork-Awesome#964d92e199856be623ccf4c31ffd27603ecb2944" form-data@~2.3.2: version "2.3.3" From e74ee136ee6126127463216a8b4aab7dbae03c56 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 27 Jun 2021 11:35:53 -0500 Subject: [PATCH 2/5] Subscriptions: use ringing bell for subscribed --- app/soapbox/features/ui/components/subscription_button.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/soapbox/features/ui/components/subscription_button.js b/app/soapbox/features/ui/components/subscription_button.js index 31a02a61d..fccc3fce4 100644 --- a/app/soapbox/features/ui/components/subscription_button.js +++ b/app/soapbox/features/ui/components/subscription_button.js @@ -53,11 +53,11 @@ class SubscriptionButton extends ImmutablePureComponent { if (account.getIn(['relationship', 'requested']) || account.getIn(['relationship', 'following'])) { subscriptionButton = (); } return subscriptionButton; } -} \ No newline at end of file +} From dd9b876f9c2d5d8da9533b7c1a57e7113caac985 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 27 Jun 2021 11:38:06 -0500 Subject: [PATCH 3/5] Subscriptions: hide bell when screen is too narrow --- app/styles/components/account-header.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/styles/components/account-header.scss b/app/styles/components/account-header.scss index 02a09f641..ec0b6f2e4 100644 --- a/app/styles/components/account-header.scss +++ b/app/styles/components/account-header.scss @@ -168,6 +168,10 @@ background: $error-red; color: #fff; } + + @media (max-width: 430px) { + display: none; + } } .button-active { From fd0380bc8286c1805965311d4e9115259c57995d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 27 Jun 2021 11:52:12 -0500 Subject: [PATCH 4/5] Subscriptions: add subscription option to account dropdown --- app/soapbox/features/account/components/header.js | 8 ++++++++ .../features/account_timeline/components/header.js | 5 +++++ .../account_timeline/containers/header_container.js | 11 +++++++++++ .../features/ui/components/subscription_button.js | 4 ++-- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/soapbox/features/account/components/header.js b/app/soapbox/features/account/components/header.js index 242ac2311..fa9708bdb 100644 --- a/app/soapbox/features/account/components/header.js +++ b/app/soapbox/features/account/components/header.js @@ -54,6 +54,8 @@ const messages = defineMessages({ deleteUser: { id: 'admin.users.actions.delete_user', defaultMessage: 'Delete @{name}' }, verifyUser: { id: 'admin.users.actions.verify_user', defaultMessage: 'Verify @{name}' }, unverifyUser: { id: 'admin.users.actions.unverify_user', defaultMessage: 'Unverify @{name}' }, + subscribe: { id: 'account.subscribe', defaultMessage: 'Subscribe to notifications from @{name}' }, + unsubscribe: { id: 'account.unsubscribe', defaultMessage: 'Unsubscribe to notifications from @{name}' }, }); const mapStateToProps = state => { @@ -158,6 +160,12 @@ class Header extends ImmutablePureComponent { menu.push({ text: intl.formatMessage(messages.showReblogs, { name: account.get('username') }), action: this.props.onReblogToggle }); } + if (account.getIn(['relationship', 'subscribing'])) { + menu.push({ text: intl.formatMessage(messages.unsubscribe, { name: account.get('username') }), action: this.props.onSubscriptionToggle }); + } else { + menu.push({ text: intl.formatMessage(messages.subscribe, { name: account.get('username') }), action: this.props.onSubscriptionToggle }); + } + menu.push({ text: intl.formatMessage(messages.add_or_remove_from_list), action: this.props.onAddToList }); // menu.push({ text: intl.formatMessage(account.getIn(['relationship', 'endorsed']) ? messages.unendorse : messages.endorse), action: this.props.onEndorseToggle }); menu.push(null); diff --git a/app/soapbox/features/account_timeline/components/header.js b/app/soapbox/features/account_timeline/components/header.js index a16053fc9..8e38d9fb5 100644 --- a/app/soapbox/features/account_timeline/components/header.js +++ b/app/soapbox/features/account_timeline/components/header.js @@ -52,6 +52,10 @@ export default class Header extends ImmutablePureComponent { this.props.onReblogToggle(this.props.account); } + handleSubscriptionToggle = () => { + this.props.onSubscriptionToggle(this.props.account); + } + handleMute = () => { this.props.onMute(this.props.account); } @@ -117,6 +121,7 @@ export default class Header extends ImmutablePureComponent { onDirect={this.handleDirect} onChat={this.handleChat} onReblogToggle={this.handleReblogToggle} + onSubscriptionToggle={this.handleSubscriptionToggle} onReport={this.handleReport} onMute={this.handleMute} onBlockDomain={this.handleBlockDomain} diff --git a/app/soapbox/features/account_timeline/containers/header_container.js b/app/soapbox/features/account_timeline/containers/header_container.js index 09026def0..c5689d158 100644 --- a/app/soapbox/features/account_timeline/containers/header_container.js +++ b/app/soapbox/features/account_timeline/containers/header_container.js @@ -10,6 +10,9 @@ import { unmuteAccount, // pinAccount, // unpinAccount, + subscribeAccount, + unsubscribeAccount, + } from '../../../actions/accounts'; import { mentionCompose, @@ -103,6 +106,14 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ } }, + onSubscriptionToggle(account) { + if (account.getIn(['relationship', 'subscribing'])) { + dispatch(unsubscribeAccount(account.get('id'))); + } else { + dispatch(subscribeAccount(account.get('id'))); + } + }, + // onEndorseToggle(account) { // if (account.getIn(['relationship', 'endorsed'])) { // dispatch(unpinAccount(account.get('id'))); diff --git a/app/soapbox/features/ui/components/subscription_button.js b/app/soapbox/features/ui/components/subscription_button.js index fccc3fce4..053ed0f52 100644 --- a/app/soapbox/features/ui/components/subscription_button.js +++ b/app/soapbox/features/ui/components/subscription_button.js @@ -12,8 +12,8 @@ import { } from 'soapbox/actions/accounts'; const messages = defineMessages({ - subscribe: { id: 'account.subscribe', defaultMessage: 'Subscribe to @{name} posts' }, - unsubscribe: { id: 'account.unsubscribe', defaultMessage: 'Unsubscribe @{name} posts' }, + subscribe: { id: 'account.subscribe', defaultMessage: 'Subscribe to notifications from @{name}' }, + unsubscribe: { id: 'account.unsubscribe', defaultMessage: 'Unsubscribe to notifications from @{name}' }, }); const mapStateToProps = state => { From cffe1b7ff5f04779ca441d7c065161ef59f31c2f Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 27 Jun 2021 12:11:53 -0500 Subject: [PATCH 5/5] Switch to my build of ForkAwesome with fixed bell-ringing icons --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 81b255c42..8f64a1475 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "file-loader": "^6.0.0", "fontsource-montserrat": "^3.0.9", "fontsource-roboto": "^3.0.3", - "fork-awesome": "https://github.com/ForkAwesome/Fork-Awesome#964d92e199856be623ccf4c31ffd27603ecb2944", + "fork-awesome": "https://github.com/alexgleason/Fork-Awesome#c23fd34246a9f33c4bf24ea095a4cf26e7abe265", "html-webpack-harddisk-plugin": "^1.0.1", "html-webpack-plugin": "^4.3.0", "http-link-header": "^1.0.2", diff --git a/yarn.lock b/yarn.lock index f5642708a..60526857c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5480,9 +5480,9 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= -"fork-awesome@https://github.com/ForkAwesome/Fork-Awesome#964d92e199856be623ccf4c31ffd27603ecb2944": +"fork-awesome@https://github.com/alexgleason/Fork-Awesome#c23fd34246a9f33c4bf24ea095a4cf26e7abe265": version "1.2.0" - resolved "https://github.com/ForkAwesome/Fork-Awesome#964d92e199856be623ccf4c31ffd27603ecb2944" + resolved "https://github.com/alexgleason/Fork-Awesome#c23fd34246a9f33c4bf24ea095a4cf26e7abe265" form-data@~2.3.2: version "2.3.3"