diff --git a/package-lock.json b/package-lock.json index 4d73dcff076..f8c2549cea4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,11 +4,6 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "Base64": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/Base64/-/Base64-0.2.1.tgz", - "integrity": "sha1-ujpCMHCOGGcFBl5mur3Uw1z2ACg=" - }, "abab": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.3.tgz", @@ -208,10 +203,10 @@ "version": "git+ssh://git@github.com/Airbitz/airbitz-core-types.git#ca3b29123f421678566b863c336fed446bf3494c" }, "airbitz-currency-bitcoin": { - "version": "git+ssh://git@github.com/Airbitz/airbitz-currency-bitcoin.git#f288bb6e50a98cec8df026068442e70b6171ddda", + "version": "git+ssh://git@github.com/Airbitz/airbitz-currency-bitcoin.git#490931b8fefdd62ee4f2fbce14d01408e4be86c1", "requires": { "bcoin": "git+https://github.com/Airbitz/bcoin.git#5617f60e5c5d70f0964247f7573485594333951b", - "biggystring": "1.0.6", + "biggystring": "1.0.7", "buffer": "5.0.7", "lcoin": "git+https://github.com/Airbitz/lcoin.git#de7016671e2593638dd80a820889b7e9329d7355", "uri-js": "3.0.2" @@ -232,7 +227,7 @@ "version": "git+ssh://git@github.com/Airbitz/airbitz-currency-ethereum.git#4b4756405ba97e3aaeef26091074719d4bc9f204", "requires": { "airbitz-core-types": "git+ssh://git@github.com/Airbitz/airbitz-core-types.git#ca3b29123f421678566b863c336fed446bf3494c", - "biggystring": "1.0.6", + "biggystring": "1.0.7", "bn.js": "4.11.8", "buffer": "5.0.7", "ethereumjs-abi": "0.6.4", @@ -1552,6 +1547,11 @@ "resolved": "https://registry.npmjs.org/base-x/-/base-x-1.1.0.tgz", "integrity": "sha1-QtPXF0dPnqAiB/bRqh9CaRPut6w=" }, + "Base64": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/Base64/-/Base64-0.2.1.tgz", + "integrity": "sha1-ujpCMHCOGGcFBl5mur3Uw1z2ACg=" + }, "base64-arraybuffer": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", @@ -1740,9 +1740,9 @@ "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==" }, "biggystring": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/biggystring/-/biggystring-1.0.6.tgz", - "integrity": "sha512-UtpS2HmEDNlVHlAC2mV1/Q+tZuWESoT3kCEeHMU7b0DxuW7iKMgxFF6TniMLn05emonc1t2jZxIcbXNSGjlpLQ==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/biggystring/-/biggystring-1.0.7.tgz", + "integrity": "sha512-hq1t1Gc6p6KVLCr2Azwo+YhqXteFPVBcnqVJiAVm9WtsrZdlABbuNDlownyjJBApEZocA6rYdjMTjXWd6Bzqjw==", "requires": { "bn.js": "4.11.8" } @@ -5054,6 +5054,13 @@ } } }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, "string-width": { "version": "1.0.2", "bundled": true, @@ -5063,13 +5070,6 @@ "strip-ansi": "3.0.1" } }, - "string_decoder": { - "version": "1.0.1", - "bundled": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, "stringstream": { "version": "0.0.5", "bundled": true, @@ -12427,6 +12427,11 @@ "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, "string-length": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz", @@ -12451,11 +12456,6 @@ "strip-ansi": "3.0.1" } }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", diff --git a/src/constants/SceneKeys.js b/src/constants/SceneKeys.js new file mode 100644 index 00000000000..400897beebe --- /dev/null +++ b/src/constants/SceneKeys.js @@ -0,0 +1,17 @@ +export const LOGIN = 'login' +export const CHANGE_PASSWORD = 'changePassword' +export const CHANGE_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 LTC_SETTINGS = 'ltcSettings' +export const DIRECTORY= 'directory' diff --git a/src/constants/index.js b/src/constants/index.js new file mode 100644 index 00000000000..7051510168b --- /dev/null +++ b/src/constants/index.js @@ -0,0 +1,2 @@ +export * from './SceneKeys' + diff --git a/src/modules/Main.ui.js b/src/modules/Main.ui.js index 322d4044826..1b2b4884a01 100644 --- a/src/modules/Main.ui.js +++ b/src/modules/Main.ui.js @@ -9,10 +9,13 @@ 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 Layout from './UI/scenes/layout/LayoutConnector' -import TransactionList from './UI/scenes/TransactionList/TransactionListConnector' +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' import Request from './UI/scenes/Request/index' import SendConfirmation from './UI/scenes/SendConfirmation/index' @@ -111,31 +114,34 @@ export default class Main extends Component { - - + + + + + - + - - + + - - + + - - + + - + - + - - - + + + - - + + diff --git a/src/modules/UI/scenes/ChangePinPassword/ChangePasswordComponent.ui.js b/src/modules/UI/scenes/ChangePinPassword/ChangePasswordComponent.ui.js new file mode 100644 index 00000000000..c3acb97b8ce --- /dev/null +++ b/src/modules/UI/scenes/ChangePinPassword/ChangePasswordComponent.ui.js @@ -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 ( + + ) + } +} diff --git a/src/modules/UI/scenes/ChangePinPassword/ChangePasswordConnector.ui.js b/src/modules/UI/scenes/ChangePinPassword/ChangePasswordConnector.ui.js new file mode 100644 index 00000000000..7665d51202a --- /dev/null +++ b/src/modules/UI/scenes/ChangePinPassword/ChangePasswordConnector.ui.js @@ -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), + account: CORE_SELECTORS.getAccount(state) +}) + +export const mapDispatchToProps = () => ({ + onComplete: () => Actions[Constants.SETTINGS_OVERVIEW]() +}) + +export default connect(mapStateToProps, mapDispatchToProps)(ChangePasswordComponent) diff --git a/src/modules/UI/scenes/ChangePinPassword/ChangePinComponent.ui.js b/src/modules/UI/scenes/ChangePinPassword/ChangePinComponent.ui.js new file mode 100644 index 00000000000..06b16352dd3 --- /dev/null +++ b/src/modules/UI/scenes/ChangePinPassword/ChangePinComponent.ui.js @@ -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 ( + + ) + } +} diff --git a/src/modules/UI/scenes/ChangePinPassword/ChangePinConnector.ui.js b/src/modules/UI/scenes/ChangePinPassword/ChangePinConnector.ui.js new file mode 100644 index 00000000000..311291c588d --- /dev/null +++ b/src/modules/UI/scenes/ChangePinPassword/ChangePinConnector.ui.js @@ -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), + account: CORE_SELECTORS.getAccount(state) +}) + +export const mapDispatchToProps = () => ({ + onComplete: () => Actions[Constants.SETTINGS_OVERVIEW]() +}) + +export default connect(mapStateToProps, mapDispatchToProps)(ChangePinComponent) diff --git a/src/modules/UI/scenes/PasswordRecovery/PasswordRecoveryComponent.ui.js b/src/modules/UI/scenes/PasswordRecovery/PasswordRecoveryComponent.ui.js new file mode 100644 index 00000000000..dec9ff9b74d --- /dev/null +++ b/src/modules/UI/scenes/PasswordRecovery/PasswordRecoveryComponent.ui.js @@ -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 ( + + ) + } +} diff --git a/src/modules/UI/scenes/PasswordRecovery/PasswordRecoveryConnector.ui.js b/src/modules/UI/scenes/PasswordRecovery/PasswordRecoveryConnector.ui.js new file mode 100644 index 00000000000..e3f11bf29af --- /dev/null +++ b/src/modules/UI/scenes/PasswordRecovery/PasswordRecoveryConnector.ui.js @@ -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), + account: CORE_SELECTORS.getAccount(state) +}) + +export const mapDispatchToProps = () => ({ + onComplete: () => Actions[Constants.SETTINGS_OVERVIEW]() +}) + +export default connect(mapStateToProps, mapDispatchToProps)(PasswordRecoveryComponent) diff --git a/src/modules/UI/scenes/Settings/SettingsOverview.ui.js b/src/modules/UI/scenes/Settings/SettingsOverview.ui.js index 060a2cfb564..7b5edd87704 100644 --- a/src/modules/UI/scenes/Settings/SettingsOverview.ui.js +++ b/src/modules/UI/scenes/Settings/SettingsOverview.ui.js @@ -9,6 +9,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' @@ -30,20 +31,19 @@ export default 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.CHANGE_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', @@ -89,14 +89,16 @@ export default 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.CHANGE_PIN]() + + } + _onPressRecoverPasswordRouting = () => { + Actions[Constants.CHANGE_PASSWORD]() } _onPressOpenLogoffTime = () => { diff --git a/src/modules/utils.js b/src/modules/utils.js index 4c944e14580..18b1d882ccc 100644 --- a/src/modules/utils.js +++ b/src/modules/utils.js @@ -138,5 +138,4 @@ export const getNewArrayWithItem = (array: Array, item: any) => !array.includes(item) ? [...array, item] : array export const isGreaterThan = (comparedTo: string) => - // $FlowFixMe (amountString: string): boolean => gt(amountString, comparedTo)