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

This commit is contained in:
mgabdev 2019-09-18 19:48:37 -04:00
parent 05c54a9f8b
commit af954beeab
2 changed files with 12 additions and 3 deletions

View File

@ -93,7 +93,8 @@ class Status extends ImmutablePureComponent {
cacheMediaWidth: PropTypes.func, cacheMediaWidth: PropTypes.func,
cachedMediaWidth: PropTypes.number, cachedMediaWidth: PropTypes.number,
group: ImmutablePropTypes.map, group: ImmutablePropTypes.map,
promoted: PropTypes.bool promoted: PropTypes.bool,
onOpenProUpgradeModal: PropTypes.func,
}; };
// Avoid checking props that are functions (and whose equality will always // Avoid checking props that are functions (and whose equality will always
@ -259,6 +260,10 @@ class Status extends ImmutablePureComponent {
this.node = c; this.node = c;
} }
handleOpenProUpgradeModal = () => {
this.props.onOpenProUpgradeModal();
}
render () { render () {
let media = null; let media = null;
let statusAvatar, prepend, rebloggedByText, reblogContent; let statusAvatar, prepend, rebloggedByText, reblogContent;
@ -297,10 +302,10 @@ class Status extends ImmutablePureComponent {
if (promoted) { if (promoted) {
prepend = ( 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> <div className='status__prepend-icon-wrapper'><Icon id='star' className='status__prepend-icon' fixedWidth /></div>
<FormattedMessage id='status.promoted' defaultMessage='Promoted gab' /> <FormattedMessage id='status.promoted' defaultMessage='Promoted gab' />
</div> </button>
); );
} else if (featured) { } else if (featured) {
prepend = ( prepend = (

View File

@ -210,6 +210,10 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
dispatch(groupRemoveStatus(groupId, statusId)); dispatch(groupRemoveStatus(groupId, statusId));
}, },
onOpenProUpgradeModal() {
dispatch(openModal('PRO_UPGRADE'));
},
}); });
export default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Status)); export default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Status));