-
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
f1c6c80
commit fe48435
Showing
4 changed files
with
70 additions
and
3 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
packages/blockchain-wallet-v4-frontend/src/modals/CoinifyDeleteBank/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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react' | ||
import { connect } from 'react-redux' | ||
import { bindActionCreators, compose } from 'redux' | ||
import { actions } from 'data' | ||
import modalEnhancer from 'providers/ModalEnhancer' | ||
import CoinifyDeleteBank from './template.js' | ||
|
||
class CoinifyDeleteBankContainer extends React.PureComponent { | ||
constructor (props) { | ||
super(props) | ||
this.handleSubmit = this.handleSubmit.bind(this) | ||
} | ||
|
||
handleSubmit () { | ||
this.props.close() | ||
this.props.coinifyActions.deleteBankAccount(this.props.bankAccount) | ||
} | ||
|
||
render () { | ||
return <CoinifyDeleteBank {...this.props} handleSubmit={this.handleSubmit} /> | ||
} | ||
} | ||
|
||
const mapDispatchToProps = (dispatch) => ({ | ||
coinifyActions: bindActionCreators(actions.modules.coinify, dispatch) | ||
}) | ||
|
||
const enhance = compose( | ||
modalEnhancer('CoinifyDeleteBank'), | ||
connect(undefined, mapDispatchToProps) | ||
) | ||
|
||
export default enhance(CoinifyDeleteBankContainer) |
32 changes: 32 additions & 0 deletions
32
packages/blockchain-wallet-v4-frontend/src/modals/CoinifyDeleteBank/template.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react' | ||
import { FormattedMessage } from 'react-intl' | ||
|
||
import { Button, Link, Modal, ModalHeader, ModalBody, ModalFooter, Text } from 'blockchain-info-components' | ||
|
||
const CoinifyDeleteBank = (props) => { | ||
const { close, position, total, ...rest } = props | ||
const { handleSubmit } = rest | ||
|
||
return ( | ||
<Modal size='large' position={position} total={total}> | ||
<ModalHeader onClose={close}> | ||
<FormattedMessage id='modals.coinifydeletebank.title' defaultMessage='Delete bank Account?' /> | ||
</ModalHeader> | ||
<ModalBody> | ||
<Text size='14px' weight={300}> | ||
<FormattedMessage id='modals.coinifydeletebank.explain' defaultMessage='Are you sure you want to delete this bank account?' /> | ||
</Text> | ||
</ModalBody> | ||
<ModalFooter align='spaced'> | ||
<Link size='13px' weight={300} onClick={close}> | ||
<FormattedMessage id='modals.coinifydeletebank.cancel' defaultMessage='Cancel' /> | ||
</Link> | ||
<Button onClick={handleSubmit} nature='logout'> | ||
<FormattedMessage id='modals.coinifydeletebank.logout' defaultMessage='Delete' /> | ||
</Button> | ||
</ModalFooter> | ||
</Modal> | ||
) | ||
} | ||
|
||
export default CoinifyDeleteBank |
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