From 82c07f84b42cbe040eab7d38fa78a6f6e836eb59 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 4 Jul 2020 14:21:58 -0500 Subject: [PATCH] Pull patronUrl from /api/patron/v1/instance --- app/soapbox/components/sidebar_menu.js | 10 ++++------ app/soapbox/features/ui/components/funding_panel.js | 5 ++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/soapbox/components/sidebar_menu.js b/app/soapbox/components/sidebar_menu.js index 69482475e..64b2d65b1 100644 --- a/app/soapbox/components/sidebar_menu.js +++ b/app/soapbox/components/sidebar_menu.js @@ -39,13 +39,11 @@ const messages = defineMessages({ const mapStateToProps = state => { const me = state.get('me'); const getAccount = makeGetAccount(); - const patronEnabled = state.getIn(['soapbox', 'extensions', 'patron', 'enabled']); - const patronUrl = state.getIn(['soapbox', 'extensions', 'patron', 'baseUrl']); return { account: getAccount(state, me), sidebarOpen: state.get('sidebar').sidebarOpen, - patronUrl: patronEnabled && patronUrl, + donateUrl: state.getIn(['patron', 'url']), isStaff: isStaff(state.getIn(['accounts', me])), }; }; @@ -77,7 +75,7 @@ class SidebarMenu extends ImmutablePureComponent { } render() { - const { sidebarOpen, onClose, intl, account, onClickLogOut, patronUrl, isStaff } = this.props; + const { sidebarOpen, onClose, intl, account, onClickLogOut, donateUrl, isStaff } = this.props; if (!account) return null; const acct = account.get('acct'); @@ -129,8 +127,8 @@ class SidebarMenu extends ImmutablePureComponent { {intl.formatMessage(messages.messages)} - {patronUrl ? - + {donateUrl ? + {intl.formatMessage(messages.donate)} diff --git a/app/soapbox/features/ui/components/funding_panel.js b/app/soapbox/features/ui/components/funding_panel.js index 41889bd45..5d58f1721 100644 --- a/app/soapbox/features/ui/components/funding_panel.js +++ b/app/soapbox/features/ui/components/funding_panel.js @@ -22,7 +22,7 @@ class FundingPanel extends ImmutablePureComponent { } render() { - const { patron, patronUrl } = this.props; + const { patron } = this.props; if (patron.isEmpty()) return null; const amount = patron.getIn(['funding', 'amount']); @@ -53,7 +53,7 @@ class FundingPanel extends ImmutablePureComponent {
{goal_text}
- {patronUrl && Donate} + Donate ); @@ -64,7 +64,6 @@ class FundingPanel extends ImmutablePureComponent { const mapStateToProps = state => { return { patron: state.get('patron'), - patronUrl: state.getIn(['soapbox', 'extensions', 'patron', 'baseUrl']), }; };