Skip to content

Commit

Permalink
fix(Welcome): get started with bitcoin opens request
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLeoB committed May 7, 2018
1 parent 58959e9 commit 3df64eb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ class BitcoinWelcomeContainer extends React.PureComponent {
constructor (props) {
super(props)
this.handleClick = this.handleClick.bind(this)
this.handleRequest = this.handleRequest.bind(this)
}

handleClick () {
this.props.preferencesActions.setBitcoinWelcome(false)
}
handleRequest () {
this.props.modalActions.showModal('RequestBitcoin')
}

render () {
const { showBitcoinWelcome } = this.props
return <BitcoinWelcome displayed={showBitcoinWelcome} handleClick={this.handleClick} />
return <BitcoinWelcome displayed={showBitcoinWelcome} handleClick={this.handleClick} handleRequest={this.handleRequest} />
}
}

Expand All @@ -26,7 +30,8 @@ const mapStateToProps = state => ({
})

const mapDispatchToProps = dispatch => ({
preferencesActions: bindActionCreators(actions.preferences, dispatch)
preferencesActions: bindActionCreators(actions.preferences, dispatch),
modalActions: bindActionCreators(actions.modals, dispatch)
})

export default connect(mapStateToProps, mapDispatchToProps)(BitcoinWelcomeContainer)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'
import { FormattedMessage } from 'react-intl'
import { LinkContainer } from 'react-router-bootstrap'
// import { LinkContainer } from 'react-router-bootstrap'

import { Button, Icon, Image, Link, Separator, Text, TextGroup } from 'blockchain-info-components'

Expand Down Expand Up @@ -52,7 +52,7 @@ const CloseArrow = styled(Icon)`
margin-top: 20px;
`
const BitcoinWelcome = props => {
const { displayed, handleClick } = props
const { displayed, handleClick, handleRequest } = props

return (
<Wrapper displayed={displayed}>
Expand Down Expand Up @@ -95,11 +95,10 @@ const BitcoinWelcome = props => {
</Cell>
</Row>
<Row>
<LinkContainer to='/buy-sell'>
<Button nature='primary' margin='20px' fullwidth uppercase>
<FormattedMessage id='scenes.transaction.bitcoin.content.empty.bitcoinwelcome.getstarted' defaultMessage='Get started with bitcoin' />
</Button>
</LinkContainer>
{/* use link container to set up conditional to send to buy if available */}
<Button nature='primary' margin='20px' onClick={handleRequest} fullwidth uppercase>
<FormattedMessage id='scenes.transaction.bitcoin.content.empty.bitcoinwelcome.getstarted' defaultMessage='Get started with bitcoin' />
</Button>
</Row>
</Container>
<CloseArrow name='close' size='12px' cursor onClick={handleClick} />
Expand All @@ -109,7 +108,8 @@ const BitcoinWelcome = props => {

BitcoinWelcome.propTypes = {
displayed: PropTypes.bool.isRequired,
handleClick: PropTypes.func.isRequired
handleClick: PropTypes.func.isRequired,
handleRequest: PropTypes.func.isRequired
}

export default BitcoinWelcome

0 comments on commit 3df64eb

Please sign in to comment.