/
DelegationNavigationButtons.js
54 lines (45 loc) · 1.49 KB
/
DelegationNavigationButtons.js
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
54
// @flow
import React from 'react'
import {compose} from 'redux'
import {View} from 'react-native'
import {withHandlers} from 'recompose'
import {injectIntl, defineMessages} from 'react-intl'
import {SHELLEY_WALLET_ROUTES} from '../../RoutesList'
import {Button} from '../UiKit'
import styles from './styles/DelegationNavigator.style'
import iconStakingCenter from '../../assets/img/icon/receive.png'
import type {NavigationScreenProp, NavigationState} from 'react-navigation'
const messages = defineMessages({
stakingCenterButton: {
id: 'components.delegation.delegationnavigationbuttons.stakingCenterButton',
defaultMessage: '!!!StakingCenter',
},
})
type Props = {
navigation: NavigationScreenProp<NavigationState>,
navigateToStakingCenter: () => mixed,
intl: any,
}
const DelegationNavigationButtons = ({
navigation,
navigateToStakingCenter,
intl,
}: Props) => (
<View style={styles.container}>
<Button
block
onPress={navigateToStakingCenter}
title={intl.formatMessage(messages.stakingCenterButton)}
style={styles.mainButton}
iconImage={iconStakingCenter}
/>
</View>
)
export default injectIntl(
compose(
withHandlers({
navigateToStakingCenter: ({navigation}) => (event) =>
navigation.navigate(SHELLEY_WALLET_ROUTES.STAKING_CENTER),
}),
)(DelegationNavigationButtons),
)