Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #728 from Emurgo/nicarq/ch2042/add-staking-center-…
…ui-to-mobile Nicarq/ch2042/add staking center ui to mobile
- Loading branch information
Showing
25 changed files
with
525 additions
and
33 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// @flow | ||
import React from 'react' | ||
import {CONFIG} from '../../config' | ||
import {View, WebView} from 'react-native' | ||
import {compose, withHandlers} from 'recompose' | ||
import {injectIntl, defineMessages} from 'react-intl' | ||
import type {IntlShape} from 'react-intl'; | ||
import type {NavigationScreenProp, NavigationState} from 'react-navigation'; | ||
|
||
import type {ComponentType} from 'react' | ||
import {withNavigationTitle} from "../../utils/renderUtils"; | ||
|
||
const messages = defineMessages({ | ||
title: { | ||
id: 'components.stakingcenter.title', | ||
defaultMessage: '!!!Staking Center', | ||
description: 'some desc', | ||
}, | ||
// header: { | ||
// id: 'components.walletselection.walletselectionscreen.header', | ||
// defaultMessage: '!!!Your wallets', | ||
// }, | ||
// addWalletButton: { | ||
// id: 'components.walletselection.walletselectionscreen.addWalletButton', | ||
// defaultMessage: '!!!Add wallet', | ||
// }, | ||
}) | ||
|
||
const DelegationCenter = ({navigation, intl}) => ( | ||
<View style={{ flex: 1 }}> | ||
<WebView source={{uri: 'http://localhost:3000/staking-simple/list?sortBy=REVENUE&searchText=&performance[]=0&performance[]=100'}} /> | ||
</View> | ||
) | ||
|
||
export default injectIntl( | ||
(compose( | ||
withNavigationTitle(({intl}) => intl.formatMessage(messages.title)), | ||
)(DelegationCenter): ComponentType<{ | ||
intl: IntlShape, | ||
navigation: NavigationScreenProp<NavigationState>, | ||
}>), | ||
) | ||
|
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,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), | ||
) |
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,35 @@ | ||
// @flow | ||
import React from 'react' | ||
import {createStackNavigator} from 'react-navigation' | ||
import DelegationCenter from './DelegationCenter' | ||
import {SHELLEY_WALLET_ROUTES} from '../../RoutesList' | ||
|
||
import { | ||
defaultNavigationOptions, | ||
defaultStackNavigatorOptions, | ||
} from '../../navigationOptions' | ||
|
||
import HeaderBackButton from '../UiKit/HeaderBackButton' | ||
|
||
const DelegationNavigatorCenter = createStackNavigator( | ||
{ | ||
[SHELLEY_WALLET_ROUTES.STAKING_CENTER]: { | ||
screen: DelegationCenter, | ||
navigationOptions: ({navigation}) => ({ | ||
title: navigation.getParam('title'), | ||
...defaultNavigationOptions, | ||
}), | ||
}, | ||
}, | ||
{ | ||
initialRouteName: SHELLEY_WALLET_ROUTES.STAKING_CENTER, | ||
navigationOptions: ({navigation}) => ({ | ||
title: navigation.getParam('title'), | ||
headerLeft: <HeaderBackButton navigation={navigation} />, | ||
...defaultNavigationOptions, | ||
}), | ||
...defaultStackNavigatorOptions, | ||
}, | ||
) | ||
|
||
export default DelegationNavigatorCenter |
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,49 @@ | ||
// @flow | ||
import React from 'react' | ||
import {Button} from '../UiKit' | ||
import {createStackNavigator} from 'react-navigation' | ||
import DelegationSummary from './DelegationSummary' | ||
import {SHELLEY_WALLET_ROUTES, WALLET_ROUTES} from '../../RoutesList' | ||
import SettingsScreenNavigator from '../Settings/SettingsScreenNavigator' | ||
import iconGear from '../../assets/img/gear.png' | ||
|
||
import { | ||
defaultNavigationOptions, | ||
defaultStackNavigatorOptions, | ||
} from '../../navigationOptions' | ||
|
||
import styles from '../TxHistory/styles/SettingsButton.style' | ||
|
||
const DelegationNavigatorSummary = createStackNavigator( | ||
{ | ||
[SHELLEY_WALLET_ROUTES.DELEGATION_SUMMARY]: { | ||
screen: DelegationSummary, | ||
navigationOptions: ({navigation}) => ({ | ||
title: navigation.getParam('title'), | ||
headerRight: ( | ||
<Button | ||
style={styles.settingsButton} | ||
onPress={() => navigation.navigate(WALLET_ROUTES.SETTINGS)} | ||
iconImage={iconGear} | ||
title="" | ||
withoutBackground | ||
/> | ||
), | ||
...defaultNavigationOptions, | ||
}), | ||
}, | ||
[WALLET_ROUTES.SETTINGS]: { | ||
screen: SettingsScreenNavigator, | ||
navigationOptions: { | ||
header: null, | ||
...defaultNavigationOptions, | ||
}, | ||
}, | ||
}, | ||
{ | ||
initialRouteName: SHELLEY_WALLET_ROUTES.DELEGATION_SUMMARY, | ||
...defaultStackNavigatorOptions, | ||
}, | ||
) | ||
|
||
export default DelegationNavigatorSummary |
Oops, something went wrong.