Browse Source

On the receive modal, label the address Testnet when appropriate

renovate/lint-staged-8.x
Ben Woosley 7 years ago
parent
commit
07facd5d0d
No known key found for this signature in database GPG Key ID: 6EE5F3785F78B345
  1. 8
      app/components/Wallet/ReceiveModal.js
  2. 2
      app/reducers/info.js
  3. 1
      app/routes/app/containers/AppContainer.js
  4. 1
      test/reducers/__snapshots__/info.spec.js.snap

8
app/components/Wallet/ReceiveModal.js

@ -38,7 +38,8 @@ class ReceiveModal extends React.Component {
pubkey, pubkey,
address, address,
alias, alias,
closeReceiveModal closeReceiveModal,
network
} = this.props } = this.props
const { qrCodeType } = this.state const { qrCodeType } = this.state
@ -87,7 +88,7 @@ class ReceiveModal extends React.Component {
</div> </div>
<div className={styles.address}> <div className={styles.address}>
<h4>Bitcoin Address</h4> <h4>Bitcoin {network.name} Address</h4>
<p> <p>
<span className={styles.data}>{address}</span> <span className={styles.data}>{address}</span>
<span onClick={() => copyOnClick(address)} className={`${styles.copy} hint--left`} data-hint='Copy address'> <span onClick={() => copyOnClick(address)} className={`${styles.copy} hint--left`} data-hint='Copy address'>
@ -103,6 +104,9 @@ class ReceiveModal extends React.Component {
} }
ReceiveModal.propTypes = { ReceiveModal.propTypes = {
network: PropTypes.shape({
name: PropTypes.string
}).isRequired,
isOpen: PropTypes.bool.isRequired, isOpen: PropTypes.bool.isRequired,
pubkey: PropTypes.string, pubkey: PropTypes.string,
address: PropTypes.string.isRequired, address: PropTypes.string.isRequired,

2
app/reducers/info.js

@ -38,11 +38,13 @@ export const receiveInfo = (event, data) => (dispatch) => {
const networks = { const networks = {
testnet: { testnet: {
name: 'Testnet',
explorerUrl: 'https://testnet.smartbit.com.au', explorerUrl: 'https://testnet.smartbit.com.au',
bitcoinJsNetwork: bitcoin.networks.testnet, bitcoinJsNetwork: bitcoin.networks.testnet,
unitPrefix: 't' unitPrefix: 't'
}, },
mainnet: { mainnet: {
name: null, // no name since it is the presumed default
explorerUrl: 'https://smartbit.com.au', explorerUrl: 'https://smartbit.com.au',
bitcoinJsNetwork: bitcoin.networks.bitcoin, bitcoinJsNetwork: bitcoin.networks.bitcoin,
unitPrefix: '' unitPrefix: ''

1
app/routes/app/containers/AppContainer.js

@ -376,6 +376,7 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
const receiveModalProps = { const receiveModalProps = {
isOpen: stateProps.address.walletModal, isOpen: stateProps.address.walletModal,
network: stateProps.info.network,
pubkey: stateProps.info.data.identity_pubkey, pubkey: stateProps.info.data.identity_pubkey,
address: stateProps.address.address, address: stateProps.address.address,
alias: stateProps.info.data.alias, alias: stateProps.info.data.alias,

1
test/reducers/__snapshots__/info.spec.js.snap

@ -27,6 +27,7 @@ Object {
"wif": 128, "wif": 128,
}, },
"explorerUrl": "https://smartbit.com.au", "explorerUrl": "https://smartbit.com.au",
"name": null,
"unitPrefix": "", "unitPrefix": "",
}, },
"showWalletCurrencyFilters": false, "showWalletCurrencyFilters": false,

Loading…
Cancel
Save