-
Peers
-
setPeerForm({ isOpen: true })}
- >
-
+}) => {
+ const refreshClicked = (event) => {
+ // store event in icon so we dont get an error when react clears it
+ let icon = event.currentTarget
+
+ // fetch peers
+ fetchPeers()
+
+ // clear animation after the second so we can reuse it
+ setTimeout(() => icon.style.animation = '', 1000)
+
+ // spin icon for 1 sec
+ icon.style.animation = 'spin 1000ms linear 1'
+ }
+
+ return (
+
+
+
+
+
Peers
+
+
+
+
setPeerForm({ isOpen: true })}
+ >
+
+
+
+ {
+ !peersLoading ?
+ peers.map(peer => )
+ :
+ 'Loading...'
+ }
+
-
- {
- !peersLoading ?
- peers.map(peer => )
- :
- 'Loading...'
- }
-
-
-)
+ )
+}
Peers.propTypes = {
peersLoading: PropTypes.bool.isRequired,
diff --git a/app/components/Peers/Peers.scss b/app/components/Peers/Peers.scss
index f24f6f70..613ce641 100644
--- a/app/components/Peers/Peers.scss
+++ b/app/components/Peers/Peers.scss
@@ -15,6 +15,20 @@
text-align: left;
}
+ .refresh {
+ cursor: pointer;
+ margin-left: 5px;
+ font-size: 12px;
+ vertical-align: top;
+ color: $darkestgrey;
+ line-height: 14px;
+ transition: color 0.25s;
+
+ &:hover {
+ color: $main;
+ }
+ }
+
.connectPeer {
float: right;
cursor: pointer;
diff --git a/app/routes/wallet/components/Wallet.js b/app/routes/wallet/components/Wallet.js
index 62081b61..07bc1a09 100644
--- a/app/routes/wallet/components/Wallet.js
+++ b/app/routes/wallet/components/Wallet.js
@@ -21,6 +21,7 @@ class Wallet extends Component {
ticker,
peers: { peersLoading, peers, peer, peerForm },
channels: { channelsLoading, channels, channel, channelForm, pendingChannels },
+ fetchPeers,
fetchChannels,
setPeer,
setChannel,
@@ -54,6 +55,7 @@ class Wallet extends Component {