remove amount from new invite component

This commit is contained in:
Travis Eden 2018-05-30 13:51:20 -04:00
parent 6ce77f7a8b
commit 8b895caf15
2 changed files with 8 additions and 18 deletions

View file

@ -1,26 +1,17 @@
import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import InviteNew from './view';
import { import {
selectUserInvitesRemaining, selectUserInvitesRemaining,
selectUserInviteNewIsPending, selectUserInviteNewIsPending,
selectUserInviteNewErrorMessage, selectUserInviteNewErrorMessage,
} from 'redux/selectors/user'; } from 'redux/selectors/user';
import rewards from 'rewards';
import { makeSelectRewardAmountByType } from 'redux/selectors/rewards';
import { doUserInviteNew } from 'redux/actions/user'; import { doUserInviteNew } from 'redux/actions/user';
import InviteNew from './view';
const select = state => { const select = state => ({
const selectReward = makeSelectRewardAmountByType();
return {
errorMessage: selectUserInviteNewErrorMessage(state), errorMessage: selectUserInviteNewErrorMessage(state),
invitesRemaining: selectUserInvitesRemaining(state), invitesRemaining: selectUserInvitesRemaining(state),
isPending: selectUserInviteNewIsPending(state), isPending: selectUserInviteNewIsPending(state),
rewardAmount: selectReward(state, { reward_type: rewards.TYPE_REFERRAL }), });
};
};
const perform = dispatch => ({ const perform = dispatch => ({
inviteNew: email => dispatch(doUserInviteNew(email)), inviteNew: email => dispatch(doUserInviteNew(email)),

View file

@ -29,8 +29,7 @@ class FormInviteNew extends React.PureComponent {
} }
render() { render() {
const { errorMessage, isPending, rewardAmount } = this.props; const { errorMessage, isPending } = this.props;
const label = `${__('Get')} ${rewardAmount} LBC`;
return ( return (
<Form onSubmit={this.handleSubmit}> <Form onSubmit={this.handleSubmit}>
@ -49,7 +48,7 @@ class FormInviteNew extends React.PureComponent {
/> />
</FormRow> </FormRow>
<div className="card__actions"> <div className="card__actions">
<Submit label={label} disabled={isPending} /> <Submit label="INVITE" disabled={isPending} />
</div> </div>
</Form> </Form>
); );