From f01924f2a2107ecb52f61258b6d1c66d4f874e9d Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Thu, 3 May 2018 13:08:38 -0500 Subject: [PATCH] feature(suggested-peers): hook up suggested peers form --- app/components/Contacts/AddChannel.js | 1 + app/components/Contacts/Network.js | 5 +++-- app/components/Contacts/SubmitChannelForm.js | 2 +- app/components/Contacts/SuggestedNodes.js | 14 +++++++++++--- app/components/Contacts/SuggestedNodes.scss | 6 ++++++ app/routes/app/containers/AppContainer.js | 5 ++++- 6 files changed, 26 insertions(+), 7 deletions(-) diff --git a/app/components/Contacts/AddChannel.js b/app/components/Contacts/AddChannel.js index b1047fb5..6fcce285 100644 --- a/app/components/Contacts/AddChannel.js +++ b/app/components/Contacts/AddChannel.js @@ -68,6 +68,7 @@ const AddChannel = ({ { + console.log('node: ', node) // set the node public key for the submit form setNode(node) // open the submit form diff --git a/app/components/Contacts/Network.js b/app/components/Contacts/Network.js index ecaab342..2dacb127 100644 --- a/app/components/Contacts/Network.js +++ b/app/components/Contacts/Network.js @@ -54,6 +54,7 @@ class Network extends Component { suggestedNodesProps } = this.props + console.log('currentChannels: ', currentChannels) const refreshClicked = () => { // turn the spinner on @@ -148,7 +149,7 @@ class Network extends Component { } { - loadingChannelPubkeys.length > 0 && currentChannels.length > 0 && + loadingChannelPubkeys.length > 0 || currentChannels.length > 0 &&

@@ -275,7 +276,7 @@ class Network extends Component { { - loadingChannelPubkeys.length > 0 && currentChannels.length > 0 && + loadingChannelPubkeys.length > 0 || currentChannels.length > 0 &&

- Connect + nodeClicked(node)}>Connect
) @@ -41,7 +47,9 @@ const SuggestedNodes = ({ suggestedNodesLoading, suggestedNodes }) => { SuggestedNodes.propTypes = { suggestedNodesLoading: PropTypes.bool.isRequired, - suggestedNodes: PropTypes.array.isRequired + suggestedNodes: PropTypes.array.isRequired, + setNode: PropTypes.func.isRequired, + openSubmitChannelForm: PropTypes.func.isRequired } export default SuggestedNodes diff --git a/app/components/Contacts/SuggestedNodes.scss b/app/components/Contacts/SuggestedNodes.scss index 42879717..2fb330a2 100644 --- a/app/components/Contacts/SuggestedNodes.scss +++ b/app/components/Contacts/SuggestedNodes.scss @@ -38,6 +38,12 @@ span { font-size: 10px; opacity: 0.5; + cursor: pointer; + transition: all 0.25s; + + &:hover { + opacity: 1; + } } } } diff --git a/app/routes/app/containers/AppContainer.js b/app/routes/app/containers/AppContainer.js index 69e810c0..3735ea83 100644 --- a/app/routes/app/containers/AppContainer.js +++ b/app/routes/app/containers/AppContainer.js @@ -319,7 +319,10 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => { suggestedNodesProps: { suggestedNodesLoading: stateProps.channels.suggestedNodesLoading, - suggestedNodes: stateProps.info.data.testnet ? stateProps.channels.suggestedNodes.testnet : stateProps.channels.suggestedNodes.mainnet + suggestedNodes: stateProps.info.data.testnet ? stateProps.channels.suggestedNodes.testnet : stateProps.channels.suggestedNodes.mainnet, + + setNode: dispatchProps.setNode, + openSubmitChannelForm: () => dispatchProps.setChannelFormType('SUBMIT_CHANNEL_FORM') } }