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

2
app/reducers/info.js

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

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

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

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

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

Loading…
Cancel
Save