Commit af954bee authored by mgabdev's avatar mgabdev

Updated promoted status label to open upgrade to pro modal on click

parent 05c54a9f
......@@ -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 = (
<div className='status__prepend'>
<button className='status__prepend status__prepend--promoted' onClick={this.handleOpenProUpgradeModal}>
<div className='status__prepend-icon-wrapper'><Icon id='star' className='status__prepend-icon' fixedWidth /></div>
<FormattedMessage id='status.promoted' defaultMessage='Promoted gab' />
</div>
</button>
);
} else if (featured) {
prepend = (
......
......@@ -210,6 +210,10 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
dispatch(groupRemoveStatus(groupId, statusId));
},
onOpenProUpgradeModal() {
dispatch(openModal('PRO_UPGRADE'));
},
});
export default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Status));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment