Jack Mallers
8 years ago
11 changed files with 251 additions and 12 deletions
@ -0,0 +1,44 @@ |
|||
// @flow
|
|||
import React, { Component } from 'react' |
|||
import ReactModal from 'react-modal' |
|||
import styles from './PeerForm.scss' |
|||
|
|||
class PeerForm extends Component { |
|||
render() { |
|||
const customStyles = { |
|||
overlay: { |
|||
cursor: 'pointer', |
|||
overflowY: 'auto' |
|||
}, |
|||
content : { |
|||
top: 'auto', |
|||
left: '20%', |
|||
right: '0', |
|||
bottom: 'auto', |
|||
width: '40%', |
|||
margin: '50px auto', |
|||
padding: '40px' |
|||
} |
|||
} |
|||
|
|||
const { form, setForm } = this.props |
|||
return ( |
|||
<div> |
|||
<ReactModal |
|||
isOpen={fosrm.isOpen} |
|||
contentLabel="No Overlay Click Modal" |
|||
ariaHideApp={true} |
|||
shouldCloseOnOverlayClick={true} |
|||
onRequestClose={() => setForm(false)} |
|||
parentSelector={() => document.body} |
|||
style={customStyles} |
|||
> |
|||
<h1>Peer form</h1> |
|||
</ReactModal> |
|||
</div> |
|||
) |
|||
} |
|||
} |
|||
|
|||
|
|||
export default PeerForm |
@ -0,0 +1,3 @@ |
|||
import PeerForm from './PeerForm' |
|||
|
|||
export default PeerForm |
@ -0,0 +1,69 @@ |
|||
// @flow
|
|||
import React, { Component } from 'react' |
|||
import ReactModal from 'react-modal' |
|||
import styles from './PeerModal.scss' |
|||
|
|||
class PeerModal extends Component { |
|||
render() { |
|||
const customStyles = { |
|||
overlay: { |
|||
cursor: 'pointer', |
|||
overflowY: 'auto' |
|||
}, |
|||
content : { |
|||
top: 'auto', |
|||
left: '20%', |
|||
right: '0', |
|||
bottom: 'auto', |
|||
width: '40%', |
|||
margin: '50px auto', |
|||
padding: '40px' |
|||
} |
|||
} |
|||
|
|||
const { isOpen, resetPeer, peer } = this.props |
|||
console.log('peer: ', peer) |
|||
return ( |
|||
<ReactModal |
|||
isOpen={isOpen} |
|||
contentLabel="No Overlay Click Modal" |
|||
ariaHideApp={true} |
|||
shouldCloseOnOverlayClick={true} |
|||
onRequestClose={() => resetPeer(null)} |
|||
parentSelector={() => document.body} |
|||
style={customStyles} |
|||
> |
|||
{ |
|||
peer ? |
|||
<div className={styles.peer}> |
|||
<header className={styles.header}> |
|||
<h1 data-hint='Peer address' className='hint--top-left'>{peer.address}</h1> |
|||
<h2 data-hint='Peer public key' className='hint--top-left'>{peer.pub_key}</h2> |
|||
</header> |
|||
|
|||
<div className={styles.details}> |
|||
<dl> |
|||
<dt>Satoshis Received</dt> |
|||
<dd>{peer.sat_recv}</dd> |
|||
<dt>Satoshis Sent</dt> |
|||
<dd>{peer.sat_sent}</dd> |
|||
<dt>Bytes Received</dt> |
|||
<dd>{peer.bytes_recv}</dd> |
|||
<dt>Bytes Sent</dt> |
|||
<dd>{peer.bytes_sent}</dd> |
|||
</dl> |
|||
</div> |
|||
<div className={styles.close}> |
|||
<div>Disconnect peer</div> |
|||
</div> |
|||
</div> |
|||
: |
|||
null |
|||
} |
|||
</ReactModal> |
|||
) |
|||
} |
|||
} |
|||
|
|||
|
|||
export default PeerModal |
@ -0,0 +1,73 @@ |
|||
@import '../../../../../../../variables.scss'; |
|||
|
|||
.peer { |
|||
padding: 40px; |
|||
} |
|||
|
|||
.header { |
|||
margin-bottom: 50px; |
|||
|
|||
h1 { |
|||
color: $black; |
|||
text-align: center; |
|||
margin-bottom: 5px; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
h2 { |
|||
color: $darkestgrey; |
|||
font-size: 14px; |
|||
text-align: center; |
|||
} |
|||
} |
|||
|
|||
.details { |
|||
width: 75%; |
|||
margin: 20px auto; |
|||
|
|||
dt { |
|||
text-align: left; |
|||
float: left; |
|||
clear: left; |
|||
font-weight: 500; |
|||
padding: 20px 35px 19px 0; |
|||
color: $black; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
dd { |
|||
text-align: right; |
|||
font-weight: 400; |
|||
padding: 19px 0; |
|||
margin-left: 0; |
|||
border-top: 1px solid $darkgrey; |
|||
} |
|||
} |
|||
|
|||
.close { |
|||
text-align: center; |
|||
|
|||
div { |
|||
width: 35%; |
|||
margin: 0 auto; |
|||
cursor: pointer; |
|||
height: 55px; |
|||
min-height: 55px; |
|||
text-transform: none; |
|||
font-size: 18px; |
|||
transition: opacity .2s ease-out; |
|||
background: $red; |
|||
color: $white; |
|||
border: none; |
|||
font-weight: 500; |
|||
padding: 0; |
|||
text-align: center; |
|||
line-height: 55px; |
|||
transition: all 0.25s; |
|||
border-radius: 5px; |
|||
|
|||
&:hover { |
|||
background: darken($red, 10%); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,3 @@ |
|||
import PeerModal from './PeerModal' |
|||
|
|||
export default PeerModal |
Loading…
Reference in new issue