-
Notifications
You must be signed in to change notification settings - Fork 504
/
index.tsx
53 lines (44 loc) · 1.4 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { bindActionCreators } from 'redux'
import { connect, ConnectedProps } from 'react-redux'
import React from 'react'
import { actions, selectors } from 'data'
import { CoinType, SupportedWalletCurrenciesType } from 'core/types'
import { ModalNamesType } from 'data/types'
import Welcome from './template'
class CoinIntroductionContainer extends React.PureComponent<Props> {
render () {
const { coin, modalActions, supportedCoins } = this.props
return (
<Welcome
handleRequest={() =>
modalActions.showModal(
`@MODAL.REQUEST.${supportedCoins[coin].coinCode}` as ModalNamesType,
{
origin: 'EmptyFeed'
}
)
}
{...this.props}
/>
)
}
}
const mapStateToProps = state => ({
supportedCoins: selectors.core.walletOptions
.getSupportedCoins(state)
.getOrElse({} as SupportedWalletCurrenciesType)
})
const mapDispatchToProps = dispatch => ({
modalActions: bindActionCreators(actions.modals, dispatch),
onboardingActions: bindActionCreators(
actions.components.onboarding,
dispatch
),
simpleBuyActions: bindActionCreators(actions.components.simpleBuy, dispatch)
})
const connector = connect(mapStateToProps, mapDispatchToProps)
type OwnProps = {
coin: CoinType
}
export type Props = OwnProps & ConnectedProps<typeof connector>
export default connector(CoinIntroductionContainer)