diff --git a/app/src/component/button/view.js b/app/src/component/button/view.js index 04f4b9d2..e0ccafdc 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 00000000..a0c3d277 --- /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 c77d7e2b..10a79bed 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 bfd22157..3e007fb4 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. + + +