12 changed files with 168 additions and 61 deletions
@ -0,0 +1,53 @@ |
|||
import React from 'react' |
|||
import PropTypes from 'prop-types' |
|||
import copy from 'copy-to-clipboard' |
|||
import { showNotification } from 'notifications' |
|||
import CryptoIcon from 'components/CryptoIcon' |
|||
import { btc, usd } from 'utils' |
|||
import styles from './Wallet.scss' |
|||
|
|||
const Wallet = ({ ticker, currentTicker, balance, address, pubkey }) => { |
|||
const copyOnClick = data => { |
|||
copy(data) |
|||
showNotification('Noice', 'Successfully copied to clipboard') |
|||
} |
|||
|
|||
return ( |
|||
<div className={styles.wallet}> |
|||
<div className={styles.content}> |
|||
<div className={styles.left}> |
|||
<div className={styles.leftContent}> |
|||
<CryptoIcon currency={ticker.crypto} /> |
|||
<div className={styles.details}> |
|||
<h1>{btc.satoshisToBtc(parseFloat(balance.walletBalance) + parseFloat(balance.channelBalance))} BTC</h1> |
|||
<span>{btc.satoshisToBtc(balance.walletBalance)} available</span> |
|||
<span>{btc.satoshisToBtc(balance.channelBalance)} in channels</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div className={styles.right}> |
|||
<div className={styles.rightContent}> |
|||
<div className={styles.data}> |
|||
<h2>Node public key (<span onClick={() => copyOnClick(pubkey)}>copy</span>)</h2> |
|||
<p>{pubkey}</p> |
|||
</div> |
|||
<div className={styles.data}> |
|||
<h2>Deposit address (<span onClick={() => copyOnClick(address)}>copy</span>)</h2> |
|||
<p>{address}</p> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
) |
|||
} |
|||
|
|||
Wallet.propTypes = { |
|||
ticker: PropTypes.object.isRequired, |
|||
currentTicker: PropTypes.object.isRequired, |
|||
balance: PropTypes.object.isRequired, |
|||
address: PropTypes.string.isRequired, |
|||
pubkey: PropTypes.string.isRequired |
|||
} |
|||
|
|||
export default Wallet |
@ -0,0 +1,78 @@ |
|||
@import '../../variables.scss'; |
|||
|
|||
.wallet { |
|||
cursor: pointer; |
|||
background: $lightgrey; |
|||
transition: background 0.25s; |
|||
|
|||
&:hover { |
|||
background: $darkgrey; |
|||
} |
|||
} |
|||
|
|||
.left, .right { |
|||
display: inline-block; |
|||
vertical-align: top; |
|||
width: 50%; |
|||
|
|||
.leftContent, .rightContent { |
|||
padding: 25px; |
|||
} |
|||
} |
|||
|
|||
.leftContent { |
|||
display: flex; |
|||
flex-direction: row; |
|||
|
|||
.details { |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content: center; |
|||
|
|||
h1 { |
|||
font-size: 24px; |
|||
font-weight: bold; |
|||
margin-bottom: 10px; |
|||
letter-spacing: 1.5px; |
|||
} |
|||
|
|||
span { |
|||
margin: 2.5px 0; |
|||
} |
|||
} |
|||
|
|||
svg { |
|||
font-size: 100px; |
|||
color: $main; |
|||
} |
|||
} |
|||
|
|||
.rightContent { |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content: center; |
|||
|
|||
.data { |
|||
margin: 10px 0; |
|||
|
|||
h2 { |
|||
margin-bottom: 5px; |
|||
text-transform: uppercase; |
|||
font-size: 10px; |
|||
letter-spacing: 1.5px; |
|||
|
|||
span { |
|||
color: #1DA1F2; |
|||
// text-decoration: underline; |
|||
} |
|||
} |
|||
|
|||
p { |
|||
font-size: 14px; |
|||
padding-bottom: 5px; |
|||
border-bottom: 1px solid $main; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
@ -0,0 +1,3 @@ |
|||
import Wallet from './Wallet' |
|||
|
|||
export default Wallet |
Binary file not shown.
Loading…
Reference in new issue