Skip to content

Commit 6baa2bf

Browse files
authored
v0.5.0 (#27)
v0.5.0
2 parents e65e2da + 57fc2b6 commit 6baa2bf

File tree

4 files changed

+162
-84
lines changed

4 files changed

+162
-84
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lightning-decoder",
3-
"version": "0.4.0",
3+
"version": "0.5.0",
44
"author": {
55
"email": "andrerfneves@protonmail.com",
66
"name": "André Neves",
@@ -12,6 +12,7 @@
1212
"bitcoinjs-lib": "^5.1.6",
1313
"bn.js": "^5.0.0",
1414
"classnames": "^2.2.6",
15+
"coininfo": "https://github.com/cryptocoinjs/coininfo#dc3e6cc59e593ee7dbeb7c993485706e72d32743",
1516
"date-fns": "^2.1.0",
1617
"lightnode-invoice": "^0.3.0",
1718
"lodash": "^4.17.15",

src/app.js

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ import cx from 'classnames';
44
import QrReader from 'react-qr-reader';
55
import LightningPayReq from './lib/bolt11';
66
import { formatDetailsKey } from './utils/keys';
7-
import { formatTimestamp } from './utils/timestamp';
7+
// import { formatTimestamp } from './utils/timestamp';
88

99
// Assets
1010
import arrowImage from './assets/images/arrow.svg';
1111
import closeImage from './assets/images/close.svg';
1212
import githubImage from './assets/images/github.svg';
13-
import bitcoinImage from './assets/images/bitcoin.svg';
1413
import boltImage from './assets/images/bolt.png';
1514
import qrcodeImage from './assets/images/qrcode.png';
1615

@@ -20,7 +19,6 @@ import {
2019
APP_TAGLINE,
2120
APP_INPUT_PLACEHOLDER,
2221
APP_GITHUB,
23-
DONATION_BTC,
2422
} from './constants/app';
2523
import {
2624
TAGS_KEY,
@@ -51,7 +49,8 @@ export class App extends PureComponent {
5149

5250
getInvoiceDetails = (text) => this.setState(() => {
5351
try {
54-
const decodedInvoice = LightningPayReq.decode(text);
52+
const payReq = text.toLowerCase();
53+
const decodedInvoice = LightningPayReq.decode(payReq);
5554

5655
return {
5756
decodedInvoice,
@@ -218,7 +217,8 @@ export class App extends PureComponent {
218217
valuePropFormat &&
219218
valuePropFormat === TIMESTAMP_STRING_KEY
220219
) {
221-
value = `${formatTimestamp(decodedInvoice[key])}`;
220+
// TODO: this breaks
221+
// value = `${formatTimestamp(decodedInvoice[key])}`;
222222
}
223223

224224
return (
@@ -277,34 +277,15 @@ export class App extends PureComponent {
277277
}
278278

279279
renderOptions = () => {
280-
const { isBitcoinAddrOpened, isInvoiceLoaded } = this.state;
280+
const { isInvoiceLoaded } = this.state;
281281
const optionsClassnames = cx(
282282
'options',
283283
{ 'options--hide': isInvoiceLoaded },
284284
);
285-
const bitcoinClassnames = cx(
286-
'options__bitcoin',
287-
{ 'options__bitcoin--opened': isBitcoinAddrOpened },
288-
);
289285

290286
return (
291287
<div className={optionsClassnames}>
292288
<div className='options__wrapper'>
293-
<div className={bitcoinClassnames}>
294-
<div className='options__bitcoin-address'>
295-
{DONATION_BTC}
296-
</div>
297-
<button
298-
onClick={this.handleBitcoinClick}
299-
className='options__bitcoin-icon-wrapper'
300-
>
301-
<img
302-
className='options__bitcoin-icon'
303-
src={bitcoinImage}
304-
alt='Bitcoin'
305-
/>
306-
</button>
307-
</div>
308289
<a
309290
href={APP_GITHUB}
310291
className='options__github'

0 commit comments

Comments
 (0)