From af954beeabcaee9e912cc4bff497051a7e8ba251 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Wed, 18 Sep 2019 19:48:37 -0400 Subject: [PATCH] Updated promoted status label to open upgrade to pro modal on click --- app/javascript/gabsocial/components/status.js | 11 ++++++++--- .../gabsocial/containers/status_container.js | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/javascript/gabsocial/components/status.js b/app/javascript/gabsocial/components/status.js index 87d7d13e..72fec350 100644 --- a/app/javascript/gabsocial/components/status.js +++ b/app/javascript/gabsocial/components/status.js @@ -93,7 +93,8 @@ class Status extends ImmutablePureComponent { cacheMediaWidth: PropTypes.func, cachedMediaWidth: PropTypes.number, group: ImmutablePropTypes.map, - promoted: PropTypes.bool + promoted: PropTypes.bool, + onOpenProUpgradeModal: PropTypes.func, }; // Avoid checking props that are functions (and whose equality will always @@ -259,6 +260,10 @@ class Status extends ImmutablePureComponent { this.node = c; } + handleOpenProUpgradeModal = () => { + this.props.onOpenProUpgradeModal(); + } + render () { let media = null; let statusAvatar, prepend, rebloggedByText, reblogContent; @@ -297,10 +302,10 @@ class Status extends ImmutablePureComponent { if (promoted) { prepend = ( -
+
+ ); } else if (featured) { prepend = ( diff --git a/app/javascript/gabsocial/containers/status_container.js b/app/javascript/gabsocial/containers/status_container.js index 44497585..fd168adb 100644 --- a/app/javascript/gabsocial/containers/status_container.js +++ b/app/javascript/gabsocial/containers/status_container.js @@ -210,6 +210,10 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ dispatch(groupRemoveStatus(groupId, statusId)); }, + onOpenProUpgradeModal() { + dispatch(openModal('PRO_UPGRADE')); + }, + }); export default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Status));