lbry-desktop/src/renderer/component/walletAddress/view.jsx

57 lines
1.6 KiB
React
Raw Normal View History

2018-03-26 23:32:43 +02:00
// @flow
import React from 'react';
2018-03-26 23:32:43 +02:00
import Button from 'component/button';
import Address from 'component/address';
2018-03-26 23:32:43 +02:00
import * as icons from 'constants/icons';
2018-03-26 23:32:43 +02:00
type Props = {
checkAddressIsMine: string => void,
receiveAddress: string,
getNewAddress: () => void,
gettingNewAddress: boolean,
};
class WalletAddress extends React.PureComponent<Props> {
componentWillMount() {
2017-06-06 23:19:12 +02:00
this.props.checkAddressIsMine(this.props.receiveAddress);
}
render() {
2017-06-06 23:19:12 +02:00
const { receiveAddress, getNewAddress, gettingNewAddress } = this.props;
return (
2018-03-26 23:32:43 +02:00
<section className="card card--section">
<div className="card__title">{__('Receive Credits')}</div>
<p className="card__subtitle">
{__('Use this wallet address to receive credits sent by another user (or yourself).')}
</p>
<div className="card__content">
<Address address={receiveAddress} showCopyButton />
</div>
2018-03-26 23:32:43 +02:00
<div className="card__actions">
2018-03-26 23:32:43 +02:00
<Button
button="primary"
label={__('Get New Address')}
2018-03-26 23:32:43 +02:00
icon={icons.REFRESH}
2017-06-06 23:19:12 +02:00
onClick={getNewAddress}
disabled={gettingNewAddress}
/>
</div>
<div className="card__content">
<div className="help">
2017-06-06 23:19:12 +02:00
<p>
{__(
'You can generate a new address at any time, and any previous addresses will continue to work. Using multiple addresses can be helpful for keeping track of incoming payments from multiple sources.'
2017-06-06 23:19:12 +02:00
)}
</p>
</div>
</div>
</section>
);
}
}
2017-06-06 06:21:55 +02:00
export default WalletAddress;