-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
507cd9d
commit 3f10e2e
Showing
9 changed files
with
66 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 17 additions & 5 deletions
22
...t-v4-frontend/src/scenes/BuySell/CoinifyCheckout/Content/Sell/AddCustomerDetails/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,39 @@ | ||
import React from 'react' | ||
import { bindActionCreators } from 'redux' | ||
import { connect } from 'react-redux' | ||
import AddCustomerDetails from './template.js' | ||
|
||
import { actions } from 'data' | ||
import { getData } from './selectors.js' | ||
import Success from './template.success.js' | ||
import Loading from '../../../../template.loading' | ||
class AddCustomerDetailsContainer extends React.PureComponent { | ||
constructor (props) { | ||
super(props) | ||
this.onSubmit = this.onSubmit.bind(this) | ||
} | ||
|
||
onSubmit (e) { | ||
e.preventDefault() | ||
// TODO: Store form data in the state | ||
onSubmit (mediums, account) { | ||
const { coinifyDataActions } = this.props | ||
console.log('Submitting') | ||
coinifyDataActions.addBankAccount(mediums, account) | ||
} | ||
|
||
render () { | ||
return <AddCustomerDetails {...this.props} onSubmit={this.onSubmit} /> | ||
return this.props.data.cata({ | ||
Success: (value) => <Success onSubmit={this.onSubmit} {...value} />, | ||
Failure: (msg) => <div>Failure: {msg.error}</div>, | ||
Loading: () => <Loading />, | ||
NotAsked: () => <Loading /> | ||
}) | ||
} | ||
} | ||
|
||
const mapStateToProps = (state) => ({ | ||
data: getData(state) | ||
}) | ||
|
||
const mapDispatchToProps = (dispatch) => ({ | ||
coinifyDataActions: bindActionCreators(actions.core.data.coinify, dispatch) | ||
}) | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(AddCustomerDetailsContainer) |
79 changes: 0 additions & 79 deletions
79
...4-frontend/src/scenes/BuySell/CoinifyCheckout/Content/Sell/AddCustomerDetails/template.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters