Browse Source

fix(address): add new address button until address bug is tracked down

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
d4748bbdf5
  1. 11
      app/components/Wallet/ReceiveModal.js
  2. 13
      app/components/Wallet/ReceiveModal.scss
  3. 7
      app/components/Wallet/Wallet.js
  4. 6
      app/routes/activity/components/Activity.js
  5. 5
      app/routes/activity/containers/ActivityContainer.js

11
app/components/Wallet/ReceiveModal.js

@ -6,7 +6,7 @@ import QRCode from 'qrcode.react'
import { showNotification } from 'notifications'
import styles from './ReceiveModal.scss'
const ReceiveModal = ({ isOpen, hideActivityModal, pubkey, address }) => {
const ReceiveModal = ({ isOpen, hideActivityModal, pubkey, address, newAddress }) => {
const customStyles = {
overlay: {
cursor: 'pointer'
@ -43,8 +43,12 @@ const ReceiveModal = ({ isOpen, hideActivityModal, pubkey, address }) => {
</section>
<section>
<h4>Deposit Address (<span onClick={() => copyOnClick(address)}>Copy</span>)</h4>
<div className={styles.addressHeader}>
<h4>Deposit Address (<span onClick={() => copyOnClick(address)}>Copy</span>)</h4>
<span className={styles.newAddress} onClick={() => newAddress('p2pkh')}>New Address</span>
</div>
<p>{address}</p>
<div className={styles.qrcode}>
<QRCode value={address} />
</div>
@ -58,7 +62,8 @@ ReceiveModal.propTypes = {
isOpen: PropTypes.bool.isRequired,
hideActivityModal: PropTypes.func.isRequired,
pubkey: PropTypes.string.isRequired,
address: PropTypes.string.isRequired
address: PropTypes.string.isRequired,
newAddress: PropTypes.func.isRequired
}
export default ReceiveModal

13
app/components/Wallet/ReceiveModal.scss

@ -35,4 +35,15 @@
padding: 10px;
}
}
}
}
.addressHeader {
display: flex;
flex-direction: row;
justify-content: space-between;
.newAddress {
text-decoration: underline;
font-size: 12px;
}
}

7
app/components/Wallet/Wallet.js

@ -21,7 +21,8 @@ class Wallet extends Component {
const {
balance,
address,
info
info,
newAddress
} = this.props
const { modalOpen } = this.state
@ -35,6 +36,7 @@ class Wallet extends Component {
hideActivityModal={() => this.setState({ modalOpen: false })}
pubkey={info.data.identity_pubkey}
address={address}
newAddress={newAddress}
/>)
}
<div className={styles.content}>
@ -65,7 +67,8 @@ class Wallet extends Component {
Wallet.propTypes = {
balance: PropTypes.object.isRequired,
address: PropTypes.string.isRequired,
info: PropTypes.object.isRequired
info: PropTypes.object.isRequired,
newAddress: PropTypes.func.isRequired
}
export default Wallet

6
app/routes/activity/components/Activity.js

@ -55,7 +55,8 @@ class Activity extends Component {
changeFilter,
toggleFilterPulldown,
currentActivity,
nonActiveFilters
nonActiveFilters,
newAddress
} = this.props
if (invoiceLoading || paymentLoading) { return <div>Loading...</div> }
@ -70,7 +71,7 @@ class Activity extends Component {
currentTicker={currentTicker}
/>
<Wallet balance={balance} address={address} info={info} />
<Wallet balance={balance} address={address} info={info} newAddress={newAddress} />
<div className={styles.search}>
<label className={`${styles.label} ${styles.input}`} htmlFor='invoiceSearch'>
@ -130,6 +131,7 @@ Activity.propTypes = {
showActivityModal: PropTypes.func.isRequired,
hideActivityModal: PropTypes.func.isRequired,
changeFilter: PropTypes.func.isRequired,
newAddress: PropTypes.func.isRequired,
toggleFilterPulldown: PropTypes.func.isRequired,
activity: PropTypes.object.isRequired,
currentActivity: PropTypes.array.isRequired,

5
app/routes/activity/containers/ActivityContainer.js

@ -19,6 +19,8 @@ import {
toggleFilterPulldown,
activitySelectors
} from 'reducers/activity'
import { newAddress } from 'reducers/address'
import Activity from '../components/Activity'
const mapDispatchToProps = {
@ -31,7 +33,8 @@ const mapDispatchToProps = {
showActivityModal,
hideActivityModal,
changeFilter,
toggleFilterPulldown
toggleFilterPulldown,
newAddress
}
const mapStateToProps = state => ({

Loading…
Cancel
Save