From b0fdd1db23195cdce5a7657fdac53abdc76476b3 Mon Sep 17 00:00:00 2001 From: yate Date: Sun, 10 Dec 2017 14:38:54 -0500 Subject: [PATCH 1/5] add qrcode to payment request --- apps/desktop/package.json | 61 +++++++++---------- packages/lightning-app/package.json | 8 +-- packages/lightning-components/QRCode/index.js | 19 ++++-- packages/lightning-components/package.json | 10 +-- packages/lightning-core/package.json | 14 ++--- .../lightning-core/request/BitcoinWallet.js | 2 +- .../request/PaymentRequestPopup.js | 13 ++++ packages/lightning-currency/package.json | 10 +-- packages/lightning-forms/package.json | 10 +-- packages/lightning-notifications/package.json | 10 +-- packages/lightning-popup/package.json | 10 +-- packages/lightning-store/package.json | 18 +++--- packages/redux-grpc-middleware/package.json | 2 +- 13 files changed, 104 insertions(+), 83 deletions(-) diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 74e2753db..4c38d5b4e 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -21,48 +21,47 @@ "author": "case ", "license": "MIT", "dependencies": { - "babel-loader": "^6.2.10", - "babel-polyfill": "^6.20.0", - "babel-register": "^6.18.0", - "concurrently": "^3.1.0", - "css-loader": "^0.26.1", - "electron-debug": "^1.1.0", - "electron-log": "^2.2.6", - "electron-packager": "^8.4.0", - "electron-prebuilt": "^1.4.6", - "electron-window-state": "^4.0.1", - "express": "^4.14.0", + "babel-loader": "^6.4.1", + "babel-polyfill": "^6.26.0", + "concurrently": "^3.5.1", + "css-loader": "^0.26.4", + "electron-debug": "^1.4.0", + "electron-log": "^2.2.12", + "electron-packager": "^8.7.2", + "electron-prebuilt": "^1.4.13", + "electron-window-state": "^4.1.1", + "express": "^4.16.2", "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.9.0", - "grpc": "^1.1.1", - "json-loader": "^0.5.4", + "grpc": "^1.7.3", + "json-loader": "^0.5.7", "lightning-app": "^0.1.0", "lightning-components": "^0.1.1", "lightning-core": "^1.9.1", "lightning-notifications": "^0.1.1", "lightning-store": "^0.1.1", - "lodash": "^4.17.2", + "lodash": "^4.17.4", "normalize.css": "^5.0.0", - "observe": "^1.3.7", - "protobufjs": "^6.4.6", - "ps-node": "^0.1.4", - "react": "^15.4.1", - "react-dom": "^15.4.1", - "react-redux": "^4.4.6", - "react-router-dom": "^4.0.0", - "react-router-redux": "^5.0.0-alpha.6", - "reactcss": "^1.1.1", - "redux": "^3.6.0", - "source-map-support": "^0.4.8", - "style-loader": "^0.13.1", - "webpack": "^1.14.0", - "webpack-dev-middleware": "^1.9.0", - "webpack-hot-middleware": "^2.13.2", + "observe": "^1.4.1", + "protobufjs": "^6.8.3", + "ps-node": "^0.1.6", + "react": "^15.6.2", + "react-dom": "^15.6.2", + "react-redux": "^4.4.8", + "react-router-dom": "^4.2.2", + "react-router-redux": "^5.0.0-alpha.8", + "reactcss": "^1.2.3", + "redux": "^3.7.2", + "source-map-support": "^0.4.18", + "style-loader": "^0.13.2", + "webpack": "^1.15.0", + "webpack-dev-middleware": "^1.12.2", + "webpack-hot-middleware": "^2.21.0", "webpack-merge": "^1.1.2", "webpack-validator": "^2.3.0" }, "devDependencies": { - "babel-register": "^6.18.0", - "cross-env": "^3.1.3" + "babel-register": "^6.26.0", + "cross-env": "^3.2.4" } } diff --git a/packages/lightning-app/package.json b/packages/lightning-app/package.json index 487b9c2c2..ebef51e61 100644 --- a/packages/lightning-app/package.json +++ b/packages/lightning-app/package.json @@ -8,12 +8,12 @@ "author": "case ", "license": "MIT", "dependencies": { - "@components/electron": "^0.3.0", + "@components/electron": "^0.3.1", "lightning-components": "^0.1.0", "lightning-core": "^1.9.1", "lightning-notifications": "^0.1.0", - "react": "^15.4.1", - "react-router-dom": "^4.0.0", - "reactcss": "^1.1.1" + "react": "^15.6.2", + "react-router-dom": "^4.2.2", + "reactcss": "^1.2.3" } } diff --git a/packages/lightning-components/QRCode/index.js b/packages/lightning-components/QRCode/index.js index e5ebf62d5..c60745168 100644 --- a/packages/lightning-components/QRCode/index.js +++ b/packages/lightning-components/QRCode/index.js @@ -2,12 +2,21 @@ import React from 'react' import { format } from 'url' import qrImage from 'qr-image' -export const QRCode = ({ address }) => { - const bitcoinURL = format({ protocol: 'bitcoin:', host: address }) - const svg = qrImage.imageSync(bitcoinURL, { type: 'svg' }) +export const QRCode = { + bitcoin: ({ address }) => { + const bitcoinURL = format({ protocol: 'bitcoin:', host: address }) + const svg = qrImage.imageSync(bitcoinURL, { type: 'svg' }) - // eslint-disable-next-line react/no-danger - return
+ // eslint-disable-next-line react/no-danger + return
+ }, + lightning: ({ paymentRequest }) => { + console.log(paymentRequest); + const svg = qrImage.imageSync(paymentRequest, { type: 'svg' }) + + // eslint-disable-next-line react/no-danger + return
+ } } export default QRCode diff --git a/packages/lightning-components/package.json b/packages/lightning-components/package.json index 4feb5da9a..94f1fa7b0 100644 --- a/packages/lightning-components/package.json +++ b/packages/lightning-components/package.json @@ -9,11 +9,11 @@ "author": "case ", "license": "MIT", "dependencies": { - "lodash": "^4.16.1", - "qr-image": "^3.1.0", - "react": "^15.3.2", - "react-router-dom": "^4.0.0", - "reactcss": "^1.0.8" + "lodash": "^4.17.4", + "qr-image": "^3.2.0", + "react": "^15.6.2", + "react-router-dom": "^4.2.2", + "reactcss": "^1.2.3" }, "devDependencies": { "@kadira/storybook": "^2.35.3" diff --git a/packages/lightning-core/package.json b/packages/lightning-core/package.json index 66bfb5b26..61236308a 100644 --- a/packages/lightning-core/package.json +++ b/packages/lightning-core/package.json @@ -9,19 +9,19 @@ "author": "case ", "license": "MIT", "dependencies": { - "electron": "^1.6.2", + "electron": "^1.7.9", "lightning-components": "^0.1.1", "lightning-forms": "^0.1.0", "lightning-notifications": "^0.1.1", "lightning-popup": "^0.1.0", "lightning-store": "^0.1.1", - "lodash": "^4.16.2", - "react": "^15.4.1", + "lodash": "^4.17.4", + "react": "^15.6.2", "react-infinite": "^0.10.0", - "react-redux": "^4.4.6", - "react-router-dom": "^4.0.0", - "reactcss": "^1.0.8", - "redux": "^3.6.0", + "react-redux": "^4.4.8", + "react-router-dom": "^4.2.2", + "reactcss": "^1.2.3", + "redux": "^3.7.2", "redux-grpc-middleware": "^0.1.1", "redux-selector": "^0.1.0" } diff --git a/packages/lightning-core/request/BitcoinWallet.js b/packages/lightning-core/request/BitcoinWallet.js index 20c8350c0..61a161f90 100644 --- a/packages/lightning-core/request/BitcoinWallet.js +++ b/packages/lightning-core/request/BitcoinWallet.js @@ -67,7 +67,7 @@ export class BitcoinWallet extends React.Component {
- +
diff --git a/packages/lightning-core/request/PaymentRequestPopup.js b/packages/lightning-core/request/PaymentRequestPopup.js index c63b13f53..649715126 100644 --- a/packages/lightning-core/request/PaymentRequestPopup.js +++ b/packages/lightning-core/request/PaymentRequestPopup.js @@ -2,6 +2,7 @@ import React from 'react' import reactCSS from 'reactcss' import { remote } from 'electron' import { Popup } from 'lightning-popup' +import { QRCode } from 'lightning-components' import { Head, Input } from '../common' const { Menu, MenuItem } = remote @@ -29,6 +30,15 @@ export const PaymentRequestPopup = ({ paymentRequest, closePopup }) => { color: '#4990E2', cursor: 'pointer', }, + qrPopup: { + background: '#fff', + borderRadius: 2, + width: 300, + height: 300, + marginLeft: 'auto', + marginRight: 'auto', + paddingBottom: 10, + } }, }) const menu = new Menu() @@ -50,6 +60,9 @@ export const PaymentRequestPopup = ({ paymentRequest, closePopup }) => { body="Send this encoded payment request to the party who would like to pay you via the Lightning Network." /> +
+ +
", "license": "MIT", "dependencies": { - "history": "^4.6.1", + "history": "^4.7.2", "lightning-core": "^1.9.1", "lightning-forms": "^0.1.0", "lightning-notifications": "^0.1.1", "lightning-popup": "^0.1.0", - "lodash": "^4.17.2", - "react": "^15.4.1", - "react-router-dom": "^4.0.0", - "react-router-redux": "^5.0.0-alpha.6", - "redux": "^3.6.0", - "redux-electron-ipc": "^1.1.3", + "lodash": "^4.17.4", + "react": "^15.6.2", + "react-router-dom": "^4.2.2", + "react-router-redux": "^5.0.0-alpha.8", + "redux": "^3.7.2", + "redux-electron-ipc": "^1.1.12", "redux-grpc-middleware": "^0.1.1", - "redux-logger": "^2.7.4", + "redux-logger": "^2.10.2", "redux-selector": "^0.1.0", - "redux-thunk": "^2.1.0" + "redux-thunk": "^2.2.0" } } diff --git a/packages/redux-grpc-middleware/package.json b/packages/redux-grpc-middleware/package.json index 5b7b0a4f2..7a039a303 100644 --- a/packages/redux-grpc-middleware/package.json +++ b/packages/redux-grpc-middleware/package.json @@ -9,6 +9,6 @@ "author": "case ", "license": "MIT", "dependencies": { - "electron": "^1.4.12" + "electron": "^1.7.9" } } From 1cb69a9fe9bc95be9cd389d229a45a237d4d817a Mon Sep 17 00:00:00 2001 From: yate Date: Sun, 10 Dec 2017 16:15:36 -0500 Subject: [PATCH 2/5] revert package.json files --- apps/desktop/package.json | 61 ++++++++++--------- packages/lightning-app/package.json | 8 +-- packages/lightning-components/package.json | 10 +-- packages/lightning-core/package.json | 14 ++--- packages/lightning-currency/package.json | 10 +-- packages/lightning-forms/package.json | 10 +-- packages/lightning-notifications/package.json | 10 +-- packages/lightning-popup/package.json | 10 +-- packages/lightning-store/package.json | 18 +++--- packages/redux-grpc-middleware/package.json | 2 +- 10 files changed, 77 insertions(+), 76 deletions(-) diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 4c38d5b4e..74e2753db 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -21,47 +21,48 @@ "author": "case ", "license": "MIT", "dependencies": { - "babel-loader": "^6.4.1", - "babel-polyfill": "^6.26.0", - "concurrently": "^3.5.1", - "css-loader": "^0.26.4", - "electron-debug": "^1.4.0", - "electron-log": "^2.2.12", - "electron-packager": "^8.7.2", - "electron-prebuilt": "^1.4.13", - "electron-window-state": "^4.1.1", - "express": "^4.16.2", + "babel-loader": "^6.2.10", + "babel-polyfill": "^6.20.0", + "babel-register": "^6.18.0", + "concurrently": "^3.1.0", + "css-loader": "^0.26.1", + "electron-debug": "^1.1.0", + "electron-log": "^2.2.6", + "electron-packager": "^8.4.0", + "electron-prebuilt": "^1.4.6", + "electron-window-state": "^4.0.1", + "express": "^4.14.0", "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.9.0", - "grpc": "^1.7.3", - "json-loader": "^0.5.7", + "grpc": "^1.1.1", + "json-loader": "^0.5.4", "lightning-app": "^0.1.0", "lightning-components": "^0.1.1", "lightning-core": "^1.9.1", "lightning-notifications": "^0.1.1", "lightning-store": "^0.1.1", - "lodash": "^4.17.4", + "lodash": "^4.17.2", "normalize.css": "^5.0.0", - "observe": "^1.4.1", - "protobufjs": "^6.8.3", - "ps-node": "^0.1.6", - "react": "^15.6.2", - "react-dom": "^15.6.2", - "react-redux": "^4.4.8", - "react-router-dom": "^4.2.2", - "react-router-redux": "^5.0.0-alpha.8", - "reactcss": "^1.2.3", - "redux": "^3.7.2", - "source-map-support": "^0.4.18", - "style-loader": "^0.13.2", - "webpack": "^1.15.0", - "webpack-dev-middleware": "^1.12.2", - "webpack-hot-middleware": "^2.21.0", + "observe": "^1.3.7", + "protobufjs": "^6.4.6", + "ps-node": "^0.1.4", + "react": "^15.4.1", + "react-dom": "^15.4.1", + "react-redux": "^4.4.6", + "react-router-dom": "^4.0.0", + "react-router-redux": "^5.0.0-alpha.6", + "reactcss": "^1.1.1", + "redux": "^3.6.0", + "source-map-support": "^0.4.8", + "style-loader": "^0.13.1", + "webpack": "^1.14.0", + "webpack-dev-middleware": "^1.9.0", + "webpack-hot-middleware": "^2.13.2", "webpack-merge": "^1.1.2", "webpack-validator": "^2.3.0" }, "devDependencies": { - "babel-register": "^6.26.0", - "cross-env": "^3.2.4" + "babel-register": "^6.18.0", + "cross-env": "^3.1.3" } } diff --git a/packages/lightning-app/package.json b/packages/lightning-app/package.json index ebef51e61..487b9c2c2 100644 --- a/packages/lightning-app/package.json +++ b/packages/lightning-app/package.json @@ -8,12 +8,12 @@ "author": "case ", "license": "MIT", "dependencies": { - "@components/electron": "^0.3.1", + "@components/electron": "^0.3.0", "lightning-components": "^0.1.0", "lightning-core": "^1.9.1", "lightning-notifications": "^0.1.0", - "react": "^15.6.2", - "react-router-dom": "^4.2.2", - "reactcss": "^1.2.3" + "react": "^15.4.1", + "react-router-dom": "^4.0.0", + "reactcss": "^1.1.1" } } diff --git a/packages/lightning-components/package.json b/packages/lightning-components/package.json index 94f1fa7b0..4feb5da9a 100644 --- a/packages/lightning-components/package.json +++ b/packages/lightning-components/package.json @@ -9,11 +9,11 @@ "author": "case ", "license": "MIT", "dependencies": { - "lodash": "^4.17.4", - "qr-image": "^3.2.0", - "react": "^15.6.2", - "react-router-dom": "^4.2.2", - "reactcss": "^1.2.3" + "lodash": "^4.16.1", + "qr-image": "^3.1.0", + "react": "^15.3.2", + "react-router-dom": "^4.0.0", + "reactcss": "^1.0.8" }, "devDependencies": { "@kadira/storybook": "^2.35.3" diff --git a/packages/lightning-core/package.json b/packages/lightning-core/package.json index 61236308a..66bfb5b26 100644 --- a/packages/lightning-core/package.json +++ b/packages/lightning-core/package.json @@ -9,19 +9,19 @@ "author": "case ", "license": "MIT", "dependencies": { - "electron": "^1.7.9", + "electron": "^1.6.2", "lightning-components": "^0.1.1", "lightning-forms": "^0.1.0", "lightning-notifications": "^0.1.1", "lightning-popup": "^0.1.0", "lightning-store": "^0.1.1", - "lodash": "^4.17.4", - "react": "^15.6.2", + "lodash": "^4.16.2", + "react": "^15.4.1", "react-infinite": "^0.10.0", - "react-redux": "^4.4.8", - "react-router-dom": "^4.2.2", - "reactcss": "^1.2.3", - "redux": "^3.7.2", + "react-redux": "^4.4.6", + "react-router-dom": "^4.0.0", + "reactcss": "^1.0.8", + "redux": "^3.6.0", "redux-grpc-middleware": "^0.1.1", "redux-selector": "^0.1.0" } diff --git a/packages/lightning-currency/package.json b/packages/lightning-currency/package.json index 1241e3730..a16736236 100644 --- a/packages/lightning-currency/package.json +++ b/packages/lightning-currency/package.json @@ -10,10 +10,10 @@ "dependencies": { "lightning-components": "^0.1.1", "lightning-store": "^0.1.1", - "lodash": "^4.17.4", - "react": "^15.6.2", - "react-redux": "^4.4.8", - "reactcss": "^1.2.3", - "redux": "^3.7.2" + "lodash": "^4.17.2", + "react": "^15.4.1", + "react-redux": "^4.4.6", + "reactcss": "^1.1.1", + "redux": "^3.6.0" } } diff --git a/packages/lightning-forms/package.json b/packages/lightning-forms/package.json index 13b9d9f01..fa79b0fa7 100644 --- a/packages/lightning-forms/package.json +++ b/packages/lightning-forms/package.json @@ -9,10 +9,10 @@ "author": "", "license": "MIT", "dependencies": { - "lodash": "^4.17.4", - "react": "^15.6.2", - "react-redux": "^4.4.8", - "reactcss": "^1.2.3", - "redux": "^3.7.2" + "lodash": "^4.16.2", + "react": "^15.4.2", + "react-redux": "^4.4.6", + "reactcss": "^1.1.1", + "redux": "^3.6.0" } } diff --git a/packages/lightning-notifications/package.json b/packages/lightning-notifications/package.json index 44634035c..756a395a3 100644 --- a/packages/lightning-notifications/package.json +++ b/packages/lightning-notifications/package.json @@ -11,10 +11,10 @@ "dependencies": { "lightning-components": "^0.1.1", "lightning-store": "^0.1.1", - "lodash": "^4.17.4", - "react": "^15.6.2", - "react-redux": "^4.4.8", - "reactcss": "^1.2.3", - "redux": "^3.7.2" + "lodash": "^4.17.2", + "react": "^15.4.1", + "react-redux": "^4.4.6", + "reactcss": "^1.1.1", + "redux": "^3.6.0" } } diff --git a/packages/lightning-popup/package.json b/packages/lightning-popup/package.json index 657eff73f..d2ee64d8a 100644 --- a/packages/lightning-popup/package.json +++ b/packages/lightning-popup/package.json @@ -11,10 +11,10 @@ "dependencies": { "lightning-components": "^0.1.1", "lightning-store": "^0.1.1", - "lodash": "^4.17.4", - "react": "^15.6.2", - "react-redux": "^4.4.8", - "reactcss": "^1.2.3", - "redux": "^3.7.2" + "lodash": "^4.17.2", + "react": "^15.4.1", + "react-redux": "^4.4.6", + "reactcss": "^1.1.1", + "redux": "^3.6.0" } } diff --git a/packages/lightning-store/package.json b/packages/lightning-store/package.json index bb56aa99e..afe83717a 100644 --- a/packages/lightning-store/package.json +++ b/packages/lightning-store/package.json @@ -9,20 +9,20 @@ "author": "case ", "license": "MIT", "dependencies": { - "history": "^4.7.2", + "history": "^4.6.1", "lightning-core": "^1.9.1", "lightning-forms": "^0.1.0", "lightning-notifications": "^0.1.1", "lightning-popup": "^0.1.0", - "lodash": "^4.17.4", - "react": "^15.6.2", - "react-router-dom": "^4.2.2", - "react-router-redux": "^5.0.0-alpha.8", - "redux": "^3.7.2", - "redux-electron-ipc": "^1.1.12", + "lodash": "^4.17.2", + "react": "^15.4.1", + "react-router-dom": "^4.0.0", + "react-router-redux": "^5.0.0-alpha.6", + "redux": "^3.6.0", + "redux-electron-ipc": "^1.1.3", "redux-grpc-middleware": "^0.1.1", - "redux-logger": "^2.10.2", + "redux-logger": "^2.7.4", "redux-selector": "^0.1.0", - "redux-thunk": "^2.2.0" + "redux-thunk": "^2.1.0" } } diff --git a/packages/redux-grpc-middleware/package.json b/packages/redux-grpc-middleware/package.json index 7a039a303..5b7b0a4f2 100644 --- a/packages/redux-grpc-middleware/package.json +++ b/packages/redux-grpc-middleware/package.json @@ -9,6 +9,6 @@ "author": "case ", "license": "MIT", "dependencies": { - "electron": "^1.7.9" + "electron": "^1.4.12" } } From 4cacc67435bad448abe477c0f00ccef7d3f2f7ef Mon Sep 17 00:00:00 2001 From: yate Date: Sun, 10 Dec 2017 16:17:03 -0500 Subject: [PATCH 3/5] remove console.log --- packages/lightning-components/QRCode/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/lightning-components/QRCode/index.js b/packages/lightning-components/QRCode/index.js index c60745168..aca1fb8ab 100644 --- a/packages/lightning-components/QRCode/index.js +++ b/packages/lightning-components/QRCode/index.js @@ -11,7 +11,6 @@ export const QRCode = { return
}, lightning: ({ paymentRequest }) => { - console.log(paymentRequest); const svg = qrImage.imageSync(paymentRequest, { type: 'svg' }) // eslint-disable-next-line react/no-danger From fe22b35b836fc56b3983cd271191d0842930dce7 Mon Sep 17 00:00:00 2001 From: yate Date: Sun, 10 Dec 2017 16:48:15 -0500 Subject: [PATCH 4/5] replace lightning:// with lightning: --- packages/lightning-components/QRCode/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/lightning-components/QRCode/index.js b/packages/lightning-components/QRCode/index.js index aca1fb8ab..3bf7784c4 100644 --- a/packages/lightning-components/QRCode/index.js +++ b/packages/lightning-components/QRCode/index.js @@ -11,6 +11,7 @@ export const QRCode = { return
}, lightning: ({ paymentRequest }) => { + paymentRequest = paymentRequest.replace('lightning://', 'lightning:') const svg = qrImage.imageSync(paymentRequest, { type: 'svg' }) // eslint-disable-next-line react/no-danger From 53d0f79e4fdc4cd3c4c1a704184cb563f62a742e Mon Sep 17 00:00:00 2001 From: yate Date: Sun, 10 Dec 2017 20:56:09 -0500 Subject: [PATCH 5/5] make qr images sharper --- packages/lightning-components/QRCode/index.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/lightning-components/QRCode/index.js b/packages/lightning-components/QRCode/index.js index 3bf7784c4..519282aa6 100644 --- a/packages/lightning-components/QRCode/index.js +++ b/packages/lightning-components/QRCode/index.js @@ -5,17 +5,23 @@ import qrImage from 'qr-image' export const QRCode = { bitcoin: ({ address }) => { const bitcoinURL = format({ protocol: 'bitcoin:', host: address }) - const svg = qrImage.imageSync(bitcoinURL, { type: 'svg' }) + const svg = qrImage.svgObject(bitcoinURL, { type: 'svg' }) - // eslint-disable-next-line react/no-danger - return
+ return ( + + + + ) }, lightning: ({ paymentRequest }) => { paymentRequest = paymentRequest.replace('lightning://', 'lightning:') - const svg = qrImage.imageSync(paymentRequest, { type: 'svg' }) + const svg = qrImage.svgObject(paymentRequest, { type: 'svg' }) - // eslint-disable-next-line react/no-danger - return
+ return ( + + + + ) } }