Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/constants/SceneKeys.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const LOGIN = 'login'
export const CHANGE_PASSWORD = 'changePassword'
export const CAHNGE_PIN = 'changePin'
export const RECOVER_PASSWORD = 'passwordRecovery'
export const EDGE = 'edge'
export const WALLET_LIST = 'walletList'
export const CREATE_WALLET = 'createWallet'
export const TRANSACTION_LIST = 'transactionList'
export const TRANSACTION_DETAILS = 'transactionDetails'
export const SCAN = 'scan'
export const SEND_CONFIRMATION = 'sendConfirmation'
export const REQUEST = 'request'
export const SETTINGS_OVERVIEW = 'settingsOverview'
export const BTC_SETTINGS = 'btcSettings'
export const ETH_SETTINGS = 'ethSettings'
export const DIRECTORY= 'directory'
2 changes: 2 additions & 0 deletions src/constants/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './SceneKeys'

40 changes: 23 additions & 17 deletions src/modules/Container.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ import {MenuContext} from 'react-native-menu'
import getTheme from '../theme/components'
import platform from '../theme/variables/platform'
import Locale from 'react-native-locale'

import * as Constants from '../constants'
import Login from './UI/scenes/Login/Login.ui'
import ChangePasswordConnector from './UI/scenes/ChangePinPassword/ChangePasswordConnector.ui'
import ChangePinConnector from './UI/scenes/ChangePinPassword/ChangePinConnector.ui'
import PasswordRecoveryConnector from './UI/scenes/PasswordRecovery/PasswordRecoveryConnector.ui'
import Layout from './UI/scenes/layout/Layout.ui'
import TransactionListConnect from './UI/scenes/TransactionList'
import TransactionDetails from './UI/scenes/TransactionDetails'
Expand Down Expand Up @@ -124,32 +127,35 @@ class Main extends Component {
<StatusBar translucent backgroundColor='green' barStyle='light-content' />

<RouterWithRedux>
<Scene key='root' hideNavBar>
<Scene key='login' type={ActionConst.REPLACE} initial username={this.props.username} component={Login} animation={'fade'} duration={600} />
<Scene key='root' hideNavBar>
<Scene hideNavBar hideTabBar type={ActionConst.RESET} key={Constants.LOGIN} component={Login} title='login' animation={'fade'} duration={600} initial username={this.props.username} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key={Constants.CHANGE_PASSWORD} component={ChangePasswordConnector} title='Settings' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key={Constants.CAHNGE_PIN} component={ChangePinConnector} title='Settings' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key={Constants.RECOVER_PASSWORD} component={PasswordRecoveryConnector} title='Settings' animation={'fade'} duration={600} />

<Scene hideNavBar hideTabBar key='edge' component={Layout} routes={routes} animation={'fade'} duration={600}>
<Scene hideNavBar hideTabBar key={Constants.EDGE} component={Layout} routes={routes} animation={'fade'} duration={600}>

<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key='walletList' initial component={WalletList} title='Wallets' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key='createWallet' component={CreateWallet} title='Create Wallet' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key={Constants.WALLET_LIST} initial component={WalletList} title='Wallets' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key={Constants.CREATE_WALLET} component={CreateWallet} title='Create Wallet' animation={'fade'} duration={600} />

<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key='transactionList' component={TransactionListConnect} title='Transactions' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key='transactionDetails' component={TransactionDetails} title='Transaction Details' duration={0} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key={Constants.TRANSACTION_LIST} component={TransactionListConnect} title='Transactions' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key={Constants.TRANSACTION_DETAILS} component={TransactionDetails} title='Transaction Details' duration={0} />

<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key='scan' component={Scan} title='Scan' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key='sendConfirmation' component={SendConfirmation} title='Send Confirmation' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key={Constants.SCAN} component={Scan} title='Scan' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key={Constants.SEND_CONFIRMATION} component={SendConfirmation} title='Send Confirmation' animation={'fade'} duration={600} />

<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key='request' component={Request} title='Request' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key={Constants.REQUEST} component={Request} title='Request' animation={'fade'} duration={600} />

<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key='settingsOverview' component={SettingsOverview} title='Settings' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key={Constants.SETTINGS_OVERVIEW} component={SettingsOverview} title='Settings' animation={'fade'} duration={600} />

<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key='btcSettings' component={BTCSettings} title='BTC Settings' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key='ethSettings' component={ETHSettings} title='ETH Settings' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key={Constants.BTC_SETTINGS} component={BTCSettings} title='BTC Settings' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key={Constants.ETH_SETTINGS} component={ETHSettings} title='ETH Settings' animation={'fade'} duration={600} />

<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key='directory' component={Directory} title='Directory' animation={'fade'} duration={600} />
<Scene hideNavBar hideTabBar type={ActionConst.REPLACE} key={Constants.DIRECTORY} component={Directory} title='Directory' animation={'fade'} duration={600} />

</Scene>
</Scene>
</RouterWithRedux>
</Scene>
</RouterWithRedux>

</Container>
</View>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React, {Component} from 'react'
import {ChangePasswordScreen} from 'airbitz-core-js-ui'

export default class ChangePassword extends Component {
onComplete = () => {
this.props.onComplete()
}

render () {
return (
<ChangePasswordScreen
accountObject={this.props.accountObject}
context={this.props.context}
onComplete={this.onComplete}
onCancel={this.onComplete}
/>
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {connect} from 'react-redux'
import * as CORE_SELECTORS from '../../../Core/selectors.js'
import {Actions} from 'react-native-router-flux'
import ChangePasswordComponent from './ChangePasswordComponent.ui'
import * as Constants from '../../../../constants'

export const mapStateToProps = (state) => ({
context: CORE_SELECTORS.getContext(state),
accountObject: CORE_SELECTORS.getAccount(state)
})

export const mapDispatchToProps = () => ({
onComplete: () => Actions[Constants.SETTINGS_OVERVIEW]()
})

export default connect(mapStateToProps, mapDispatchToProps)(ChangePasswordComponent)
19 changes: 19 additions & 0 deletions src/modules/UI/scenes/ChangePinPassword/ChangePinComponent.ui.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React, {Component} from 'react'
import {ChangePinScreen} from 'airbitz-core-js-ui'

export default class ChangePassword extends Component {
onComplete = () => {
this.props.onComplete()
}

render () {
return (
<ChangePinScreen
accountObject={this.props.accountObject}
context={this.props.context}
onComplete={this.onComplete}
onCancel={this.onComplete}
/>
)
}
}
16 changes: 16 additions & 0 deletions src/modules/UI/scenes/ChangePinPassword/ChangePinConnector.ui.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {connect} from 'react-redux'
import * as CORE_SELECTORS from '../../../Core/selectors.js'
import {Actions} from 'react-native-router-flux'
import ChangePinComponent from './ChangePinComponent.ui'
import * as Constants from '../../../../constants'

export const mapStateToProps = (state) => ({
context: CORE_SELECTORS.getContext(state),
accountObject: CORE_SELECTORS.getAccount(state)
})

export const mapDispatchToProps = () => ({
onComplete: () => Actions[Constants.SETTINGS_OVERVIEW]()
})

export default connect(mapStateToProps, mapDispatchToProps)(ChangePinComponent)
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React, {Component} from 'react'
import {PasswordRecoveryScreen} from 'airbitz-core-js-ui'

export default class PasswordRecovery extends Component {
onComplete = () => {
this.props.onComplete()
}

render () {
return (
<PasswordRecoveryScreen
accountObject={this.props.accountObject}
context={this.props.context}
onComplete={this.onComplete}
onCancel={this.onComplete}
/>
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {connect} from 'react-redux'
import * as CORE_SELECTORS from '../../../Core/selectors.js'
import {Actions} from 'react-native-router-flux'
import PasswordRecoveryComponent from './PasswordRecoveryComponent.ui'
import * as Constants from '../../../../constants'

export const mapStateToProps = (state) => ({
context: CORE_SELECTORS.getContext(state),
accountObject: CORE_SELECTORS.getAccount(state)
})

export const mapDispatchToProps = () => ({
onComplete: () => Actions[Constants.SETTINGS_OVERVIEW]()
})

export default connect(mapStateToProps, mapDispatchToProps)(PasswordRecoveryComponent)
28 changes: 15 additions & 13 deletions src/modules/UI/scenes/Settings/SettingsOverview.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import FAIcon from 'react-native-vector-icons/FontAwesome'
import IonIcon from 'react-native-vector-icons/Ionicons'
import LinearGradient from 'react-native-linear-gradient'

import * as Constants from '../../../../constants'
import strings from '../../../../locales/default'
import T from '../../components/FormattedText'
import RowModal from './components/RowModal.ui'
Expand All @@ -34,20 +35,19 @@ class SettingsOverview extends Component {

this.settings = [
{
key: 'changePassword',
key: Constants.CHANGE_PASSWORD,
text: sprintf(strings.enUS['settings_button_change_password']),
routeFunction: this._onPressDummyRouting
routeFunction: this._onPressChangePasswordRouting
}, {
key: 'changePin',
key: Constants.CAHNGE_PIN,
text: sprintf(strings.enUS['settings_button_pin']),
routeFunction: this._onPressDummyRouting
routeFunction: this._onPressChangePinRouting
}, {
key: 'passwordRecovery',
key: Constants.RECOVER_PASSWORD,
text: sprintf(strings.enUS['settings_button_change_pass_recovery']),
routeFunction: this._onPressDummyRouting
routeFunction: this._onPressRecoverPasswordRouting
}
]

this.securityRoute = [
{
key: 'setup2Factor',
Expand Down Expand Up @@ -93,14 +93,16 @@ class SettingsOverview extends Component {
]
}

_handleOnPressRouting = (route) => {
console.log('in SettingsOverview.ui.js, route is: ', route)
let goRoute = Actions[route]
goRoute()
_onPressChangePasswordRouting = () => {
Actions[Constants.CHANGE_PASSWORD]()
}

_onPressDummyRouting = () => {
console.log('dummy routing')
_onPressChangePinRouting = () => {
Actions[Constants.CAHNGE_PIN]()

}
_onPressRecoverPasswordRouting = () => {
Actions[Constants.CHANGE_PASSWORD]()
}

_onPressOpenLogoffTime = () => {
Expand Down