From 614069e3421f87e80cc61f4879e8eec0bf8e2afe Mon Sep 17 00:00:00 2001 From: akinwale Date: Thu, 10 May 2018 22:10:12 +0100 Subject: [PATCH] wallet alpha warning (#118) --- app/src/component/button/view.js | 10 +++++---- app/src/constants.js | 5 +++++ app/src/page/wallet/index.js | 13 +++++++++++- app/src/page/wallet/view.js | 21 ++++++++++++++++++- app/src/styles/colors.js | 1 + app/src/styles/wallet.js | 14 +++++++++++++ recipes/libgmp/__init__.py | 3 ++- .../browser/reactmodules/MixpanelModule.java | 4 ++-- 8 files changed, 62 insertions(+), 9 deletions(-) create mode 100644 app/src/constants.js diff --git a/app/src/component/button/view.js b/app/src/component/button/view.js index 04f4b9d..e0ccafd 100644 --- a/app/src/component/button/view.js +++ b/app/src/component/button/view.js @@ -14,10 +14,12 @@ export default class Button extends React.PureComponent { } = this.props; let styles = [buttonStyle.button, buttonStyle.row]; - if (style.length) { - styles = styles.concat(style); - } else { - styles.push(style); + if (style) { + if (style.length) { + styles = styles.concat(style); + } else { + styles.push(style); + } } if (disabled) { diff --git a/app/src/constants.js b/app/src/constants.js new file mode 100644 index 0000000..a0c3d27 --- /dev/null +++ b/app/src/constants.js @@ -0,0 +1,5 @@ +const Constants = { + SETTING_ALPHA_UNDERSTANDS_RISKS: "ALPHA_UNDERSTANDS_RISKS" +}; + +export default Constants; diff --git a/app/src/page/wallet/index.js b/app/src/page/wallet/index.js index c77d7e2..10a79be 100644 --- a/app/src/page/wallet/index.js +++ b/app/src/page/wallet/index.js @@ -1,4 +1,15 @@ import { connect } from 'react-redux'; +import { doSetClientSetting } from '../../redux/actions/settings'; +import { makeSelectClientSetting } from '../../redux/selectors/settings'; +import Constants from '../../constants'; import WalletPage from './view'; -export default connect(null, null)(WalletPage); +const select = state => ({ + understandsRisks: makeSelectClientSetting(Constants.SETTING_ALPHA_UNDERSTANDS_RISKS)(state), +}); + +const perform = dispatch => ({ + setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)), +}); + +export default connect(select, perform)(WalletPage); diff --git a/app/src/page/wallet/view.js b/app/src/page/wallet/view.js index bfd2215..3e007fb 100644 --- a/app/src/page/wallet/view.js +++ b/app/src/page/wallet/view.js @@ -1,12 +1,31 @@ import React from 'react'; -import { ScrollView } from 'react-native'; +import { ScrollView, Text, View } from 'react-native'; import TransactionListRecent from '../../component/transactionListRecent'; import WalletAddress from '../../component/walletAddress'; import WalletBalance from '../../component/walletBalance'; import WalletSend from '../../component/walletSend'; +import Button from '../../component/button'; +import Constants from '../../constants'; +import walletStyle from '../../styles/wallet'; class WalletPage extends React.PureComponent { render() { + const { understandsRisks, setClientSetting } = this.props; + + if (!understandsRisks) { + return ( + + + + This is alpha software. You may lose any LBC that you send to your wallet due to uninstallation, software bugs, deleted files, or malicious third-party software. You should not use this wallet as your primary wallet. If you understand the risks and you wish to continue, please click the button below. + + +