diff --git a/config/default.js b/config/default.js index bdda23acda4..288102ae1f9 100644 --- a/config/default.js +++ b/config/default.js @@ -21,6 +21,9 @@ module.exports = { currency: 'USD', locale: 'en', + // Default time dipslay mode (12hour|24hour). + timeDisplayMode: '12hour', + autoupdate: { active: true, channel: 'beta', diff --git a/electron/main.js b/electron/main.js index c26e1b6dcd6..d3db71814e6 100644 --- a/electron/main.js +++ b/electron/main.js @@ -6,7 +6,7 @@ * When running `npm run build` or `npm run build-main`, this file is compiled to * `/dist/main.js` using webpack. This gives us some performance wins. */ -import { app, BrowserWindow } from 'electron' +import { app, session, BrowserWindow } from 'electron' import isDev from 'electron-is-dev' import installExtension, { REACT_DEVELOPER_TOOLS, @@ -397,8 +397,8 @@ app.on('ready', async () => { */ if (process.env.NODE_ENV === 'development' || process.env.DEBUG_PROD) { if (process.env.REINSTALL_DEVTOOLS) { - BrowserWindow.removeDevToolsExtension(REACT_DEVELOPER_TOOLS) - BrowserWindow.removeDevToolsExtension(REDUX_DEVTOOLS) + session.removeExtension(REACT_DEVELOPER_TOOLS) + session.removeExtension(REDUX_DEVTOOLS) } installExtension(REACT_DEVELOPER_TOOLS) diff --git a/package.json b/package.json index 91bcd852a53..5b294caaa33 100644 --- a/package.json +++ b/package.json @@ -44,12 +44,12 @@ }, "config": { "lnd-binary": { - "binaryVersion": "0.11.1-beta-3-g9fc02c041", + "binaryVersion": "0.12.0-beta-2-g2dd779205", "binarySite": "https://github.com/LN-Zap/lnd/releases/download" } }, "browserslist": [ - "electron 8.4.0" + "electron 9.3.4" ], "engines": { "node": ">=12.0.0", @@ -154,7 +154,7 @@ ], "desktop": { "Comment": "Zap - Lightning wallet", - "Icon": "zap", + "Icon": "zap-desktop.png", "Name": "Zap", "StartupNotify": "true", "Terminal": "false", @@ -247,7 +247,7 @@ "babel-plugin-styled-components": "1.10.7", "babel-plugin-transform-react-pure-class-to-function": "1.0.1", "babel-plugin-transform-react-remove-prop-types": "0.4.24", - "browserslist": "4.14.5", + "browserslist": "4.16.5", "circular-dependency-plugin": "5.2.0", "clean-webpack-plugin": "3.0.0", "copy-webpack-plugin": "5.1.1", @@ -255,7 +255,7 @@ "cross-env": "7.0.2", "cross-spawn": "7.0.3", "csp-html-webpack-plugin": "4.0.0", - "electron": "8.4.0", + "electron": "9.3.4", "electron-builder": "22.9.1", "electron-devtools-installer": "3.1.1", "electron-notarize": "1.0.0", @@ -321,6 +321,7 @@ }, "dependencies": { "@hot-loader/react-dom": "16.13.0", + "@ln-zap/bolt11": "1.2.8-beta.3", "@rebass/forms": "4.0.6", "@styled-system/theme-get": "5.1.2", "axios": "0.19.2", @@ -351,7 +352,7 @@ "is-electron-renderer": "2.0.1", "jstimezonedetect": "1.0.7", "keytar": "5.6.0", - "lnd-grpc": "0.4.6", + "lnd-grpc": "0.4.8", "lndconnect": "0.2.10", "lodash": "4.17.20", "new-github-issue-url": "0.2.1", diff --git a/renderer/components/Activity/Invoice/Invoice.js b/renderer/components/Activity/Invoice/Invoice.js index aac56f90e72..4c1cfa74246 100644 --- a/renderer/components/Activity/Invoice/Invoice.js +++ b/renderer/components/Activity/Invoice/Invoice.js @@ -1,11 +1,11 @@ import React from 'react' import PropTypes from 'prop-types' -import { FormattedTime, FormattedMessage, injectIntl } from 'react-intl' +import { FormattedMessage, injectIntl } from 'react-intl' import { Box, Flex } from 'rebass/styled-components' import { intlShape } from '@zap/i18n' import { Text } from 'components/UI' import Zap from 'components/Icon/Zap' -import { CryptoValue, FiatValue } from 'containers/UI' +import { CryptoValue, FiatValue, FormattedDateTime } from 'containers/UI' import messages from './messages' import Clock from 'components/Icon/Clock' @@ -33,7 +33,8 @@ const Invoice = ({ activity, showActivityModal, cryptoUnitName, intl, ...rest }) - diff --git a/renderer/components/Activity/Payment/Payment.js b/renderer/components/Activity/Payment/Payment.js index 6edcc84d257..fff7e392f98 100644 --- a/renderer/components/Activity/Payment/Payment.js +++ b/renderer/components/Activity/Payment/Payment.js @@ -1,12 +1,12 @@ import React from 'react' import PropTypes from 'prop-types' -import { FormattedMessage, FormattedTime, injectIntl } from 'react-intl' +import { FormattedMessage, injectIntl } from 'react-intl' import { Box, Flex } from 'rebass/styled-components' import { intlShape } from '@zap/i18n' import { getDisplayNodeName } from 'reducers/payment/utils' import { Message, Text } from 'components/UI' import Zap from 'components/Icon/Zap' -import { CryptoValue, FiatValue } from 'containers/UI' +import { CryptoValue, FiatValue, FormattedDateTime } from 'containers/UI' import ErrorLink from '../ErrorLink' import messages from './messages' @@ -57,7 +57,7 @@ const Payment = ({ ) : ( - + )} diff --git a/renderer/components/Activity/PaymentModal/PaymentModal.js b/renderer/components/Activity/PaymentModal/PaymentModal.js index e0f8e8cdaec..649b45bd5cc 100644 --- a/renderer/components/Activity/PaymentModal/PaymentModal.js +++ b/renderer/components/Activity/PaymentModal/PaymentModal.js @@ -1,12 +1,19 @@ import React from 'react' import PropTypes from 'prop-types' -import { FormattedDate, FormattedTime, FormattedMessage, injectIntl } from 'react-intl' +import { FormattedMessage, injectIntl } from 'react-intl' import { Flex } from 'rebass/styled-components' import { intlShape } from '@zap/i18n' import { getDisplayNodeName } from 'reducers/payment/utils' import { Bar, DataRow, Header, Panel, Text } from 'components/UI' import { getTag } from '@zap/utils/crypto' -import { CopyButton, CryptoSelector, CryptoValue, FiatSelector, FiatValue } from 'containers/UI' +import { + CopyButton, + CryptoSelector, + CryptoValue, + FiatSelector, + FiatValue, + FormattedDateTime, +} from 'containers/UI' import { Truncate } from 'components/Util' import Lightning from 'components/Icon/Lightning' import Route from './Route' @@ -78,15 +85,10 @@ class PaymentModal extends React.PureComponent { right={ <> - + - + } diff --git a/renderer/components/Activity/Row.js b/renderer/components/Activity/Row.js index c1930ddcc74..09f6bbb1bba 100644 --- a/renderer/components/Activity/Row.js +++ b/renderer/components/Activity/Row.js @@ -1,15 +1,15 @@ import React from 'react' import PropTypes from 'prop-types' -import { FormattedDate } from 'react-intl' import { Box } from 'rebass/styled-components' import { Bar, Heading } from 'components/UI' +import { FormattedDateTime } from 'containers/UI' const Row = ({ style, item, RowComponent }) => (
{item.title ? ( - + diff --git a/renderer/components/Activity/Transaction/Transaction.js b/renderer/components/Activity/Transaction/Transaction.js index cd6018f7c65..8018f1311af 100644 --- a/renderer/components/Activity/Transaction/Transaction.js +++ b/renderer/components/Activity/Transaction/Transaction.js @@ -1,14 +1,14 @@ import React from 'react' import PropTypes from 'prop-types' import findLast from 'lodash/findLast' -import { FormattedTime, FormattedMessage, injectIntl } from 'react-intl' +import { FormattedMessage, injectIntl } from 'react-intl' import { Box, Flex } from 'rebass/styled-components' import config from 'config' import { intlShape } from '@zap/i18n' import { CoinBig } from '@zap/utils/coin' import { Message, Text } from 'components/UI' import ChainLink from 'components/Icon/ChainLink' -import { CryptoValue, FiatValue } from 'containers/UI' +import { CryptoValue, FiatValue, FormattedDateTime } from 'containers/UI' import ErrorLink from '../ErrorLink' import messages from './messages' @@ -45,7 +45,7 @@ const Transaction = ({ if (CoinBig(numConfirmations).gt(confirmed)) { return ( - + ) } diff --git a/renderer/components/Activity/TransactionModal/TransactionModal.js b/renderer/components/Activity/TransactionModal/TransactionModal.js index c1d97f577b1..8743de83154 100644 --- a/renderer/components/Activity/TransactionModal/TransactionModal.js +++ b/renderer/components/Activity/TransactionModal/TransactionModal.js @@ -1,19 +1,20 @@ import React from 'react' import PropTypes from 'prop-types' import get from 'lodash/get' -import { - FormattedDate, - FormattedTime, - FormattedMessage, - FormattedNumber, - injectIntl, -} from 'react-intl' +import { FormattedMessage, FormattedNumber, injectIntl } from 'react-intl' import { Flex } from 'rebass/styled-components' import { CoinBig } from '@zap/utils/coin' import { intlShape } from '@zap/i18n' import blockExplorer from '@zap/utils/blockExplorer' import { Bar, DataRow, Header, Link, Panel, Span, Text, Button } from 'components/UI' -import { CopyButton, CryptoSelector, CryptoValue, FiatSelector, FiatValue } from 'containers/UI' +import { + CopyButton, + CryptoSelector, + CryptoValue, + FiatSelector, + FiatValue, + FormattedDateTime, +} from 'containers/UI' import { Truncate } from 'components/Util' import Onchain from 'components/Icon/Onchain' import Padlock from 'components/Icon/Padlock' @@ -127,15 +128,14 @@ class TransactionModal extends React.PureComponent { item.numConfirmations ? ( <> - - + ) : ( diff --git a/renderer/components/Channels/ChannelCreateForm.js b/renderer/components/Channels/ChannelCreateForm.js index c2eb83a3ca3..7676e3acf0d 100644 --- a/renderer/components/Channels/ChannelCreateForm.js +++ b/renderer/components/Channels/ChannelCreateForm.js @@ -14,7 +14,7 @@ import { Label, Toggle, TransactionFeeInput, - IntegerInput, + // IntegerInput, } from 'components/Form' import { CryptoValue } from 'containers/UI' import { CurrencyFieldGroup } from 'containers/Form' @@ -313,7 +313,7 @@ class ChannelCreateForm extends React.Component { )} - + {/* @@ -333,7 +333,7 @@ class ChannelCreateForm extends React.Component { variant="thin" width={80} /> - + */} ) } diff --git a/renderer/components/Channels/ChannelData.js b/renderer/components/Channels/ChannelData.js index 9898878c69e..0dd2eb63e1f 100644 --- a/renderer/components/Channels/ChannelData.js +++ b/renderer/components/Channels/ChannelData.js @@ -1,6 +1,6 @@ import React from 'react' import PropTypes from 'prop-types' -import { FormattedDate, FormattedTime, FormattedMessage, injectIntl } from 'react-intl' +import { FormattedMessage, injectIntl } from 'react-intl' import styled from 'styled-components' import { opacity } from 'styled-system' import { Box as BaseBox, Flex } from 'rebass/styled-components' @@ -8,7 +8,7 @@ import { intlShape } from '@zap/i18n' import blockExplorer from '@zap/utils/blockExplorer' import { Bar, DataRow, Link, Text } from 'components/UI' import { Truncate } from 'components/Util' -import { CopyButton, CryptoValue } from 'containers/UI' +import { CopyButton, CryptoValue, FormattedDateTime } from 'containers/UI' import { CHANNEL_DATA_VIEW_MODE_BASIC, CHANNEL_DATA_VIEW_MODE_FULL } from './constants' import messages from './messages' @@ -62,13 +62,7 @@ const ChannelData = ({ channel, cryptoUnitName, intl, networkInfo, viewMode, ... body: , value: ( - {' '} - + ), }), diff --git a/renderer/components/Onboarding/Steps/ConnectionConfirm.js b/renderer/components/Onboarding/Steps/ConnectionConfirm.js index 73f65f75843..916de253815 100644 --- a/renderer/components/Onboarding/Steps/ConnectionConfirm.js +++ b/renderer/components/Onboarding/Steps/ConnectionConfirm.js @@ -18,6 +18,7 @@ class ConnectionConfirm extends React.Component { isLightningGrpcActive: PropTypes.bool, isWalletUnlockerGrpcActive: PropTypes.bool, lndConnect: PropTypes.string, + name: PropTypes.string, startLnd: PropTypes.func.isRequired, startLndCertError: PropTypes.string, startLndHostError: PropTypes.string, @@ -40,10 +41,11 @@ class ConnectionConfirm extends React.Component { handleSubmit = async () => { const { - connectionHost, connectionCert, + connectionHost, connectionMacaroon, connectionString, + name, startLnd, } = this.props const cleanConnectionString = connectionString && connectionString.trim() @@ -57,6 +59,7 @@ class ConnectionConfirm extends React.Component { cert: connectionCert, macaroon: connectionMacaroon, }), + name, }) } @@ -78,6 +81,7 @@ class ConnectionConfirm extends React.Component { type: 'custom', decoder: 'lnd.lndconnect.v1', lndconnectUri, + name, }) } @@ -93,6 +97,7 @@ class ConnectionConfirm extends React.Component { type: 'custom', decoder: 'lnd.lndconnect.v1', lndconnectUri, + name, }) } @@ -106,6 +111,7 @@ class ConnectionConfirm extends React.Component { connectionMacaroon, connectionString, lndConnect, + name, isLightningGrpcActive, isWalletUnlockerGrpcActive, startLndHostError, diff --git a/renderer/components/Onboarding/Steps/ConnectionDetails.js b/renderer/components/Onboarding/Steps/ConnectionDetails.js index 6c2b09cb38e..48535ba0fcd 100644 --- a/renderer/components/Onboarding/Steps/ConnectionDetails.js +++ b/renderer/components/Onboarding/Steps/ConnectionDetails.js @@ -18,11 +18,13 @@ class ConnectionDetails extends React.Component { connectionMacaroon: PropTypes.string, connectionString: PropTypes.string, lndConnect: PropTypes.string, + name: PropTypes.string, setConnectionCert: PropTypes.func.isRequired, setConnectionHost: PropTypes.func.isRequired, setConnectionMacaroon: PropTypes.func.isRequired, setConnectionString: PropTypes.func.isRequired, setLndconnect: PropTypes.func.isRequired, + setName: PropTypes.func.isRequired, startLndCertError: PropTypes.string, startLndHostError: PropTypes.string, startLndMacaroonError: PropTypes.string, @@ -46,22 +48,25 @@ class ConnectionDetails extends React.Component { componentDidUpdate(prevProps, prevState) { const { lndConnect, - setConnectionHost, setConnectionCert, + setConnectionHost, setConnectionMacaroon, setConnectionString, + setName, } = this.props const { formType } = this.state if (formType && formType !== prevState.formType && prevState.formType) { switch (formType) { case FORM_TYPE_CONNECTION_STRING: - setConnectionHost(null) setConnectionCert(null) + setConnectionHost(null) setConnectionMacaroon(null) + setName(null) break case FORM_TYPE_MANUAL: setConnectionString(null) + setName(null) break default: @@ -79,25 +84,27 @@ class ConnectionDetails extends React.Component { render() { const { - wizardApi, - wizardState, - connectionHost, + clearStartLndError, connectionCert, + connectionHost, connectionMacaroon, connectionString, - startLndHostError, - startLndCertError, - startLndMacaroonError, lndConnect, - setLndconnect, - setConnectionHost, + name, setConnectionCert, + setConnectionHost, setConnectionMacaroon, setConnectionString, - clearStartLndError, - validateHost, + setLndconnect, + setName, + startLndCertError, + startLndHostError, + startLndMacaroonError, validateCert, + validateHost, validateMacaroon, + wizardApi, + wizardState, } = this.props const { formType } = this.state @@ -123,8 +130,10 @@ class ConnectionDetails extends React.Component { clearStartLndError={clearStartLndError} connectionString={connectionString} lndConnect={lndConnect} + name={name} setConnectionString={setConnectionString} setLndconnect={setLndconnect} + setName={setName} startLndCertError={startLndCertError} startLndHostError={startLndHostError} startLndMacaroonError={startLndMacaroonError} @@ -139,10 +148,12 @@ class ConnectionDetails extends React.Component { connectionMacaroon={connectionMacaroon} connectionString={connectionString} lndConnect={lndConnect} + name={name} setConnectionCert={setConnectionCert} setConnectionHost={setConnectionHost} setConnectionMacaroon={setConnectionMacaroon} setLndconnect={setLndconnect} + setName={setName} startLndCertError={startLndCertError} startLndHostError={startLndHostError} startLndMacaroonError={startLndMacaroonError} diff --git a/renderer/components/Onboarding/Steps/ConnectionDetailsManual.js b/renderer/components/Onboarding/Steps/ConnectionDetailsManual.js index 972c9e4d59e..eec4836ed19 100644 --- a/renderer/components/Onboarding/Steps/ConnectionDetailsManual.js +++ b/renderer/components/Onboarding/Steps/ConnectionDetailsManual.js @@ -14,10 +14,12 @@ class ConnectionDetailsManual extends React.Component { connectionMacaroon: PropTypes.string, connectionString: PropTypes.string, lndConnect: PropTypes.string, + name: PropTypes.string, setConnectionCert: PropTypes.func.isRequired, setConnectionHost: PropTypes.func.isRequired, setConnectionMacaroon: PropTypes.func.isRequired, setLndconnect: PropTypes.func.isRequired, + setName: PropTypes.func.isRequired, startLndCertError: PropTypes.string, startLndHostError: PropTypes.string, @@ -32,6 +34,7 @@ class ConnectionDetailsManual extends React.Component { static defaultProps = { wizardApi: {}, wizardState: {}, + name: null, } componentDidMount() { @@ -90,10 +93,11 @@ class ConnectionDetailsManual extends React.Component { } handleSubmit = values => { - const { setConnectionHost, setConnectionCert, setConnectionMacaroon } = this.props + const { setConnectionHost, setConnectionCert, setConnectionMacaroon, setName } = this.props setConnectionHost(values.connectionHost) setConnectionCert(values.connectionCert) setConnectionMacaroon(values.connectionMacaroon) + setName(values.name) } validateHost = () => { @@ -124,10 +128,12 @@ class ConnectionDetailsManual extends React.Component { connectionMacaroon, connectionString, lndConnect, + name, setConnectionHost, setConnectionCert, setConnectionMacaroon, setLndconnect, + setName, startLndHostError, startLndCertError, startLndMacaroonError, @@ -211,12 +217,22 @@ class ConnectionDetailsManual extends React.Component { initialValue={connectionMacaroon} isRequired label="Macaroon" + mb={3} name="connectionMacaroon" onBlur={this.validateMacaroon} validateOnBlur={willValidateInline} validateOnChange={willValidateInline} width={1} /> + + } + field="name" + initialValue={name} + label={} + maxLength={30} + name="name" + /> ) }} diff --git a/renderer/components/Onboarding/Steps/ConnectionDetailsString.js b/renderer/components/Onboarding/Steps/ConnectionDetailsString.js index b692a8b26a7..971f636ee65 100644 --- a/renderer/components/Onboarding/Steps/ConnectionDetailsString.js +++ b/renderer/components/Onboarding/Steps/ConnectionDetailsString.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import { FormattedMessage, injectIntl } from 'react-intl' import { Box } from 'rebass/styled-components' import { Bar, Header } from 'components/UI' -import { Form, LndConnectionStringInput } from 'components/Form' +import { Form, Input, LndConnectionStringInput } from 'components/Form' import ConnectionDetailsTabs from './ConnectionDetailsTabs' import messages from './messages' @@ -12,8 +12,10 @@ class ConnectionDetailsString extends React.Component { clearStartLndError: PropTypes.func.isRequired, connectionString: PropTypes.string, lndConnect: PropTypes.string, + name: PropTypes.string, setConnectionString: PropTypes.func.isRequired, setLndconnect: PropTypes.func.isRequired, + setName: PropTypes.func.isRequired, startLndCertError: PropTypes.string, startLndHostError: PropTypes.string, @@ -25,6 +27,7 @@ class ConnectionDetailsString extends React.Component { static defaultProps = { wizardApi: {}, wizardState: {}, + name: null, } componentDidMount() { @@ -85,8 +88,9 @@ class ConnectionDetailsString extends React.Component { } handleSubmit = values => { - const { setConnectionString } = this.props + const { setConnectionString, setName } = this.props setConnectionString(values.connectionString) + setName(values.name) } render() { @@ -98,8 +102,10 @@ class ConnectionDetailsString extends React.Component { startLndCertError, startLndMacaroonError, lndConnect, + name, setLndconnect, setConnectionString, + setName, clearStartLndError, ...rest } = this.props @@ -158,11 +164,21 @@ class ConnectionDetailsString extends React.Component { field="connectionString" initialValue={connectionString} isRequired + mb={3} rows="12" validateOnBlur={willValidateInline} validateOnChange={willValidateInline} willAutoFocus /> + + } + field="name" + initialValue={name} + label={} + maxLength={30} + name="name" + /> ) }} diff --git a/renderer/components/Onboarding/Steps/Name.js b/renderer/components/Onboarding/Steps/Name.js index dfb259f1c1f..c56155db9fa 100644 --- a/renderer/components/Onboarding/Steps/Name.js +++ b/renderer/components/Onboarding/Steps/Name.js @@ -19,7 +19,7 @@ class Name extends React.Component { static defaultProps = { wizardApi: {}, wizardState: {}, - name: '', + name: null, } setFormApi = formApi => { diff --git a/renderer/components/Request/RequestSummary.js b/renderer/components/Request/RequestSummary.js index 1dfcdb261f6..d9e1719b641 100644 --- a/renderer/components/Request/RequestSummary.js +++ b/renderer/components/Request/RequestSummary.js @@ -1,10 +1,16 @@ import React, { useState } from 'react' import PropTypes from 'prop-types' import { Box, Flex } from 'rebass/styled-components' -import { FormattedMessage, FormattedTime, useIntl } from 'react-intl' +import { FormattedMessage, useIntl } from 'react-intl' import copy from 'copy-to-clipboard' import { Bar, DataRow, Button, QRCode, Text, Countdown } from 'components/UI' -import { CryptoSelector, CryptoValue, FiatSelector, FiatValue } from 'containers/UI' +import { + CryptoSelector, + CryptoValue, + FiatSelector, + FiatValue, + FormattedDateTime, +} from 'containers/UI' import { Truncate } from 'components/Util' import RequestSettlePrompt from './RequestSettlePrompt' import messages from './messages' @@ -99,9 +105,7 @@ const RequestSummary = ({ } - right={ - - } + right={} /> @@ -213,12 +217,7 @@ const RequestSummary = ({ >
- + ) : ( diff --git a/renderer/components/Settings/SettingsFieldsGeneral.js b/renderer/components/Settings/SettingsFieldsGeneral.js index 83af5d48873..7cb9d36a43b 100644 --- a/renderer/components/Settings/SettingsFieldsGeneral.js +++ b/renderer/components/Settings/SettingsFieldsGeneral.js @@ -26,6 +26,15 @@ const themeMessageMapper = key => { return filters[key] } +const displayModeItems = [{ key: '12hour' }, { key: '24hour' }] +const displayModeMessageMapper = key => { + const filters = { + '12hour': messages.timeDisplayMode_option_12hour, + '24hour': messages.timeDisplayMode_option_24hour, + } + return filters[key] +} + const SettingsFieldsGeneral = ({ currentConfig }) => { return ( <> @@ -72,6 +81,21 @@ const SettingsFieldsGeneral = ({ currentConfig }) => { + } + right={ +