@@ -36,7 +38,7 @@ const Transaction = ({
0 ? styles.positive : styles.negative}`}>
- { transaction.amount > 0 ? '+' : '' }
+ 0 ? styles.plus : styles.minus}>{ transaction.amount > 0 ? '+' : '-' }
{
ticker.currency === 'usd' ?
btc.satoshisToUsd(transaction.amount, currentTicker.price_usd)
diff --git a/app/routes/activity/containers/ActivityContainer.js b/app/routes/activity/containers/ActivityContainer.js
index 1caa3a50..5437ca83 100644
--- a/app/routes/activity/containers/ActivityContainer.js
+++ b/app/routes/activity/containers/ActivityContainer.js
@@ -21,6 +21,7 @@ import {
updateSearchText
} from 'reducers/activity'
import { newAddress } from 'reducers/address'
+import { setFormType } from 'reducers/form'
import Activity from '../components/Activity'
@@ -36,7 +37,8 @@ const mapDispatchToProps = {
toggleFilterPulldown,
newAddress,
fetchBalance,
- updateSearchText
+ updateSearchText,
+ setFormType
}
const mapStateToProps = state => ({
@@ -62,4 +64,15 @@ const mapStateToProps = state => ({
nonActiveFilters: activitySelectors.nonActiveFilters(state)
})
-export default connect(mapStateToProps, mapDispatchToProps)(Activity)
+const mergeProps = (stateProps, dispatchProps, ownProps) => ({
+ ...stateProps,
+ ...dispatchProps,
+ ...ownProps,
+
+ // action to open the pay form
+ openPayForm: () => dispatchProps.setFormType('PAY_FORM'),
+ // action to open the request form
+ openRequestForm: () => dispatchProps.setFormType('REQUEST_FORM')
+})
+
+export default connect(mapStateToProps, mapDispatchToProps, mergeProps)(Activity)
diff --git a/app/routes/app/components/App.js b/app/routes/app/components/App.js
index 67333e36..401eb89f 100644
--- a/app/routes/app/components/App.js
+++ b/app/routes/app/components/App.js
@@ -1,19 +1,34 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
+
import GlobalError from 'components/GlobalError'
import LoadingBolt from 'components/LoadingBolt'
+
import Form from 'components/Form'
import ModalRoot from 'components/ModalRoot'
-import Nav from 'components/Nav'
+
+import Network from 'components/Contacts/Network'
+import ContactModal from 'components/Contacts/ContactModal'
+import ContactsForm from 'components/Contacts/ContactsForm'
+
import styles from './App.scss'
class App extends Component {
componentWillMount() {
- const { fetchTicker, fetchInfo, newAddress } = this.props
+ const { fetchTicker, fetchInfo, newAddress, fetchChannels, fetchBalance, fetchDescribeNetwork } = this.props
+ // fetch price ticker
fetchTicker()
+ // fetch node info
fetchInfo()
+ // fetch new address for wallet
newAddress('np2wkh')
+ // fetch nodes channels
+ fetchChannels()
+ // fetch nodes balance
+ fetchBalance()
+ // fetch LN network from nides POV
+ fetchDescribeNetwork()
}
render() {
@@ -24,14 +39,16 @@ class App extends Component {
currentTicker,
form,
- openPayForm,
- openRequestForm,
formProps,
closeForm,
error: { error },
clearError,
+ contactModalProps,
+ contactsFormProps,
+ networkTabProps,
+
children
} = this.props
@@ -49,16 +66,16 @@ class App extends Component {
currency={ticker.currency}
/>
-
+
+
-
+
{children}
+
+
)
}
@@ -71,17 +88,19 @@ App.propTypes = {
formProps: PropTypes.object.isRequired,
closeForm: PropTypes.func.isRequired,
error: PropTypes.object.isRequired,
+ currentTicker: PropTypes.object,
+ contactModalProps: PropTypes.object,
+ contactsFormProps: PropTypes.object,
+ networkTabProps: PropTypes.object,
newAddress: PropTypes.func.isRequired,
fetchInfo: PropTypes.func.isRequired,
hideModal: PropTypes.func.isRequired,
fetchTicker: PropTypes.func.isRequired,
- openPayForm: PropTypes.func.isRequired,
- openRequestForm: PropTypes.func.isRequired,
clearError: PropTypes.func.isRequired,
-
- currentTicker: PropTypes.object,
-
+ fetchChannels: PropTypes.func.isRequired,
+ fetchBalance: PropTypes.func.isRequired,
+ fetchDescribeNetwork: PropTypes.func.isRequired,
children: PropTypes.object.isRequired
}
diff --git a/app/routes/app/components/App.scss b/app/routes/app/components/App.scss
index c5018759..0f0a89cd 100644
--- a/app/routes/app/components/App.scss
+++ b/app/routes/app/components/App.scss
@@ -2,8 +2,7 @@
.content {
position: relative;
- width: 85%;
- height: 100vh;
+ width: 80%;
display: inline-block;
vertical-align: top;
overflow-y: scroll;
diff --git a/app/routes/app/containers/AppContainer.js b/app/routes/app/containers/AppContainer.js
index e670af8b..b1e4ab65 100644
--- a/app/routes/app/containers/AppContainer.js
+++ b/app/routes/app/containers/AppContainer.js
@@ -1,6 +1,8 @@
import { withRouter } from 'react-router'
import { connect } from 'react-redux'
+
import { fetchTicker, setCurrency, tickerSelectors } from 'reducers/ticker'
+
import { newAddress } from 'reducers/address'
import { fetchInfo } from 'reducers/info'
@@ -8,23 +10,54 @@ import { fetchInfo } from 'reducers/info'
import { showModal, hideModal } from 'reducers/modal'
import { setFormType } from 'reducers/form'
+
import { setPayAmount, setPayInput, updatePayErrors, payFormSelectors } from 'reducers/payform'
+
import { setRequestAmount, setRequestMemo } from 'reducers/requestform'
import { sendCoins } from 'reducers/transaction'
+
import { payInvoice } from 'reducers/payment'
+
import { createInvoice, fetchInvoice } from 'reducers/invoice'
import { fetchBlockHeight, lndSelectors } from 'reducers/lnd'
-import { clearError } from 'reducers/error'
+import {
+ fetchChannels,
+ openChannel,
+ closeChannel,
+ channelsSelectors,
+ currentChannels,
+ toggleFilterPulldown,
+ changeFilter,
+ updateChannelSearchQuery,
+ openContactModal,
+ closeContactModal
+} from 'reducers/channels'
+
+import {
+ openContactsForm,
+ closeContactsForm,
+ updateContactFormSearchQuery,
+ updateManualFormSearchQuery,
+ updateContactCapacity,
+ contactFormSelectors,
+ updateManualFormErrors
+} from 'reducers/contactsform'
+
+import { fetchBalance } from 'reducers/balance'
+
+import { fetchDescribeNetwork } from 'reducers/network'
+import { clearError } from 'reducers/error'
import App from '../components/App'
const mapDispatchToProps = {
fetchTicker,
setCurrency,
+
newAddress,
fetchInfo,
@@ -48,7 +81,28 @@ const mapDispatchToProps = {
fetchInvoice,
fetchBlockHeight,
- clearError
+ clearError,
+
+ fetchBalance,
+
+ fetchChannels,
+ openChannel,
+ closeChannel,
+ toggleFilterPulldown,
+ changeFilter,
+ updateChannelSearchQuery,
+ openContactModal,
+ closeContactModal,
+
+ openContactsForm,
+ closeContactsForm,
+ updateContactFormSearchQuery,
+ updateManualFormSearchQuery,
+ updateContactCapacity,
+ contactFormSelectors,
+ updateManualFormErrors,
+
+ fetchDescribeNetwork
}
const mapStateToProps = state => ({
@@ -59,6 +113,10 @@ const mapStateToProps = state => ({
info: state.info,
payment: state.payment,
transaction: state.transaction,
+ peers: state.peers,
+ channels: state.channels,
+ contactsform: state.contactsform,
+ balance: state.balance,
form: state.form,
payform: state.payform,
@@ -69,6 +127,8 @@ const mapStateToProps = state => ({
error: state.error,
+ network: state.network,
+
currentTicker: tickerSelectors.currentTicker(state),
isOnchain: payFormSelectors.isOnchain(state),
isLn: payFormSelectors.isLn(state),
@@ -76,7 +136,18 @@ const mapStateToProps = state => ({
inputCaption: payFormSelectors.inputCaption(state),
showPayLoadingScreen: payFormSelectors.showPayLoadingScreen(state),
payFormIsValid: payFormSelectors.payFormIsValid(state),
- syncPercentage: lndSelectors.syncPercentage(state)
+ syncPercentage: lndSelectors.syncPercentage(state),
+
+ filteredNetworkNodes: contactFormSelectors.filteredNetworkNodes(state),
+ showManualForm: contactFormSelectors.showManualForm(state),
+ manualFormIsValid: contactFormSelectors.manualFormIsValid(state),
+
+ currentChannels: currentChannels(state),
+ activeChannelPubkeys: channelsSelectors.activeChannelPubkeys(state),
+ nonActiveChannelPubkeys: channelsSelectors.nonActiveChannelPubkeys(state),
+ pendingOpenChannelPubkeys: channelsSelectors.pendingOpenChannelPubkeys(state),
+ nonActiveFilters: channelsSelectors.nonActiveFilters(state),
+ channelNodes: channelsSelectors.channelNodes(state)
})
const mergeProps = (stateProps, dispatchProps, ownProps) => {
@@ -172,20 +243,70 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
return {}
}
+ const networkTabProps = {
+ currentChannels: stateProps.currentChannels,
+ channels: stateProps.channels,
+ balance: stateProps.balance,
+ currentTicker: stateProps.currentTicker,
+ contactsform: stateProps.contactsform,
+ nodes: stateProps.network.nodes,
+ nonActiveFilters: stateProps.nonActiveFilters,
+
+ fetchChannels: dispatchProps.fetchChannels,
+ openContactsForm: dispatchProps.openContactsForm,
+ contactFormSelectors: dispatchProps.contactFormSelectors,
+ updateManualFormError: dispatchProps.updateManualFormErrors,
+ toggleFilterPulldown: dispatchProps.toggleFilterPulldown,
+ changeFilter: dispatchProps.changeFilter,
+ updateChannelSearchQuery: dispatchProps.updateChannelSearchQuery,
+ openContactModal: dispatchProps.openContactModal
+ }
+
+ const contactsFormProps = {
+ closeContactsForm: dispatchProps.closeContactsForm,
+ updateContactFormSearchQuery: dispatchProps.updateContactFormSearchQuery,
+ updateManualFormSearchQuery: dispatchProps.updateManualFormSearchQuery,
+ updateContactCapacity: dispatchProps.updateContactCapacity,
+ openChannel: dispatchProps.openChannel,
+ updateManualFormErrors: dispatchProps.updateManualFormErrors,
+
+ contactsform: stateProps.contactsform,
+ filteredNetworkNodes: stateProps.filteredNetworkNodes,
+ loadingChannelPubkeys: stateProps.channels.loadingChannelPubkeys,
+ showManualForm: stateProps.showManualForm,
+ manualFormIsValid: stateProps.manualFormIsValid,
+ activeChannelPubkeys: stateProps.activeChannelPubkeys,
+ nonActiveChannelPubkeys: stateProps.nonActiveChannelPubkeys,
+ pendingOpenChannelPubkeys: stateProps.pendingOpenChannelPubkeys
+ }
+
+ const contactModalProps = {
+ closeContactModal: dispatchProps.closeContactModal,
+ closeChannel: dispatchProps.closeChannel,
+
+ isOpen: stateProps.channels.contactModal.isOpen,
+ channel: stateProps.channels.contactModal.channel,
+ channelNodes: stateProps.channelNodes,
+ closingChannelIds: stateProps.channels.closingChannelIds
+ }
+
return {
...stateProps,
...dispatchProps,
...ownProps,
+ // props for the network sidebar
+ networkTabProps,
+ // props for the contacts form
+ contactsFormProps,
+ // props for the contact modal
+ contactModalProps,
// Props to pass to the pay form
formProps: formProps(stateProps.form.formType),
- // action to open the pay form
- openPayForm: () => dispatchProps.setFormType('PAY_FORM'),
- // action to open the request form
- openRequestForm: () => dispatchProps.setFormType('REQUEST_FORM'),
// action to close form
closeForm: () => dispatchProps.setFormType(null)
+
}
}
diff --git a/app/routes/contacts/components/Contacts.js b/app/routes/contacts/components/Contacts.js
deleted file mode 100644
index d2057fa3..00000000
--- a/app/routes/contacts/components/Contacts.js
+++ /dev/null
@@ -1,196 +0,0 @@
-import React, { Component } from 'react'
-import PropTypes from 'prop-types'
-
-import Isvg from 'react-inlinesvg'
-import { MdSearch } from 'react-icons/lib/md'
-import { FaAngleDown, FaRepeat } from 'react-icons/lib/fa'
-
-import ContactModal from 'components/Contacts/ContactModal'
-import ContactsForm from 'components/Contacts/ContactsForm'
-import OnlineContact from 'components/Contacts/OnlineContact'
-import PendingContact from 'components/Contacts/PendingContact'
-import ClosingContact from 'components/Contacts/ClosingContact'
-import OfflineContact from 'components/Contacts/OfflineContact'
-import LoadingContact from 'components/Contacts/LoadingContact'
-
-import plus from 'icons/plus.svg'
-
-import styles from './Contacts.scss'
-
-class Contacts extends Component {
- constructor(props) {
- super(props)
-
- this.state = {
- refreshing: false
- }
- }
-
- componentWillMount() {
- const { fetchChannels, fetchPeers, fetchDescribeNetwork } = this.props
-
- fetchChannels()
- fetchPeers()
- fetchDescribeNetwork()
- }
-
- render() {
- const {
- channels: {
- searchQuery,
- filterPulldown,
- filter,
- loadingChannelPubkeys,
- closingChannelIds
- },
- currentChannels,
- activeChannels,
- fetchChannels,
- updateChannelSearchQuery,
-
- toggleFilterPulldown,
- changeFilter,
- nonActiveFilters,
-
- openContactsForm,
- openContactModal,
-
- contactModalProps,
- contactsFormProps
- } = this.props
-
- console.log('currentChannels: ', currentChannels)
- const refreshClicked = () => {
- // turn the spinner on
- this.setState({ refreshing: true })
-
- // store event in icon so we dont get an error when react clears it
- const icon = this.repeat.childNodes
-
- // fetch channels
- fetchChannels()
-
- // wait for the svg to appear as child
- const svgTimeout = setTimeout(() => {
- if (icon[0].tagName === 'svg') {
- // spin icon for 1 sec
- icon[0].style.animation = 'spin 1000ms linear 1'
- clearTimeout(svgTimeout)
- }
- }, 1)
-
- // clear animation after the second so we can reuse it
- const refreshTimeout = setTimeout(() => {
- icon[0].style.animation = ''
- this.setState({ refreshing: false })
- clearTimeout(refreshTimeout)
- }, 1000)
- }
-
- return (
-
-
-
-
-
-
-
-
- updateChannelSearchQuery(event.target.value)}
- className={`${styles.text} ${styles.input}`}
- placeholder='Search your contacts list...'
- type='text'
- id='channelSearch'
- />
-
-
-
-
-
- {filter.name}
-
-
- {
- nonActiveFilters.map(f => (
- - changeFilter(f)}>
- {f.name}
-
- ))
- }
-
-
-
- { this.repeat = ref }}>
- {
- this.state.refreshing ?
-
- :
- 'Refresh'
- }
-
-
-
-
-
- {
- loadingChannelPubkeys.map(pubkey => )
- }
-
- {
- currentChannels.length > 0 && currentChannels.map((channel, index) => {
- if (closingChannelIds.includes(channel.chan_id)) {
- return
- } else if (Object.prototype.hasOwnProperty.call(channel, 'confirmation_height')) {
- return
- } else if (Object.prototype.hasOwnProperty.call(channel, 'closing_txid')) {
- return
- } else if (!channel.active) {
- return
- }
- return
- })
- }
-
-
- )
- }
-}
-
-Contacts.propTypes = {
- fetchPeers: PropTypes.func.isRequired,
- fetchDescribeNetwork: PropTypes.func.isRequired,
-
- channels: PropTypes.object.isRequired,
- currentChannels: PropTypes.array.isRequired,
- activeChannels: PropTypes.array.isRequired,
- fetchChannels: PropTypes.func.isRequired,
- updateChannelSearchQuery: PropTypes.func.isRequired,
-
- toggleFilterPulldown: PropTypes.func.isRequired,
- changeFilter: PropTypes.func.isRequired,
- nonActiveFilters: PropTypes.array.isRequired,
-
- openContactsForm: PropTypes.func.isRequired,
- openContactModal: PropTypes.func.isRequired,
-
- contactModalProps: PropTypes.object.isRequired,
- contactsFormProps: PropTypes.object.isRequired
-}
-
-export default Contacts
diff --git a/app/routes/contacts/components/Contacts.scss b/app/routes/contacts/components/Contacts.scss
deleted file mode 100644
index 5440ef3e..00000000
--- a/app/routes/contacts/components/Contacts.scss
+++ /dev/null
@@ -1,172 +0,0 @@
-@import '../../../variables.scss';
-
-.header {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- background: $lightgrey;
-
- .titleContainer {
- padding: 20px 40px;
-
- .left {
- padding: 10px 0;
-
- h1 {
- text-transform: uppercase;
- font-size: 26px;
- margin-right: 5px;
-
- span {
- display: inline-block;
- vertical-align: middle;
- font-size: 16px;
- }
- }
- }
- }
-
- .newFriendContainer {
- padding: 20px 40px;
-
- .newFriendButton {
- box-shadow: none;
- transition: all 0.25s;
- padding-top: 12px;
- padding-bottom: 10px;
- font-size: 14px;
-
- &:hover {
- background: darken($main, 10%);
- }
-
- span {
- display: inline-block;
- vertical-align: top;
-
- &:nth-child(1) svg {
- width: 14px;
- height: 14px;
- margin-right: 5px;
- }
- }
- }
- }
-}
-
-.search {
- height: 55px;
- padding: 2px 25px;
- border-top: 1px solid $darkgrey;
- border-bottom: 1px solid $darkgrey;
- background: $white;
-
- .input {
- display: inline-block;
- vertical-align: top;
- height: 100%;
- }
-
- .label {
- width: 5%;
- line-height: 50px;
- font-size: 20px;
- text-align: center;
- cursor: pointer;
- }
-
- .text {
- width: 95%;
- outline: 0;
- padding: 0;
- border: 0;
- border-radius: 0;
- height: 50px;
- font-size: 16px;
- }
-}
-
-.filtersContainer {
- position: relative;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- margin-top: 20px;
- padding: 20px 40px;
-
- h2, h2 span {
- color: $bluegrey;
- cursor: pointer;
- transition: color 0.25s;
-
- &:hover {
- color: lighten($bluegrey, 10%);
- }
- }
-
- h2, .filters li {
- text-transform: uppercase;
- letter-spacing: 1.5px;
- color: $darkestgrey;
- font-size: 14px;
- font-weight: 400;
- }
-
- h2 span.pulldown {
- color: $main;
- }
-
- .filters {
- display: none;
-
- &.active {
- display: block;
- position: absolute;
- bottom: -100px;
- z-index: 10;
-
- li {
- margin: 5px 0;
- cursor: pointer;
-
- &:hover {
- color: $main;
- }
- }
- }
- }
-
- .refreshContainer {
- text-align: right;
- cursor: pointer;
-
- .refresh {
- cursor: pointer;
- color: $darkestgrey;
- transition: all 0.25s;
-
- &:hover {
- color: $main;
- }
-
- svg {
- font-size: 12px;
- color: $darkestgrey;
-
- &:hover {
- color: $darkestgrey;
- }
- }
- }
- }
-}
-
-.friends {
- padding: 10px 0 60px 0;
- opacity: 1;
- transition: all 0.25s;
-
- &.fade {
- opacity: 0.05;
- }
-}
diff --git a/app/routes/contacts/containers/ContactsContainer.js b/app/routes/contacts/containers/ContactsContainer.js
deleted file mode 100644
index 017dac01..00000000
--- a/app/routes/contacts/containers/ContactsContainer.js
+++ /dev/null
@@ -1,115 +0,0 @@
-import { withRouter } from 'react-router'
-import { connect } from 'react-redux'
-
-import {
- fetchChannels,
- openChannel,
- closeChannel,
-
- updateChannelSearchQuery,
- toggleFilterPulldown,
- changeFilter,
- openContactModal,
- closeContactModal,
- currentChannels,
-
- channelsSelectors
-} from 'reducers/channels'
-
-import { fetchPeers } from 'reducers/peers'
-
-import { fetchDescribeNetwork } from 'reducers/network'
-
-import {
- openContactsForm,
- closeContactsForm,
- updateContactFormSearchQuery,
- updateManualFormSearchQuery,
- updateContactCapacity,
- contactFormSelectors,
- updateManualFormErrors
-} from 'reducers/contactsform'
-
-import Contacts from '../components/Contacts'
-
-const mapDispatchToProps = {
- openContactsForm,
- closeContactsForm,
- openContactModal,
- closeContactModal,
- updateContactFormSearchQuery,
- updateManualFormSearchQuery,
- updateContactCapacity,
- openChannel,
- closeChannel,
- updateChannelSearchQuery,
- toggleFilterPulldown,
- changeFilter,
- updateManualFormErrors,
- fetchChannels,
- fetchPeers,
- fetchDescribeNetwork
-}
-
-const mapStateToProps = state => ({
- channels: state.channels,
- peers: state.peers,
- network: state.network,
- contactsform: state.contactsform,
-
- currentChannels: currentChannels(state),
- activeChannels: channelsSelectors.activeChannels(state),
- activeChannelPubkeys: channelsSelectors.activeChannelPubkeys(state),
- nonActiveChannels: channelsSelectors.nonActiveChannels(state),
- nonActiveChannelPubkeys: channelsSelectors.nonActiveChannelPubkeys(state),
- pendingOpenChannels: channelsSelectors.pendingOpenChannels(state),
- pendingOpenChannelPubkeys: channelsSelectors.pendingOpenChannelPubkeys(state),
- closingPendingChannels: channelsSelectors.closingPendingChannels(state),
- nonActiveFilters: channelsSelectors.nonActiveFilters(state),
- channelNodes: channelsSelectors.channelNodes(state),
-
- filteredNetworkNodes: contactFormSelectors.filteredNetworkNodes(state),
- showManualForm: contactFormSelectors.showManualForm(state),
- manualFormIsValid: contactFormSelectors.manualFormIsValid(state)
-})
-
-const mergeProps = (stateProps, dispatchProps, ownProps) => {
- const contactModalProps = {
- closeContactModal: dispatchProps.closeContactModal,
- closeChannel: dispatchProps.closeChannel,
-
- isOpen: stateProps.channels.contactModal.isOpen,
- channel: stateProps.channels.contactModal.channel,
- channelNodes: stateProps.channelNodes,
- closingChannelIds: stateProps.channels.closingChannelIds,
- manualFormIsValid: stateProps.manualFormIsValid
- }
-
- const contactsFormProps = {
- closeContactsForm: dispatchProps.closeContactsForm,
- updateContactFormSearchQuery: dispatchProps.updateContactFormSearchQuery,
- updateManualFormSearchQuery: dispatchProps.updateManualFormSearchQuery,
- updateContactCapacity: dispatchProps.updateContactCapacity,
- openChannel: dispatchProps.openChannel,
- contactsform: stateProps.contactsform,
- filteredNetworkNodes: stateProps.filteredNetworkNodes,
- loadingChannelPubkeys: stateProps.channels.loadingChannelPubkeys,
- showManualForm: stateProps.showManualForm,
- manualFormIsValid: stateProps.manualFormIsValid,
- activeChannelPubkeys: stateProps.activeChannelPubkeys,
- nonActiveChannelPubkeys: stateProps.nonActiveChannelPubkeys,
- pendingOpenChannelPubkeys: stateProps.pendingOpenChannelPubkeys,
- updateManualFormErrors: dispatchProps.updateManualFormErrors
- }
-
- return {
- ...stateProps,
- ...dispatchProps,
- ...ownProps,
-
- contactModalProps,
- contactsFormProps
- }
-}
-
-export default withRouter(connect(mapStateToProps, mapDispatchToProps, mergeProps)(Contacts))
diff --git a/app/routes/contacts/index.js b/app/routes/contacts/index.js
deleted file mode 100644
index 20acba65..00000000
--- a/app/routes/contacts/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import ContactsContainer from './containers/ContactsContainer'
-
-export default ContactsContainer
diff --git a/app/routes/help/components/Help.js b/app/routes/help/components/Help.js
deleted file mode 100644
index 0eb5f8d6..00000000
--- a/app/routes/help/components/Help.js
+++ /dev/null
@@ -1,88 +0,0 @@
-import { shell } from 'electron'
-import React, { Component } from 'react'
-
-import { MdSearch } from 'react-icons/lib/md'
-
-import styles from './Help.scss'
-
-class Help extends Component {
- constructor(props) {
- super(props)
-
- this.state = {
- videos: [
- {
- id: '8kZq6eec49A',
- title: 'Syncing and Depositing - Zap Lightning Network Wallet Tutorial (Video 1)'
- },
- {
- id: 'xSiTH63fOQM',
- title: 'Adding a contact - Zap Lightning Network Wallet Tutorial (Video 2)'
- },
- {
- id: 'c0SLmywYDHU',
- title: 'Making a Lightning Network payment - Zap Lightning Network Wallet Tutorial (Video 3)'
- },
- {
- id: 'Xrx2TiiF90Q',
- title: 'Receive Lightning Network payment - Zap Lightning Network Wallet Tutorial (Video 4)'
- },
- {
- id: 'YfxukBHnwUM',
- title: 'Network Map - Zap Lightning Network Wallet Tutorial (Video 5)'
- },
- {
- id: 'NORklrrYzOg',
- title: 'Using an explorer to add Zap contacts - Zap Lightning Network Wallet Tutorial (Video 6)'
- }
- ],
- searchQuery: ''
- }
- }
-
- render() {
- const { videos, searchQuery } = this.state
- const filteredVideos = videos.filter(video => video.title.includes(searchQuery))
-
- return (
-
-
-
-
-
- this.setState({ searchQuery: event.target.value })}
- className={`${styles.text} ${styles.input}`}
- placeholder='Search the video library...'
- type='text'
- id='helpSearch'
- />
-
-
-
- {
- filteredVideos.map((video, index) => (
- -
-
- shell.openExternal(`https://www.youtube.com/watch?v=${video.id}`)}>
-
{video.title}
-
-
- ))
- }
-
-
- )
- }
-}
-
-export default Help
diff --git a/app/routes/help/components/Help.scss b/app/routes/help/components/Help.scss
deleted file mode 100644
index a4e74818..00000000
--- a/app/routes/help/components/Help.scss
+++ /dev/null
@@ -1,90 +0,0 @@
-@import '../../../variables.scss';
-
-.header {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- background: $lightgrey;
- padding: 20px 40px;
-
- h1 {
- text-transform: uppercase;
- font-size: 26px;
- margin-right: 5px;
- }
-}
-
-.search {
- height: 55px;
- padding: 2px 25px;
- border-top: 1px solid $darkgrey;
- border-bottom: 1px solid $darkgrey;
- background: $white;
-
- .input {
- display: inline-block;
- vertical-align: top;
- height: 100%;
- }
-
- .label {
- width: 5%;
- line-height: 50px;
- font-size: 20px;
- text-align: center;
- cursor: pointer;
- }
-
- .text {
- width: 95%;
- outline: 0;
- padding: 0;
- border: 0;
- border-radius: 0;
- height: 50px;
- font-size: 16px;
- }
-}
-
-.videos {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- justify-content: space-around;
- padding: 20px 40px;
-
- li {
- position: relative;
- width: 50%;
- text-align: center;
- margin: 20px 0;
- width: 400px;
- height: 400px;
- transition: all 0.25s;
-
- &:hover {
- opacity: 0.5;
-
- .info {
- padding: 50px 15px;
- }
- }
-
- iframe {
- width: 100%;
- height: 100%;
- }
-
- .info {
- position: absolute;
- bottom: 0;
- width: calc(100% - 30px);
- padding: 15px;
- background: $darkgrey;
- cursor: pointer;
- transition: all 0.25s;
- text-align: left;
- line-height: 1.5;
- }
- }
-}
diff --git a/app/routes/help/containers/HelpContainer.js b/app/routes/help/containers/HelpContainer.js
deleted file mode 100644
index 37165e99..00000000
--- a/app/routes/help/containers/HelpContainer.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import { withRouter } from 'react-router'
-import { connect } from 'react-redux'
-
-import Help from '../components/Help'
-
-const mapDispatchToProps = {}
-
-const mapStateToProps = () => ({})
-
-export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Help))
diff --git a/app/routes/help/index.js b/app/routes/help/index.js
deleted file mode 100644
index c470f24b..00000000
--- a/app/routes/help/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import HelpContainer from './containers/HelpContainer'
-
-export default HelpContainer
diff --git a/app/routes/network/components/Network.js b/app/routes/network/components/Network.js
deleted file mode 100644
index 87cf40dd..00000000
--- a/app/routes/network/components/Network.js
+++ /dev/null
@@ -1,168 +0,0 @@
-import React, { Component } from 'react'
-import PropTypes from 'prop-types'
-
-import CanvasNetworkGraph from 'components/Network/CanvasNetworkGraph'
-import PeersList from 'components/Network/PeersList'
-import ChannelsList from 'components/Network/ChannelsList'
-import TransactionForm from 'components/Network/TransactionForm'
-
-import styles from './Network.scss'
-
-class Network extends Component {
- componentWillMount() {
- const { fetchDescribeNetwork, fetchPeers, fetchChannels } = this.props
-
- fetchPeers()
- fetchChannels()
- fetchDescribeNetwork()
- }
-
- componentDidUpdate(prevProps) {
- const {
- payReqIsLn, network: { pay_req }, fetchInvoiceAndQueryRoutes, clearQueryRoutes
- } = this.props
-
- // If LN go retrieve invoice details
- if ((prevProps.network.pay_req !== pay_req) && payReqIsLn) {
- fetchInvoiceAndQueryRoutes(pay_req)
- }
-
- if (prevProps.payReqIsLn && !payReqIsLn) {
- clearQueryRoutes()
- }
- }
-
- componentWillUnmount() {
- const {
- clearQueryRoutes, resetPayReq, clearSelectedChannels, clearSelectedPeers
- } = this.props
-
- clearQueryRoutes()
- resetPayReq()
- clearSelectedChannels()
- clearSelectedPeers()
- }
-
- render() {
- const {
- setCurrentTab,
- updateSelectedPeers,
- setCurrentRoute,
-
- network,
- selectedPeerPubkeys,
- currentRouteChanIds,
-
- peers: { peers },
-
- activeChannels,
- selectedChannelIds,
- updateSelectedChannels,
-
- updatePayReq,
-
- identity_pubkey
- } = this.props
-
- const renderContent = () => {
- switch (network.currentTab) {
- case 1:
- return
- case 2:
- return
- case 3:
- return (
-
- )
- default:
- return
- }
- }
-
- return (
-
- {
- !network.networkLoading &&
-
- {network.nodes.length} nodes
- |
- {network.edges.length} channels
-
- }
-
-
-
-
-
- - setCurrentTab(1)}
- >
- Peers
-
- - setCurrentTab(2)}
- >
- Channels
-
- - setCurrentTab(3)}
- >
- Transactions
-
-
-
-
- {renderContent()}
-
-
-
- )
- }
-}
-
-Network.propTypes = {
- fetchDescribeNetwork: PropTypes.func.isRequired,
- fetchPeers: PropTypes.func.isRequired,
- setCurrentTab: PropTypes.func.isRequired,
- fetchChannels: PropTypes.func.isRequired,
- fetchInvoiceAndQueryRoutes: PropTypes.func.isRequired,
- clearQueryRoutes: PropTypes.func.isRequired,
- resetPayReq: PropTypes.func.isRequired,
- clearSelectedChannels: PropTypes.func.isRequired,
- clearSelectedPeers: PropTypes.func.isRequired,
- updateSelectedPeers: PropTypes.func.isRequired,
- setCurrentRoute: PropTypes.func.isRequired,
- updateSelectedChannels: PropTypes.func.isRequired,
- updatePayReq: PropTypes.func.isRequired,
-
- network: PropTypes.object.isRequired,
- peers: PropTypes.object.isRequired,
-
- selectedPeerPubkeys: PropTypes.array.isRequired,
- currentRouteChanIds: PropTypes.array.isRequired,
- activeChannels: PropTypes.array.isRequired,
- selectedChannelIds: PropTypes.array.isRequired,
-
- identity_pubkey: PropTypes.string.isRequired,
-
- payReqIsLn: PropTypes.bool.isRequired
-}
-
-export default Network
diff --git a/app/routes/network/components/Network.scss b/app/routes/network/components/Network.scss
deleted file mode 100644
index bc7a8531..00000000
--- a/app/routes/network/components/Network.scss
+++ /dev/null
@@ -1,99 +0,0 @@
-@import '../../../variables.scss';
-
-@keyframes dash {
- to {
- stroke-dashoffset: 1000;
- }
-}
-
-@keyframes fadein {
- 0% { background: $white; }
- 50% { background: lighten($secondary, 50%); }
- 100% { background: $secondary; animation-fill-mode:forwards; }
-}
-
-.container {
- width: 100%;
- height: 100vh;
- animation: fadein 0.5s;
- animation-timing-function:linear;
- animation-fill-mode:forwards;
- animation-iteration-count: 1;
-
- line.active {
- opacity: 1;
- stroke: green;
- stroke-width: 5;
- stroke-dasharray: 100;
- animation: dash 2.5s infinite linear;
- }
-
- circle {
- cursor: pointer;
- }
-
- .stats {
- position: absolute;
- top: 0;
- right: 30%;
- padding: 20px;
-
- span {
- color: $main;
- margin: 0 2.5px;
- line-height: 25px;
- vertical-align: middle;
-
- &:nth-child(2) {
- font-size: 25px;
- }
- }
- }
-}
-
-.network, .toolbox {
- display: inline-block;
- vertical-align: top;
- height: 100vh;
-}
-
-.network {
- width: 70%;
-}
-
-.toolbox {
- width: 30%;
- height: 100%;
- background: #353535;
- overflow-y: scroll;
-}
-
-.tabs {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- padding-top: 40px;
-
- .tab {
- color: $white;
- text-align: center;
- cursor: pointer;
- width: 100%;
- padding: 10px 0;
- border-bottom: 1px solid #464646;
- transition: all 0.5s;
-
- &.peersTab:hover, &.peersTab.active {
- border-bottom: 1px solid #588CF0;
- }
-
- &.channelsTab:hover, &.channelsTab.active {
- border-bottom: 1px solid #88D4A2;
- }
-
- &.transactionsTab:hover, &.transactionsTab.active {
- border-bottom: 1px solid #FFDC53;
- }
- }
-}
diff --git a/app/routes/network/containers/NetworkContainer.js b/app/routes/network/containers/NetworkContainer.js
deleted file mode 100644
index a429744c..00000000
--- a/app/routes/network/containers/NetworkContainer.js
+++ /dev/null
@@ -1,62 +0,0 @@
-import { withRouter } from 'react-router'
-import { connect } from 'react-redux'
-
-import {
- fetchDescribeNetwork,
-
- setCurrentTab,
-
- updateSelectedPeers,
- clearSelectedPeers,
-
- updateSelectedChannels,
- clearSelectedChannels,
-
- setCurrentRoute,
-
- updatePayReq,
- resetPayReq,
-
- fetchInvoiceAndQueryRoutes,
- clearQueryRoutes,
-
- networkSelectors
-} from '../../../reducers/network'
-import { fetchPeers } from '../../../reducers/peers'
-import { fetchChannels, channelsSelectors } from '../../../reducers/channels'
-
-import Network from '../components/Network'
-
-const mapDispatchToProps = {
- fetchDescribeNetwork,
- setCurrentTab,
-
- updateSelectedPeers,
- clearSelectedPeers,
-
- updatePayReq,
- fetchInvoiceAndQueryRoutes,
- setCurrentRoute,
- clearQueryRoutes,
- resetPayReq,
-
- fetchPeers,
-
- fetchChannels,
- updateSelectedChannels,
- clearSelectedChannels
-}
-
-const mapStateToProps = state => ({
- network: state.network,
- peers: state.peers,
- identity_pubkey: state.info.data.identity_pubkey,
-
- selectedPeerPubkeys: networkSelectors.selectedPeerPubkeys(state),
- selectedChannelIds: networkSelectors.selectedChannelIds(state),
- payReqIsLn: networkSelectors.payReqIsLn(state),
- currentRouteChanIds: networkSelectors.currentRouteChanIds(state),
- activeChannels: channelsSelectors.activeChannels(state)
-})
-
-export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Network))
diff --git a/app/routes/network/index.js b/app/routes/network/index.js
deleted file mode 100644
index 36983a87..00000000
--- a/app/routes/network/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import NetworkContainer from './containers/NetworkContainer'
-
-export default NetworkContainer
diff --git a/app/utils/btc.js b/app/utils/btc.js
index 4de31dc5..4d72b776 100644
--- a/app/utils/btc.js
+++ b/app/utils/btc.js
@@ -9,7 +9,8 @@ export function btcToSatoshis(btc) {
export function satoshisToBtc(satoshis) {
if (satoshis === undefined || satoshis === null || satoshis === '') return null
- return sb.toBitcoin(satoshis).toFixed(8)
+ const btcAmount = sb.toBitcoin(satoshis).toFixed(8)
+ return btcAmount > 0 ? btcAmount : btcAmount * -1
}
export function btcToUsd(btc, price) {
diff --git a/app/variables.scss b/app/variables.scss
index a497deaa..58a7b748 100644
--- a/app/variables.scss
+++ b/app/variables.scss
@@ -8,12 +8,15 @@ $traditionalgrey: #cccccc;
$lightgrey: #F7F7F7;
$darkgrey: #EBEBEB;
$darkestgrey: #999999;
-$bluegrey: #555459;
+$bluegrey: #2A2D38;
$spacegrey: #222E2B;
+$spaceblue: #252832;
+$spaceborder: #404040;
$green: #0bb634;
$terminalgreen: #00FF00;
$red: #FF556A;
$blue: #007bb6;
$orange: #FF8A65;
+$yellow: #FFF680;
$curve: cubic-bezier(0.650, 0.000, 0.450, 1.000);
\ No newline at end of file
diff --git a/resources/icon.icns b/resources/icon.icns
index 4aa9cb2c..f9807c0c 100644
Binary files a/resources/icon.icns and b/resources/icon.icns differ
diff --git a/resources/icon.ico b/resources/icon.ico
index c51c7070..2c93685d 100644
Binary files a/resources/icon.ico and b/resources/icon.ico differ
diff --git a/test/components/Nav.spec.js b/test/components/Nav.spec.js
deleted file mode 100644
index 4906adef..00000000
--- a/test/components/Nav.spec.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import React from 'react'
-import { shallow } from 'enzyme'
-import { NavLink } from 'react-router-dom'
-import Nav from 'components/Nav'
-
-const defaultProps = {
- ticker: {
- currency: 'usd',
- crypto: 'btc'
- },
- balance: {},
- setCurrency: () => {},
- currentTicker: {},
- openPayForm: () => {},
- openRequestForm: () => {}
-}
-
-describe('default elements', () => {
- const props = { ...defaultProps }
- const el = shallow(
)
-
- it('should render nav links', () => {
- expect(el.find(NavLink).at(0).props().to).toBe('/')
- expect(el.find(NavLink).at(1).props().to).toBe('/contacts')
- })
- it('should render buttons', () => {
- expect(el.find('.button').at(0).text()).toContain('Pay')
- expect(el.find('.button').at(1).text()).toContain('Request')
- })
-})
diff --git a/test/reducers/__snapshots__/channels.spec.js.snap b/test/reducers/__snapshots__/channels.spec.js.snap
index 18f6b4ee..f5613681 100644
--- a/test/reducers/__snapshots__/channels.spec.js.snap
+++ b/test/reducers/__snapshots__/channels.spec.js.snap
@@ -19,29 +19,29 @@ Object {
},
"filter": Object {
"key": "ALL_CHANNELS",
- "name": "All Contacts",
+ "name": "All",
},
"filterPulldown": false,
"filters": Array [
Object {
"key": "ALL_CHANNELS",
- "name": "All Contacts",
+ "name": "All",
},
Object {
"key": "ACTIVE_CHANNELS",
- "name": "Online Contacts",
+ "name": "Online",
},
Object {
"key": "NON_ACTIVE_CHANNELS",
- "name": "Offline Contacts",
+ "name": "Offline",
},
Object {
"key": "OPEN_PENDING_CHANNELS",
- "name": "Pending Contacts",
+ "name": "Pending",
},
Object {
"key": "CLOSING_PENDING_CHANNELS",
- "name": "Closing Contacts",
+ "name": "Closing",
},
],
"loadingChannelPubkeys": Array [],
@@ -76,29 +76,29 @@ Object {
},
"filter": Object {
"key": "ALL_CHANNELS",
- "name": "All Contacts",
+ "name": "All",
},
"filterPulldown": false,
"filters": Array [
Object {
"key": "ALL_CHANNELS",
- "name": "All Contacts",
+ "name": "All",
},
Object {
"key": "ACTIVE_CHANNELS",
- "name": "Online Contacts",
+ "name": "Online",
},
Object {
"key": "NON_ACTIVE_CHANNELS",
- "name": "Offline Contacts",
+ "name": "Offline",
},
Object {
"key": "OPEN_PENDING_CHANNELS",
- "name": "Pending Contacts",
+ "name": "Pending",
},
Object {
"key": "CLOSING_PENDING_CHANNELS",
- "name": "Closing Contacts",
+ "name": "Closing",
},
],
"loadingChannelPubkeys": Array [],
@@ -136,29 +136,29 @@ Object {
},
"filter": Object {
"key": "ALL_CHANNELS",
- "name": "All Contacts",
+ "name": "All",
},
"filterPulldown": false,
"filters": Array [
Object {
"key": "ALL_CHANNELS",
- "name": "All Contacts",
+ "name": "All",
},
Object {
"key": "ACTIVE_CHANNELS",
- "name": "Online Contacts",
+ "name": "Online",
},
Object {
"key": "NON_ACTIVE_CHANNELS",
- "name": "Offline Contacts",
+ "name": "Offline",
},
Object {
"key": "OPEN_PENDING_CHANNELS",
- "name": "Pending Contacts",
+ "name": "Pending",
},
Object {
"key": "CLOSING_PENDING_CHANNELS",
- "name": "Closing Contacts",
+ "name": "Closing",
},
],
"loadingChannelPubkeys": Array [],
@@ -191,29 +191,29 @@ Object {
},
"filter": Object {
"key": "ALL_CHANNELS",
- "name": "All Contacts",
+ "name": "All",
},
"filterPulldown": false,
"filters": Array [
Object {
"key": "ALL_CHANNELS",
- "name": "All Contacts",
+ "name": "All",
},
Object {
"key": "ACTIVE_CHANNELS",
- "name": "Online Contacts",
+ "name": "Online",
},
Object {
"key": "NON_ACTIVE_CHANNELS",
- "name": "Offline Contacts",
+ "name": "Offline",
},
Object {
"key": "OPEN_PENDING_CHANNELS",
- "name": "Pending Contacts",
+ "name": "Pending",
},
Object {
"key": "CLOSING_PENDING_CHANNELS",
- "name": "Closing Contacts",
+ "name": "Closing",
},
],
"loadingChannelPubkeys": Array [],
@@ -248,29 +248,29 @@ Object {
},
"filter": Object {
"key": "ALL_CHANNELS",
- "name": "All Contacts",
+ "name": "All",
},
"filterPulldown": false,
"filters": Array [
Object {
"key": "ALL_CHANNELS",
- "name": "All Contacts",
+ "name": "All",
},
Object {
"key": "ACTIVE_CHANNELS",
- "name": "Online Contacts",
+ "name": "Online",
},
Object {
"key": "NON_ACTIVE_CHANNELS",
- "name": "Offline Contacts",
+ "name": "Offline",
},
Object {
"key": "OPEN_PENDING_CHANNELS",
- "name": "Pending Contacts",
+ "name": "Pending",
},
Object {
"key": "CLOSING_PENDING_CHANNELS",
- "name": "Closing Contacts",
+ "name": "Closing",
},
],
"loadingChannelPubkeys": Array [],
@@ -305,29 +305,29 @@ Object {
},
"filter": Object {
"key": "ALL_CHANNELS",
- "name": "All Contacts",
+ "name": "All",
},
"filterPulldown": false,
"filters": Array [
Object {
"key": "ALL_CHANNELS",
- "name": "All Contacts",
+ "name": "All",
},
Object {
"key": "ACTIVE_CHANNELS",
- "name": "Online Contacts",
+ "name": "Online",
},
Object {
"key": "NON_ACTIVE_CHANNELS",
- "name": "Offline Contacts",
+ "name": "Offline",
},
Object {
"key": "OPEN_PENDING_CHANNELS",
- "name": "Pending Contacts",
+ "name": "Pending",
},
Object {
"key": "CLOSING_PENDING_CHANNELS",
- "name": "Closing Contacts",
+ "name": "Closing",
},
],
"loadingChannelPubkeys": Array [],