Skip to content

Commit

Permalink
fix(AddFundsForm): Fix adding funds to hosted collectives (#522)
Browse files Browse the repository at this point in the history
There's also just the refactoring of a bad name of a variable.
  • Loading branch information
clarete committed Jun 14, 2018
1 parent c3ce1ca commit 3758cdd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/components/AddFundsForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getCurrencySymbol, formatCurrency } from '../lib/utils';
import withIntl from '../lib/withIntl';
import InputField from './InputField';
import {
AddFundsSourcePicker,
AddFundsSourcePickerWithData,
AddFundsSourcePickerForUserWithData,
} from './AddFundsSourcePicker';

Expand Down Expand Up @@ -68,7 +68,7 @@ class AddFundsForm extends React.Component {
name: "FromCollectiveId",
type: "component",
when: () => !this.isAddFundsToOrg,
component: AddFundsSourcePicker,
component: AddFundsSourcePickerWithData,
options: {
collective: this.props.collective,
host: this.props.host
Expand All @@ -79,7 +79,7 @@ class AddFundsForm extends React.Component {
type: "component",
when: () => this.isAddFundsToOrg,
component: AddFundsSourcePickerForUserWithData,
label: 'FromCollectiveId.addfundstoorg.label',
labelName: 'FromCollectiveId.addfundstoorg.label',
options: {
LoggedInUser: this.props.LoggedInUser,
}
Expand Down Expand Up @@ -117,7 +117,7 @@ class AddFundsForm extends React.Component {
];

this.fields = this.fields.map(field => {
const label = this.messages[field.label || `${field.name}.label`];
const label = this.messages[field.labelName || `${field.name}.label`];
if (label) {
field.label = intl.formatMessage(label);
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/AddFundsSourcePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ const addOrganizationsData = graphql(getSourcesQuery, {
});


export default withIntl(addOrganizationsData(AddFundsSourcePicker));
export const AddFundsSourcePickerWithData = withIntl(addOrganizationsData(AddFundsSourcePicker));

export const AddFundsSourcePickerForUserWithData = withIntl(AddFundsSourcePickerForUser);

export default AddFundsSourcePickerWithData;

0 comments on commit 3758cdd

Please sign in to comment.