@@ -119,15 +107,12 @@ Activity.propTypes = {
currentTicker: PropTypes.object.isRequired,
showActivityModal: PropTypes.func.isRequired,
- hideActivityModal: PropTypes.func.isRequired,
changeFilter: PropTypes.func.isRequired,
- newAddress: PropTypes.func.isRequired,
activity: PropTypes.object.isRequired,
currentActivity: PropTypes.array.isRequired,
- address: PropTypes.object.isRequired,
balance: PropTypes.object.isRequired,
- info: PropTypes.object.isRequired
+ walletProps: PropTypes.object.isRequired
}
export default Activity
diff --git a/app/routes/activity/components/components/Invoice/Invoice.js b/app/routes/activity/components/components/Invoice/Invoice.js
index b356837f..c4da0efe 100644
--- a/app/routes/activity/components/components/Invoice/Invoice.js
+++ b/app/routes/activity/components/components/Invoice/Invoice.js
@@ -4,7 +4,6 @@ import Moment from 'react-moment'
import 'moment-timezone'
import Isvg from 'react-inlinesvg'
import { FaBolt } from 'react-icons/lib/fa'
-import { btc } from 'utils'
import Value from 'components/Value'
import checkmarkIcon from 'icons/check_circle.svg'
import clockIcon from 'icons/clock.svg'
diff --git a/app/routes/activity/components/components/Modal/Invoice/Invoice.js b/app/routes/activity/components/components/Modal/Invoice/Invoice.js
deleted file mode 100644
index c8d06b8b..00000000
--- a/app/routes/activity/components/components/Modal/Invoice/Invoice.js
+++ /dev/null
@@ -1,74 +0,0 @@
-import React from 'react'
-import PropTypes from 'prop-types'
-
-import Moment from 'react-moment'
-import 'moment-timezone'
-
-import QRCode from 'qrcode.react'
-import copy from 'copy-to-clipboard'
-import { showNotification } from 'notifications'
-
-import { FaCircle, FaCopy } from 'react-icons/lib/fa'
-
-import { btc } from 'utils'
-
-import styles from './Invoice.scss'
-
-
-const Invoice = ({ invoice, ticker, currentTicker }) => {
- const copyPaymentRequest = () => {
- copy(invoice.payment_request)
- showNotification('Noice', 'Successfully copied to clipboard')
- }
-
- return (
-
-
- {
- !invoice.settled &&
-
-
- Not Paid
-
- }
-
-
- {invoice.memo}
-
-
- {
- ticker.currency === 'usd' ?
- btc.satoshisToUsd(invoice.value, currentTicker.price_usd)
- :
- btc.satoshisToBtc(invoice.value)
- }
-
- BTC
-
-
-
-
-
-
-
- {invoice.payment_request}
-
-
-
-
-
-
- Created on
- {invoice.creation_date * 1000}
-
-
- )
-}
-
-Invoice.propTypes = {
- invoice: PropTypes.object.isRequired,
- ticker: PropTypes.object.isRequired,
- currentTicker: PropTypes.object.isRequired
-}
-
-export default Invoice
diff --git a/app/routes/activity/components/components/Modal/Invoice/Invoice.scss b/app/routes/activity/components/components/Modal/Invoice/Invoice.scss
deleted file mode 100644
index 6efc1869..00000000
--- a/app/routes/activity/components/components/Modal/Invoice/Invoice.scss
+++ /dev/null
@@ -1,106 +0,0 @@
-@import '../../../../../../variables.scss';
-
-.container {
- .settled {
- position: absolute;
- top: 0;
- padding: 10px 0 10px 40px;
- color: $darkestgrey;
-
- svg {
- line-height: 20px;
- font-size: 10px;
- vertical-align: middle;
- }
-
- span {
- font-size: 12px;
- margin-left: 5px;
- }
- }
-
- header {
- background: $lightgrey;
- padding-bottom: 20px;
- }
-
- h3 {
- font-size: 20px;
- color: $black;
- font-weight: bold;
- padding: 10px 40px;
- }
-
- h1 {
- color: $main;
- padding: 10px 40px;
-
- .value {
- font-size: 30px;
- }
-
- i {
- margin-left: 2px;
- vertical-align: top;
- }
- }
-
- .qrcode {
- text-align: center;
- margin-top: 40px;
-
- }
-
- .input {
- padding: 10px 40px;
- .paymentRequest {
- text-align: center;
- font-size: 12px;
- padding: 15px;
- background: $lightgrey;
- border: 1px solid transparent;
- display: block;
- width: 90%;
- margin: 20px auto 0 auto;
- }
- }
-
- .date {
- text-align: center;
- padding-bottom: 40px;
- margin-top: 20px;
-
- time {
- margin-left: 3px;
- }
- }
-
- .invoiceAddress {
- display: flex;
- flex-direction: row;
- font-family: 'Roboto';
- font-size: 14px;
- font-weight: 200;
- background: $lightgrey;
-
- span {
- padding: 15px;
- }
-
- span:nth-child(1) {
- flex: 9;
- overflow-x: scroll;
- }
-
- span:nth-child(2) {
- background: $darkgrey;
- color: $black;
- cursor: pointer;
- transition: all 0.25s;
-
- &:hover {
- background: $darkestgrey;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/app/routes/activity/components/components/Modal/Invoice/index.js b/app/routes/activity/components/components/Modal/Invoice/index.js
deleted file mode 100644
index 31b99355..00000000
--- a/app/routes/activity/components/components/Modal/Invoice/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import Invoice from './Invoice'
-
-export default Invoice
diff --git a/app/routes/activity/components/components/Modal/Modal.js b/app/routes/activity/components/components/Modal/Modal.js
deleted file mode 100644
index 48a31839..00000000
--- a/app/routes/activity/components/components/Modal/Modal.js
+++ /dev/null
@@ -1,63 +0,0 @@
-import React from 'react'
-import PropTypes from 'prop-types'
-import ReactModal from 'react-modal'
-import { MdClose } from 'react-icons/lib/md'
-import Isvg from 'react-inlinesvg'
-
-import Transaction from './Transaction'
-import Payment from './Payment'
-import Invoice from './Invoice'
-
-import x from 'icons/x.svg'
-import styles from './Modal.scss'
-
-const Modal = ({
- modalType, modalProps, hideActivityModal, ticker, currentTicker
-}) => {
- const MODAL_COMPONENTS = {
- TRANSACTION: Transaction,
- PAYMENT: Payment,
- INVOICE: Invoice
- }
-
- const customStyles = {
- overlay: {
- cursor: 'pointer'
- },
- content: {
- top: 'auto',
- left: '0',
- right: '0',
- bottom: 'auto',
- width: '40%',
- margin: '50px auto',
- borderRadius: 'none',
- padding: '0'
- }
- }
-
- if (!modalType) { return null }
-
- const SpecificModal = MODAL_COMPONENTS[modalType]
-
- return (
-
-
- hideActivityModal()}>
-
-
-
-
-
- )
-}
-
-Modal.propTypes = {
- modalType: PropTypes.string,
- modalProps: PropTypes.object.isRequired,
- hideActivityModal: PropTypes.func.isRequired,
- ticker: PropTypes.object.isRequired,
- currentTicker: PropTypes.object.isRequired
-}
-
-export default Modal
diff --git a/app/routes/activity/components/components/Modal/Modal.scss b/app/routes/activity/components/components/Modal/Modal.scss
deleted file mode 100644
index 46f19d56..00000000
--- a/app/routes/activity/components/components/Modal/Modal.scss
+++ /dev/null
@@ -1,27 +0,0 @@
-@import '../../../../../variables.scss';
-
-.container {
- position: relative;
- height: 100vh;
- background: $spaceblue;
-}
-
-.closeContainer {
- text-align: right;
- padding: 20px 40px 0px;
-
- span {
- cursor: pointer;
- opacity: 1.0;
- transition: 0.25s all;
-
- &:hover {
- opacity: 0.5;
- }
- }
-
- svg {
- color: $white;
- }
-}
-
diff --git a/app/routes/activity/components/components/Modal/Payment/Payment.js b/app/routes/activity/components/components/Modal/Payment/Payment.js
deleted file mode 100644
index 1880be4a..00000000
--- a/app/routes/activity/components/components/Modal/Payment/Payment.js
+++ /dev/null
@@ -1,52 +0,0 @@
-import React from 'react'
-import PropTypes from 'prop-types'
-
-import Moment from 'react-moment'
-import 'moment-timezone'
-
-import { btc } from 'utils'
-
-import styles from './Payment.scss'
-
-
-const Payment = ({ payment, ticker, currentTicker }) => (
-
-
-
- - Fee
- - {payment.fee}
- - Hops
- - {payment.path.length}
- - Date
- -
- {payment.creation_date * 1000}
-
-
-
-)
-
-Payment.propTypes = {
- payment: PropTypes.object.isRequired,
- ticker: PropTypes.object.isRequired,
- currentTicker: PropTypes.object.isRequired
-}
-
-export default Payment
diff --git a/app/routes/activity/components/components/Modal/Payment/Payment.scss b/app/routes/activity/components/components/Modal/Payment/Payment.scss
deleted file mode 100644
index 6c88b58f..00000000
--- a/app/routes/activity/components/components/Modal/Payment/Payment.scss
+++ /dev/null
@@ -1,61 +0,0 @@
-@import '../../../../../../variables.scss';
-
-.container {
- header {
- padding: 5px 40px 20px 40px;
- background: $lightgrey;
-
- .title {
- display: flex;
- flex-direction: row;
- margin-bottom: 30px;
-
- h2 {
- text-transform: uppercase;
- font-size: 24px;
- margin-right: 10px;
- }
- }
- }
-
- h1 {
- color: $main;
-
- .value {
- font-size: 24px;
- }
-
- i {
- margin-left: 2px;
- vertical-align: top;
- }
- }
-
- h3 {
- font-size: 14px;
- text-align: center;
- color: $darkestgrey;
- }
-
- dl {
- padding: 40px 40px 40px 40px;
- }
-
- 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: 30px 0 10px 0;
- margin-left: 0;
- border-bottom: 1px solid $darkgrey;
- }
-}
\ No newline at end of file
diff --git a/app/routes/activity/components/components/Modal/Payment/index.js b/app/routes/activity/components/components/Modal/Payment/index.js
deleted file mode 100644
index 3f7e6951..00000000
--- a/app/routes/activity/components/components/Modal/Payment/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import Payment from './Payment'
-
-export default Payment
diff --git a/app/routes/activity/components/components/Modal/Transaction/Transaction.js b/app/routes/activity/components/components/Modal/Transaction/Transaction.js
deleted file mode 100644
index b015281a..00000000
--- a/app/routes/activity/components/components/Modal/Transaction/Transaction.js
+++ /dev/null
@@ -1,64 +0,0 @@
-import React from 'react'
-import PropTypes from 'prop-types'
-
-import Moment from 'react-moment'
-import 'moment-timezone'
-
-import { btc, blockExplorer } from 'utils'
-
-import styles from './Transaction.scss'
-
-
-const Transaction = ({ transaction, ticker, currentTicker }) => (
-
-
-
-
- {
- transaction.amount < 0 ?
- 'Sent'
- :
- 'Received'
- }
-
-
-
- {
- ticker.currency === 'usd' ?
- btc.satoshisToUsd(transaction.amount, currentTicker.price_usd)
- :
- btc.satoshisToBtc(transaction.amount)
- }
-
- BTC
-
-
- blockExplorer.showTransaction(transaction.tx_hash)}>{transaction.tx_hash}
-
-
- - Confirmations
- - {transaction.num_confirmations}
- - Fee
- -
- {
- ticker.currency === 'usd' ?
- btc.satoshisToUsd(transaction.total_fees)
- :
- btc.satoshisToBtc(transaction.total_fees)
- }
-
- - Date
- -
- {transaction.time_stamp * 1000}
-
-
-
-)
-
-Transaction.propTypes = {
- transaction: PropTypes.object.isRequired,
- ticker: PropTypes.object.isRequired,
- currentTicker: PropTypes.object.isRequired
-}
-
-export default Transaction
diff --git a/app/routes/activity/components/components/Modal/Transaction/Transaction.scss b/app/routes/activity/components/components/Modal/Transaction/Transaction.scss
deleted file mode 100644
index f7c3d0ba..00000000
--- a/app/routes/activity/components/components/Modal/Transaction/Transaction.scss
+++ /dev/null
@@ -1,72 +0,0 @@
-@import '../../../../../../variables.scss';
-
-.container {
- header {
- padding: 5px 40px 20px 40px;
- background: $lightgrey;
-
- .title {
- display: flex;
- flex-direction: row;
-
- h2 {
- text-transform: uppercase;
- }
- }
- }
-
- h1 {
- text-align: center;
- color: $main;
-
- .value {
- font-size: 24px;
- }
-
- i {
- margin-left: 2px;
- vertical-align: top;
- }
- }
-
- h3 {
- font-size: 14px;
- text-align: center;
- color: $darkestgrey;
- cursor: pointer;
-
- &:hover {
- text-decoration: underline;
- }
- }
-
- h2 {
- text-align: center;
- margin-right: 10px;
- margin-bottom: 30px;
- text-transform: uppercase;
- font-size: 24px;
- }
-
- dl {
- padding: 40px 40px 40px 40px;
- }
-
- 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: 30px 0 10px 0;
- margin-left: 0;
- border-bottom: 1px solid $darkgrey;
- }
-}
diff --git a/app/routes/activity/components/components/Modal/Transaction/index.js b/app/routes/activity/components/components/Modal/Transaction/index.js
deleted file mode 100644
index 7fc5e311..00000000
--- a/app/routes/activity/components/components/Modal/Transaction/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import Transaction from './Transaction'
-
-export default Transaction
diff --git a/app/routes/activity/components/components/Modal/index.js b/app/routes/activity/components/components/Modal/index.js
deleted file mode 100644
index 498702f4..00000000
--- a/app/routes/activity/components/components/Modal/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import Modal from './Modal'
-
-export default Modal
diff --git a/app/routes/activity/components/components/Payment/Payment.js b/app/routes/activity/components/components/Payment/Payment.js
index f27ed7bb..97f866b0 100644
--- a/app/routes/activity/components/components/Payment/Payment.js
+++ b/app/routes/activity/components/components/Payment/Payment.js
@@ -4,7 +4,6 @@ import Moment from 'react-moment'
import 'moment-timezone'
import Isvg from 'react-inlinesvg'
import { FaBolt } from 'react-icons/lib/fa'
-import { btc } from 'utils'
import Value from 'components/Value'
import checkmarkIcon from 'icons/check_circle.svg'
import styles from '../Activity.scss'
diff --git a/app/routes/activity/components/components/Transaction/Transaction.js b/app/routes/activity/components/components/Transaction/Transaction.js
index d3594d4e..e336a877 100644
--- a/app/routes/activity/components/components/Transaction/Transaction.js
+++ b/app/routes/activity/components/components/Transaction/Transaction.js
@@ -4,7 +4,6 @@ import Moment from 'react-moment'
import 'moment-timezone'
import Isvg from 'react-inlinesvg'
import { FaChain } from 'react-icons/lib/fa'
-import { btc } from 'utils'
import Value from 'components/Value'
import checkmarkIcon from 'icons/check_circle.svg'
import styles from '../Activity.scss'
diff --git a/app/routes/activity/containers/ActivityContainer.js b/app/routes/activity/containers/ActivityContainer.js
index e21b781c..9f5805ea 100644
--- a/app/routes/activity/containers/ActivityContainer.js
+++ b/app/routes/activity/containers/ActivityContainer.js
@@ -72,7 +72,7 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
info: stateProps.info,
ticker: stateProps.ticker,
currentTicker: stateProps.currentTicker,
-
+
setCurrency: dispatchProps.setCurrency,
newAddress: dispatchProps.newAddress,
openPayForm: () => dispatchProps.setFormType('PAY_FORM'),
diff --git a/app/routes/app/components/App.js b/app/routes/app/components/App.js
index 42160dc1..c4f3de8a 100644
--- a/app/routes/app/components/App.js
+++ b/app/routes/app/components/App.js
@@ -11,13 +11,20 @@ import Network from 'components/Contacts/Network'
import ContactModal from 'components/Contacts/ContactModal'
import ContactsForm from 'components/Contacts/ContactsForm'
-import ActivityModal from 'components/activity/ActivityModal'
+import ActivityModal from 'components/Activity/ActivityModal'
import styles from './App.scss'
class App extends Component {
componentWillMount() {
- const { fetchTicker, fetchInfo, newAddress, fetchChannels, fetchBalance, fetchDescribeNetwork } = this.props
+ const {
+ fetchTicker,
+ fetchInfo,
+ newAddress,
+ fetchChannels,
+ fetchBalance,
+ fetchDescribeNetwork
+ } = this.props
// fetch price ticker
fetchTicker()
@@ -35,9 +42,6 @@ class App extends Component {
render() {
const {
- activity,
- hideActivityModal,
-
modal: { modalType, modalProps },
hideModal,
ticker,
@@ -100,6 +104,7 @@ App.propTypes = {
contactModalProps: PropTypes.object,
contactsFormProps: PropTypes.object,
networkTabProps: PropTypes.object,
+ activityModalProps: PropTypes.object,
newAddress: PropTypes.func.isRequired,
fetchInfo: PropTypes.func.isRequired,
diff --git a/app/routes/app/containers/AppContainer.js b/app/routes/app/containers/AppContainer.js
index f3599e32..37108991 100644
--- a/app/routes/app/containers/AppContainer.js
+++ b/app/routes/app/containers/AppContainer.js
@@ -240,7 +240,7 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
const requestFormProps = {
requestform: stateProps.requestform,
ticker: stateProps.ticker,
-
+
currentCurrencyFilters: stateProps.currentCurrencyFilters,
showCurrencyFilters: stateProps.showCurrencyFilters,
currencyName: stateProps.currencyName,
diff --git a/app/utils/btc.js b/app/utils/btc.js
index 945cccf7..5abef070 100644
--- a/app/utils/btc.js
+++ b/app/utils/btc.js
@@ -1,3 +1,5 @@
+/* eslint-disable */
+
import sb from 'satoshi-bitcoin'
//////////////////////
// BTC to things /////
diff --git a/test/components/Form.spec.js b/test/components/Form.spec.js
index ab20f73a..0df61117 100644
--- a/test/components/Form.spec.js
+++ b/test/components/Form.spec.js
@@ -2,8 +2,8 @@ import React from 'react'
import { shallow } from 'enzyme'
import Form from '../../app/components/Form'
-import PayForm from '../../app/components/Form/PayForm'
-import RequestForm from '../../app/components/Form/RequestForm'
+import Pay from '../../app/components/Form/Pay'
+import Request from '../../app/components/Form/Request'
const payFormProps = {
payform: {
@@ -55,16 +55,16 @@ describe('Form', () => {
describe('should show pay form when formType is PAY_FORM', () => {
const props = { ...defaultProps, formType: 'PAY_FORM', formProps: payFormProps }
const el = shallow(
)
- it('should contain PayForm', () => {
- expect(el.find(PayForm)).toHaveLength(1)
+ it('should contain Pay', () => {
+ expect(el.find(Pay)).toHaveLength(1)
})
})
describe('should show request form when formType is REQUEST_FORM', () => {
const props = { ...defaultProps, formType: 'REQUEST_FORM', formProps: requestFormProps }
const el = shallow(
)
- it('should contain RequestForm', () => {
- expect(el.find(RequestForm)).toHaveLength(1)
+ it('should contain Request', () => {
+ expect(el.find(Request)).toHaveLength(1)
})
})
})
diff --git a/test/components/Form/Payform.spec.js b/test/components/Form/Pay.spec.js
similarity index 80%
rename from test/components/Form/Payform.spec.js
rename to test/components/Form/Pay.spec.js
index 740ea4b1..3d323ec9 100644
--- a/test/components/Form/Payform.spec.js
+++ b/test/components/Form/Pay.spec.js
@@ -1,7 +1,7 @@
import React from 'react'
import { shallow } from 'enzyme'
-import PayForm from '../../../app/components/Form/PayForm'
+import Pay from '../../../app/components/Form/Pay'
const defaultProps = {
payform: {
@@ -30,9 +30,9 @@ const defaultProps = {
describe('Form', () => {
describe('should show the form without an input', () => {
- const el = shallow(
)
+ const el = shallow(
)
- it('should contain PayForm', () => {
+ it('should contain Pay', () => {
expect(el.find('input#paymentRequest').props.value).toBe(undefined)
expect(el.contains('lightning network')).toBe(false)
expect(el.contains('on-chain')).toBe(false)
@@ -41,9 +41,9 @@ describe('Form', () => {
describe('should show lightning with a lightning input', () => {
const props = { ...defaultProps, isLn: true }
- const el = shallow(
)
+ const el = shallow(
)
- it('should contain PayForm', () => {
+ it('should contain Pay', () => {
expect(el.find('input#paymentRequest').props.value).toBe(undefined)
expect(el.contains('lightning network')).toBe(true)
expect(el.contains('on-chain')).toBe(false)
@@ -52,9 +52,9 @@ describe('Form', () => {
describe('should show on-chain with an on-chain input', () => {
const props = { ...defaultProps, isOnchain: true }
- const el = shallow(
)
+ const el = shallow(
)
- it('should contain PayForm', () => {
+ it('should contain Pay', () => {
expect(el.find('input#paymentRequest').props.value).toBe(undefined)
expect(el.contains('lightning network')).toBe(false)
expect(el.contains('on-chain')).toBe(true)
diff --git a/test/components/Form/RequestForm.spec.js b/test/components/Form/Request.spec.js
similarity index 74%
rename from test/components/Form/RequestForm.spec.js
rename to test/components/Form/Request.spec.js
index a04c655c..0768dfd8 100644
--- a/test/components/Form/RequestForm.spec.js
+++ b/test/components/Form/Request.spec.js
@@ -1,7 +1,7 @@
import React from 'react'
import { shallow } from 'enzyme'
-import RequestForm from '../../../app/components/Form/RequestForm'
+import Request from '../../../app/components/Form/Request'
const defaultProps = {
requestform: {
@@ -20,8 +20,8 @@ const defaultProps = {
describe('Form', () => {
describe('should show request form when formType is REQUEST_FORM', () => {
const props = { ...defaultProps }
- const el = shallow(
)
- it('should contain RequestForm', () => {
+ const el = shallow(
)
+ it('should contain Request', () => {
expect(el.contains('Request')).toBe(true)
})
})
diff --git a/test/reducers/form.spec.js b/test/reducers/form.spec.js
index faa21642..8c8066b8 100644
--- a/test/reducers/form.spec.js
+++ b/test/reducers/form.spec.js
@@ -1,13 +1,4 @@
-import formReducer, {
- SET_FORM_TYPE
-} from '../../app/reducers/form'
-
-// describe('reducers', () => {
-// describe('formReducer', () => {
-
-
-// }
-// }
+import formReducer, { SET_FORM_TYPE } from '../../app/reducers/form'
describe('reducers', () => {
describe('formReducer', () => {