(console.log('yo'))}>
+
Add
@@ -66,65 +77,18 @@ class Friends extends Component {
{
- activeChannels.length > 0 && activeChannels.map(activeChannel => {
- console.log('activeChannel: ', activeChannel)
- return (
- -
-
-
-
- Online
-
- {activeChannel.remote_pubkey}
-
-
-
- )
- })
- }
- {
- pendingOpenChannels.length > 0 && pendingOpenChannels.map(pendingOpenChannel => {
- console.log('pendingOpenChannel: ', pendingOpenChannel)
- return (
- -
-
-
-
-
- Pending
- shell.openExternal(`${'https://testnet.smartbit.com.au'}/tx/${pendingOpenChannel.channel.channel_point.split(':')[0]}`)}>
- (~{pendingOpenChannel.blocks_till_open * 10} minutes)
-
-
-
- {pendingOpenChannel.channel.remote_node_pub}
-
-
-
- )
- })
- }
- {
- nonActiveChannels.length > 0 && nonActiveChannels.map(nonActiveChannel => {
- console.log('nonActiveChannel: ', nonActiveChannel)
- return (
- -
-
-
-
- Offline
-
- {nonActiveChannel.remote_pubkey}
-
-
-
- )
+ currentChannels.length > 0 && currentChannels.map(channel => {
+ console.log('channel: ', channel)
+
+ if (channel.active) {
+ return
+ } else if (!channel.active) {
+ return
+ } else if (Object.prototype.hasOwnProperty.call(channel, 'blocks_till_open')) {
+ return
+ } else if (Object.prototype.hasOwnProperty.call(channel, 'closing_txid')) {
+ return
+ }
})
}
diff --git a/app/routes/friends/components/Friends.scss b/app/routes/friends/components/Friends.scss
index 3a17b59d..9cf4f14e 100644
--- a/app/routes/friends/components/Friends.scss
+++ b/app/routes/friends/components/Friends.scss
@@ -16,6 +16,12 @@
text-transform: uppercase;
font-size: 26px;
margin-right: 5px;
+
+ span {
+ display: inline-block;
+ vertical-align: middle;
+ font-size: 16px;
+ }
}
}
}
@@ -82,9 +88,27 @@
}
.friend {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
padding: 30px 0;
border-bottom: 1px solid $traditionalgrey;
+ .limits {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+
+ div {
+ margin: 0 10px;
+
+ h4 {
+ font-size: 12px;
+ margin-bottom: 20px;
+ }
+ }
+ }
+
.info {
p {
margin-bottom: 20px;
@@ -98,10 +122,28 @@
}
&.pending {
- color: #FF8A65;
+ color: $orange;
+
+ svg {
+ color: $orange;
+ }
+
+ i {
+ margin-left: 5px;
+ color: $darkestgrey;
+ cursor: pointer;
+
+ &:hover {
+ text-decoration: underline;
+ }
+ }
+ }
+
+ &.closing {
+ color: $red;
svg {
- color: #FF8A65;
+ color: $red;
}
i {
diff --git a/app/routes/friends/containers/FriendsContainer.js b/app/routes/friends/containers/FriendsContainer.js
index 90c23781..f5a2bde1 100644
--- a/app/routes/friends/containers/FriendsContainer.js
+++ b/app/routes/friends/containers/FriendsContainer.js
@@ -1,24 +1,76 @@
import { withRouter } from 'react-router'
import { connect } from 'react-redux'
-import { fetchChannels, channelsSelectors } from 'reducers/channels'
+import {
+ fetchChannels,
+ openChannel,
+ currentChannels,
+ channelsSelectors
+} from 'reducers/channels'
import { fetchPeers } from 'reducers/peers'
+import { fetchDescribeNetwork } from 'reducers/network'
+
+import {
+ openFriendsForm,
+ closeFriendsForm,
+ updateFriendFormSearchQuery,
+ friendFormSelectors
+} from 'reducers/friendsform'
+
import Friends from '../components/Friends'
const mapDispatchToProps = {
+ openFriendsForm,
+ closeFriendsForm,
+ updateFriendFormSearchQuery,
+ openChannel,
+
fetchChannels,
- fetchPeers
+ fetchPeers,
+ fetchDescribeNetwork
}
const mapStateToProps = state => ({
channels: state.channels,
peers: state.peers,
+ network: state.network,
+ friendsform: state.friendsform,
+ currentChannels: currentChannels(state),
activeChannels: channelsSelectors.activeChannels(state),
+ activeChannelPubkeys: channelsSelectors.activeChannelPubkeys(state),
nonActiveChannels: channelsSelectors.nonActiveChannels(state),
- pendingOpenChannels: channelsSelectors.pendingOpenChannels(state)
+ nonActiveChannelPubkeys: channelsSelectors.nonActiveChannelPubkeys(state),
+ pendingOpenChannels: channelsSelectors.pendingOpenChannels(state),
+ pendingOpenChannelPubkeys: channelsSelectors.pendingOpenChannelPubkeys(state),
+ closingPendingChannels: channelsSelectors.closingPendingChannels(state),
+
+ filteredNetworkNodes: friendFormSelectors.filteredNetworkNodes(state)
})
-export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Friends))
+const mergeProps = (stateProps, dispatchProps, ownProps) => {
+ const friendsFormProps = {
+ closeFriendsForm: dispatchProps.closeFriendsForm,
+ updateFriendFormSearchQuery: dispatchProps.updateFriendFormSearchQuery,
+ openChannel: dispatchProps.openChannel,
+
+ friendsform: stateProps.friendsform,
+ filteredNetworkNodes: stateProps.filteredNetworkNodes,
+
+ activeChannelPubkeys: stateProps.activeChannelPubkeys,
+ nonActiveChannelPubkeys: stateProps.nonActiveChannelPubkeys,
+ pendingOpenChannelPubkeys: stateProps.pendingOpenChannelPubkeys
+ }
+
+ return {
+ ...stateProps,
+ ...dispatchProps,
+ ...ownProps,
+
+ friendsFormProps
+ }
+}
+
+export default withRouter(connect(mapStateToProps, mapDispatchToProps, mergeProps)(Friends))
diff --git a/app/variables.scss b/app/variables.scss
index 214d8b7e..fdaf7d28 100644
--- a/app/variables.scss
+++ b/app/variables.scss
@@ -14,4 +14,5 @@ $green: #0bb634;
$terminalgreen: #00FF00;
$red: #ff0b00;
$blue: #007bb6;
+$orange: #FF8A65;
$curve: cubic-bezier(0.650, 0.000, 0.450, 1.000);
\ No newline at end of file