Updated promoted status label to open upgrade to pro modal on click
This commit is contained in:
parent
05c54a9f8b
commit
af954beeab
|
@ -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 = (
|
||||||
|
|
|
@ -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));
|
||||||
|
|
Loading…
Reference in New Issue