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 { showNotification } from 'notifications'
import styles from './ReceiveModal.scss' import styles from './ReceiveModal.scss'
const ReceiveModal = ({ isOpen, hideActivityModal, pubkey, address }) => { const ReceiveModal = ({ isOpen, hideActivityModal, pubkey, address, newAddress }) => {
const customStyles = { const customStyles = {
overlay: { overlay: {
cursor: 'pointer' cursor: 'pointer'
@ -43,8 +43,12 @@ const ReceiveModal = ({ isOpen, hideActivityModal, pubkey, address }) => {
</section> </section>
<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> <p>{address}</p>
<div className={styles.qrcode}> <div className={styles.qrcode}>
<QRCode value={address} /> <QRCode value={address} />
</div> </div>
@ -58,7 +62,8 @@ ReceiveModal.propTypes = {
isOpen: PropTypes.bool.isRequired, isOpen: PropTypes.bool.isRequired,
hideActivityModal: PropTypes.func.isRequired, hideActivityModal: PropTypes.func.isRequired,
pubkey: PropTypes.string.isRequired, pubkey: PropTypes.string.isRequired,
address: PropTypes.string.isRequired address: PropTypes.string.isRequired,
newAddress: PropTypes.func.isRequired
} }
export default ReceiveModal export default ReceiveModal

13
app/components/Wallet/ReceiveModal.scss

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

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

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

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

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

Loading…
Cancel
Save