diff --git a/.eslintrc.js b/.eslintrc.js index 3fc301226d5..817d5f021ed 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -34,7 +34,7 @@ module.exports = { 'compat/compat': 'error', 'comma-dangle': ['error', 'always-multiline'], // 'prettier/prettier': 0, - 'react/boolean-prop-naming': 'error', + 'react/boolean-prop-naming': ['error', { rule: '^(is|has|will|(.*)On)[A-Z]([A-Za-z0-9]?)+' }], 'react/forbid-prop-types': 0, 'react-hooks/rules-of-hooks': 'error', 'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx'] }], diff --git a/app/components/Activity/Activity.js b/app/components/Activity/Activity.js index 55bdae47851..e20e75c444a 100644 --- a/app/components/Activity/Activity.js +++ b/app/components/Activity/Activity.js @@ -18,7 +18,7 @@ const StyledList = styled(List)` class Activity extends Component { cache = new CellMeasurerCache({ fixedWidth: true, - minHeight: 52 + minHeight: 52, }) componentDidUpdate() { @@ -49,12 +49,12 @@ class Activity extends Component { const renderRow = ({ index, key, style, parent }) => { const item = currentActivity[index] return ( - +
{item.title ? ( - + - + @@ -65,7 +65,7 @@ class Activity extends Component { currencyName, currentTicker, showActivityModal, - ticker + ticker, }} /> )} @@ -78,14 +78,14 @@ class Activity extends Component { {({ width, height }) => { return ( (this._list = ref)} - width={width} + deferredMeasurementCache={this.cache} height={height} + pr={4} + rowCount={currentActivity.length} rowHeight={this.cache.rowHeight} rowRenderer={renderRow} - rowCount={currentActivity.length} - deferredMeasurementCache={this.cache} + width={width} /> ) }} @@ -113,13 +113,13 @@ class Activity extends Component { } Activity.propTypes = { - intl: intlShape.isRequired, activity: PropTypes.object.isRequired, - currentActivity: PropTypes.array.isRequired, currencyName: PropTypes.string, + currentActivity: PropTypes.array.isRequired, currentTicker: PropTypes.object, + intl: intlShape.isRequired, + showActivityModal: PropTypes.func.isRequired, ticker: PropTypes.object.isRequired, - showActivityModal: PropTypes.func.isRequired } export default injectIntl(Activity) diff --git a/app/components/Activity/ActivityActions/ActivityActions.js b/app/components/Activity/ActivityActions/ActivityActions.js index c567fe33637..137ce6bc112 100644 --- a/app/components/Activity/ActivityActions/ActivityActions.js +++ b/app/components/Activity/ActivityActions/ActivityActions.js @@ -18,36 +18,36 @@ const ActivityActions = ({ intl, ...rest }) => ( - + - + ) ActivityActions.propTypes = { + changeFilter: PropTypes.func.isRequired, + fetchActivityHistory: PropTypes.func.isRequired, filter: PropTypes.string.isRequired, filters: PropTypes.array.isRequired, intl: intlShape.isRequired, searchQuery: PropTypes.string, - changeFilter: PropTypes.func.isRequired, - fetchActivityHistory: PropTypes.func.isRequired, - updateActivitySearchQuery: PropTypes.func.isRequired + updateActivitySearchQuery: PropTypes.func.isRequired, } export default injectIntl(ActivityActions) diff --git a/app/components/Activity/ActivityActions/ActivityFilter.js b/app/components/Activity/ActivityActions/ActivityFilter.js index 4cfe773fc17..a01f77e48df 100644 --- a/app/components/Activity/ActivityActions/ActivityFilter.js +++ b/app/components/Activity/ActivityActions/ActivityFilter.js @@ -7,7 +7,7 @@ const ActivityFilter = ({ changeFilter, filter, filters, ...rest }) => { const items = filters.map(f => { return { key: f.key, - value: f.name + value: f.name, } }) @@ -15,11 +15,11 @@ const ActivityFilter = ({ changeFilter, filter, filters, ...rest }) => {
) } ActivitySearch.propTypes = { - searchQuery: PropTypes.string, placeholder: PropTypes.string.isRequired, - updateActivitySearchQuery: PropTypes.func.isRequired + searchQuery: PropTypes.string, + updateActivitySearchQuery: PropTypes.func.isRequired, } export default ActivitySearch diff --git a/app/components/Activity/ActivityActions/messages.js b/app/components/Activity/ActivityActions/messages.js index 5744b1b79d6..1722002f37f 100644 --- a/app/components/Activity/ActivityActions/messages.js +++ b/app/components/Activity/ActivityActions/messages.js @@ -3,5 +3,5 @@ import { defineMessages } from 'react-intl' /* eslint-disable max-len */ export default defineMessages({ search_placeholder: 'Search Activity', - refresh_button_hint: 'Refresh activity list' + refresh_button_hint: 'Refresh activity list', }) diff --git a/app/components/Activity/ActivityListItem.js b/app/components/Activity/ActivityListItem.js index 6e823710f53..7964939a326 100644 --- a/app/components/Activity/ActivityListItem.js +++ b/app/components/Activity/ActivityListItem.js @@ -11,7 +11,7 @@ import Clock from 'components/Icon/Clock' import Zap from 'components/Icon/Zap' import { Text } from 'components/UI' -const ZapIcon = () => +const ZapIcon = () => const ActivityIcon = ({ activity }) => { switch (activity.type) { @@ -27,26 +27,26 @@ const ActivityIcon = ({ activity }) => { } ActivityIcon.propTypes = { - activity: PropTypes.object.isRequired + activity: PropTypes.object.isRequired, } export default class ActivityListItem extends PureComponent { static propTypes = { + activity: PropTypes.object.isRequired, + currencyName: PropTypes.string, currentTicker: PropTypes.object, showActivityModal: PropTypes.func.isRequired, - currencyName: PropTypes.string, ticker: PropTypes.object.isRequired, - activity: PropTypes.object.isRequired } render() { const { activity, currencyName, currentTicker, ticker, showActivityModal, ...rest } = this.props return ( - - + + - + {activity.type === 'transaction' && } {activity.type === 'invoice' && } {activity.type === 'payment' && } diff --git a/app/components/Activity/ActivityModal/ActivityModal.js b/app/components/Activity/ActivityModal/ActivityModal.js index f29ac28d7b3..1bf1f8eb628 100644 --- a/app/components/Activity/ActivityModal/ActivityModal.js +++ b/app/components/Activity/ActivityModal/ActivityModal.js @@ -10,9 +10,9 @@ export default class ActivityModal extends React.PureComponent { item: PropTypes.object, networkInfo: PropTypes.shape({ id: PropTypes.string, - name: PropTypes.string + name: PropTypes.string, }), - showNotification: PropTypes.func.isRequired + showNotification: PropTypes.func.isRequired, } render() { @@ -25,16 +25,16 @@ export default class ActivityModal extends React.PureComponent { const MODAL_COMPONENTS = { transaction: { component: TransactionModal, - props: { item, networkInfo } + props: { item, networkInfo }, }, payment: { component: PaymentModal, - props: { item } + props: { item }, }, invoice: { component: InvoiceModal, - props: { item, showNotification } - } + props: { item, showNotification }, + }, } const SpecificModal = MODAL_COMPONENTS[item.type].component diff --git a/app/components/Activity/Invoice/Invoice.js b/app/components/Activity/Invoice/Invoice.js index 7bd1d2ef869..49326fbb276 100644 --- a/app/components/Activity/Invoice/Invoice.js +++ b/app/components/Activity/Invoice/Invoice.js @@ -8,15 +8,15 @@ import messages from './messages' const Invoice = ({ invoice, showActivityModal, currencyName, intl }) => ( showActivityModal('INVOICE', invoice.payment_request)} py={2} > @@ -29,27 +29,27 @@ const Invoice = ({ invoice, showActivityModal, currencyName, intl }) => ( - + {'+ '} {currencyName} - - + + ) Invoice.propTypes = { + currencyName: PropTypes.string.isRequired, intl: intlShape.isRequired, invoice: PropTypes.object.isRequired, showActivityModal: PropTypes.func.isRequired, - currencyName: PropTypes.string.isRequired } export default injectIntl(Invoice) diff --git a/app/components/Activity/Invoice/messages.js b/app/components/Activity/Invoice/messages.js index a53205fd911..31b2b7dcbc0 100644 --- a/app/components/Activity/Invoice/messages.js +++ b/app/components/Activity/Invoice/messages.js @@ -6,5 +6,5 @@ export default defineMessages({ requested: 'Requested payment', type_paid: 'Lightning invoice (paid)', type_unpaid: 'Lightning invoice (unpaid)', - amount: 'Invoice amount' + amount: 'Invoice amount', }) diff --git a/app/components/Activity/InvoiceModal/InvoiceModal.js b/app/components/Activity/InvoiceModal/InvoiceModal.js index 19326dcbac6..a5725f903b2 100644 --- a/app/components/Activity/InvoiceModal/InvoiceModal.js +++ b/app/components/Activity/InvoiceModal/InvoiceModal.js @@ -11,7 +11,7 @@ export default class InvoiceModal extends React.PureComponent { /** Invoice */ item: PropTypes.object.isRequired, /** Show a notification. */ - showNotification: PropTypes.func.isRequired + showNotification: PropTypes.func.isRequired, } render() { @@ -21,13 +21,13 @@ export default class InvoiceModal extends React.PureComponent {
} + subtitle={} title={ } - subtitle={} - logo={} /> diff --git a/app/components/Activity/InvoiceModal/messages.js b/app/components/Activity/InvoiceModal/messages.js index a3693aba092..5613f7747aa 100644 --- a/app/components/Activity/InvoiceModal/messages.js +++ b/app/components/Activity/InvoiceModal/messages.js @@ -12,5 +12,5 @@ export default defineMessages({ status: 'Status', not_paid: 'Not Paid', paid: 'Paid', - current_value: 'Current value' + current_value: 'Current value', }) diff --git a/app/components/Activity/Payment/Payment.js b/app/components/Activity/Payment/Payment.js index e212943f758..5546a25b6c4 100644 --- a/app/components/Activity/Payment/Payment.js +++ b/app/components/Activity/Payment/Payment.js @@ -17,15 +17,15 @@ const Payment = ({ payment, showActivityModal, nodes, currencyName, intl }) => { return ( showActivityModal('PAYMENT', payment.payment_hash) : null} + justifyContent="space-between" + onClick={payment.sending ? null : () => showActivityModal('PAYMENT', payment.payment_hash)} py={2} > {displayNodeName(payment.path[payment.path.length - 1])} {payment.sending ? ( @@ -56,9 +56,9 @@ const Payment = ({ payment, showActivityModal, nodes, currencyName, intl }) => { @@ -66,8 +66,8 @@ const Payment = ({ payment, showActivityModal, nodes, currencyName, intl }) => { {currencyName} - - + + @@ -77,10 +77,10 @@ const Payment = ({ payment, showActivityModal, nodes, currencyName, intl }) => { Payment.propTypes = { currencyName: PropTypes.string.isRequired, - payment: PropTypes.object.isRequired, + intl: intlShape.isRequired, nodes: PropTypes.array.isRequired, + payment: PropTypes.object.isRequired, showActivityModal: PropTypes.func.isRequired, - intl: intlShape.isRequired } export default injectIntl(Payment) diff --git a/app/components/Activity/Payment/messages.js b/app/components/Activity/Payment/messages.js index 70129c6a6dd..ef0f05a41d6 100644 --- a/app/components/Activity/Payment/messages.js +++ b/app/components/Activity/Payment/messages.js @@ -7,5 +7,5 @@ export default defineMessages({ type: 'Lightning payment', status_processing: 'Zap is processing your payment. This can take up to 01:00 min.', status_success: 'Your payment was successful.', - status_error: 'There was a problem sending your payment.' + status_error: 'There was a problem sending your payment.', }) diff --git a/app/components/Activity/PaymentModal/PaymentModal.js b/app/components/Activity/PaymentModal/PaymentModal.js index 3184ec5302e..98ec00981f1 100644 --- a/app/components/Activity/PaymentModal/PaymentModal.js +++ b/app/components/Activity/PaymentModal/PaymentModal.js @@ -10,7 +10,7 @@ import messages from './messages' export default class PaymentModal extends React.PureComponent { static propTypes = { - item: PropTypes.object.isRequired + item: PropTypes.object.isRequired, } render() { @@ -19,9 +19,9 @@ export default class PaymentModal extends React.PureComponent {
} - subtitle={} logo={} + subtitle={} + title={} /> @@ -32,7 +32,7 @@ export default class PaymentModal extends React.PureComponent { right={ - + } /> @@ -56,10 +56,10 @@ export default class PaymentModal extends React.PureComponent { right={ <>
diff --git a/app/components/Activity/PaymentModal/messages.js b/app/components/Activity/PaymentModal/messages.js index 7eeacf27291..780da58c020 100644 --- a/app/components/Activity/PaymentModal/messages.js +++ b/app/components/Activity/PaymentModal/messages.js @@ -7,5 +7,5 @@ export default defineMessages({ date_sent: 'Date sent', fee: 'Total fee', current_value: 'Current value', - preimage: 'Payment Preimage' + preimage: 'Payment Preimage', }) diff --git a/app/components/Activity/Transaction/Transaction.js b/app/components/Activity/Transaction/Transaction.js index 8ff01702ae8..90924a22eae 100644 --- a/app/components/Activity/Transaction/Transaction.js +++ b/app/components/Activity/Transaction/Transaction.js @@ -18,17 +18,17 @@ const Transaction = ({ transaction, showActivityModal, currencyName, intl }) => return ( showActivityModal('TRANSACTION', transaction.tx_hash) : null + transaction.sending ? null : () => showActivityModal('TRANSACTION', transaction.tx_hash) } py={2} > {transaction.closeType ? ( @@ -64,18 +64,18 @@ const Transaction = ({ transaction, showActivityModal, currencyName, intl }) => - + {isIncoming ? `+ ` : `- `} {currencyName} - - + + @@ -84,10 +84,10 @@ const Transaction = ({ transaction, showActivityModal, currencyName, intl }) => } Transaction.propTypes = { + currencyName: PropTypes.string.isRequired, intl: intlShape.isRequired, - transaction: PropTypes.object.isRequired, showActivityModal: PropTypes.func.isRequired, - currencyName: PropTypes.string.isRequired + transaction: PropTypes.object.isRequired, } export default injectIntl(Transaction) diff --git a/app/components/Activity/Transaction/messages.js b/app/components/Activity/Transaction/messages.js index f84dc4c7cfa..f772f544164 100644 --- a/app/components/Activity/Transaction/messages.js +++ b/app/components/Activity/Transaction/messages.js @@ -17,5 +17,5 @@ export default defineMessages({ closetype_remote_force_close: 'Remote force close', closetype_breach_close: 'Breach', closetype_funding_canceled: 'Funding Canceled', - closetype_abandoned: 'Abandoned' + closetype_abandoned: 'Abandoned', }) diff --git a/app/components/Activity/TransactionModal/TransactionModal.js b/app/components/Activity/TransactionModal/TransactionModal.js index 854f51677b1..3acd01f126d 100644 --- a/app/components/Activity/TransactionModal/TransactionModal.js +++ b/app/components/Activity/TransactionModal/TransactionModal.js @@ -16,8 +16,8 @@ export default class TransactionModal extends React.PureComponent { item: PropTypes.object.isRequired, networkInfo: PropTypes.shape({ id: PropTypes.string, - name: PropTypes.string - }) + name: PropTypes.string, + }), } showBlock = hash => { @@ -45,9 +45,9 @@ export default class TransactionModal extends React.PureComponent {
} - subtitle={} logo={} + subtitle={} + title={} /> @@ -58,7 +58,7 @@ export default class TransactionModal extends React.PureComponent { right={ - + } /> @@ -86,10 +86,10 @@ export default class TransactionModal extends React.PureComponent { <> @@ -160,7 +160,7 @@ export default class TransactionModal extends React.PureComponent { {item.maturityHeight && ( - + diff --git a/app/components/Activity/TransactionModal/messages.js b/app/components/Activity/TransactionModal/messages.js index cec1652e982..0fb8bc69374 100644 --- a/app/components/Activity/TransactionModal/messages.js +++ b/app/components/Activity/TransactionModal/messages.js @@ -14,5 +14,5 @@ export default defineMessages({ block_height: 'Confirmed in block {height}', maturity_height: 'Locked until block {height} ', tx_hash: 'Transaction ID', - unconfirmed: 'Unconfirmed' + unconfirmed: 'Unconfirmed', }) diff --git a/app/components/Activity/messages.js b/app/components/Activity/messages.js index 424924c81ef..a1a68f11397 100644 --- a/app/components/Activity/messages.js +++ b/app/components/Activity/messages.js @@ -7,5 +7,5 @@ export default defineMessages({ requested: 'Received', pending: 'Pending', expired: 'Expired', - internal: 'Internal' + internal: 'Internal', }) diff --git a/app/components/App/App.js b/app/components/App/App.js index 28748f8ea84..a068f794951 100644 --- a/app/components/App/App.js +++ b/app/components/App/App.js @@ -51,10 +51,10 @@ function App({ fetchActivityHistory, setIsWalletOpen, fetchPeers, fetchTransacti } App.propTypes = { - setIsWalletOpen: PropTypes.func.isRequired, - fetchTransactions: PropTypes.func.isRequired, + fetchActivityHistory: PropTypes.func.isRequired, fetchPeers: PropTypes.func.isRequired, - fetchActivityHistory: PropTypes.func.isRequired + fetchTransactions: PropTypes.func.isRequired, + setIsWalletOpen: PropTypes.func.isRequired, } export default App diff --git a/app/components/Channels/ChannelBalance.js b/app/components/Channels/ChannelBalance.js index b63ec96f9bc..a8e4e158d13 100644 --- a/app/components/Channels/ChannelBalance.js +++ b/app/components/Channels/ChannelBalance.js @@ -8,7 +8,7 @@ import messages from './messages' const ChannelBalance = ({ channelBalance, ...rest }) => { return ( - + @@ -19,7 +19,7 @@ const ChannelBalance = ({ channelBalance, ...rest }) => { } ChannelBalance.propTypes = { - channelBalance: PropTypes.number.isRequired + channelBalance: PropTypes.number.isRequired, } export default ChannelBalance diff --git a/app/components/Channels/ChannelCapacity.js b/app/components/Channels/ChannelCapacity.js index 0c622c63394..0dbcb7bde38 100644 --- a/app/components/Channels/ChannelCapacity.js +++ b/app/components/Channels/ChannelCapacity.js @@ -19,48 +19,48 @@ const ChannelCapacity = ({ localBalance, remoteBalance, opacity, ...rest }) => { return ( - + - + - + - + - - + + - + - + - - + + - + - + @@ -70,8 +70,8 @@ const ChannelCapacity = ({ localBalance, remoteBalance, opacity, ...rest }) => { ChannelCapacity.propTypes = { localBalance: PropTypes.number.isRequired, + opacity: PropTypes.number, remoteBalance: PropTypes.number.isRequired, - opacity: PropTypes.number } export default ChannelCapacity diff --git a/app/components/Channels/ChannelCardList.js b/app/components/Channels/ChannelCardList.js index 79c6c066797..484a1e6c8ef 100644 --- a/app/components/Channels/ChannelCardList.js +++ b/app/components/Channels/ChannelCardList.js @@ -17,7 +17,7 @@ const ChannelCardList = ({ currencyName, openModal, setSelectedChannel, - networkInfo + networkInfo, }) => { const ROW_PADDING_BOTTOM = 3 // current row height + margin bottom @@ -33,21 +33,21 @@ const ChannelCardList = ({ const channel = channels[index].channel || channels[index] return ( ) @@ -58,13 +58,13 @@ const ChannelCardList = ({ {({ width, height }) => { return ( ) }} @@ -75,16 +75,16 @@ const ChannelCardList = ({ ChannelCardList.propTypes = { channels: PropTypes.array, currencyName: PropTypes.string.isRequired, - openModal: PropTypes.func.isRequired, - setSelectedChannel: PropTypes.func.isRequired, networkInfo: PropTypes.shape({ id: PropTypes.string, - name: PropTypes.string - }) + name: PropTypes.string, + }), + openModal: PropTypes.func.isRequired, + setSelectedChannel: PropTypes.func.isRequired, } ChannelCardList.defaultProps = { - channels: [] + channels: [], } export default ChannelCardList diff --git a/app/components/Channels/ChannelCardListItem.js b/app/components/Channels/ChannelCardListItem.js index 08f9e8db5ee..7b71456b421 100644 --- a/app/components/Channels/ChannelCardListItem.js +++ b/app/components/Channels/ChannelCardListItem.js @@ -26,7 +26,7 @@ const ChannelCardListItem = React.memo( local_balance, remote_balance, display_status, - active + active, } = channel const opacity = active ? 1 : 0.3 return ( @@ -38,7 +38,7 @@ const ChannelCardListItem = React.memo( {display_name} - + @@ -54,22 +54,22 @@ const ChannelCardListItem = React.memo( - + { setSelectedChannel(channel_point) @@ -87,15 +87,15 @@ const ChannelCardListItem = React.memo( ChannelCardListItem.displayName = 'ChannelCardListItem' ChannelCardListItem.propTypes = { - intl: intlShape.isRequired, channel: PropTypes.object.isRequired, currencyName: PropTypes.string.isRequired, - setSelectedChannel: PropTypes.func.isRequired, - openModal: PropTypes.func.isRequired, + intl: intlShape.isRequired, networkInfo: PropTypes.shape({ id: PropTypes.string, - name: PropTypes.string - }).isRequired + name: PropTypes.string, + }).isRequired, + openModal: PropTypes.func.isRequired, + setSelectedChannel: PropTypes.func.isRequired, } export default injectIntl(ChannelCardListItem) diff --git a/app/components/Channels/ChannelCloseDialog.js b/app/components/Channels/ChannelCloseDialog.js index 291d1fffb25..af5956353db 100644 --- a/app/components/Channels/ChannelCloseDialog.js +++ b/app/components/Channels/ChannelCloseDialog.js @@ -17,30 +17,30 @@ const DialogWrapper = ({ intl, isForceClose, isOpen, onClose, onCancel, csvDelay const checkboxFieldName = 'actionACK' // bind button disabled state to a form field const CloseChannelButton = withFieldState(checkboxFieldName)(({ fieldState, ...rest }) => ( - ) const header = ( - + - + - + @@ -49,11 +49,11 @@ const DialogWrapper = ({ intl, isForceClose, isOpen, onClose, onCancel, csvDelay const handleSubmit = () => onClose(intl.formatMessage({ ...messages.close_channel_notification })) return ( - +
- - - + + + {isForceClose && ( )} @@ -76,12 +76,12 @@ const DialogWrapper = ({ intl, isForceClose, isOpen, onClose, onCancel, csvDelay } DialogWrapper.propTypes = { - isOpen: PropTypes.bool.isRequired, + csvDelay: PropTypes.number.isRequired, + intl: intlShape.isRequired, isForceClose: PropTypes.bool.isRequired, - onClose: PropTypes.func.isRequired, + isOpen: PropTypes.bool.isRequired, onCancel: PropTypes.func.isRequired, - intl: intlShape.isRequired, - csvDelay: PropTypes.number.isRequired + onClose: PropTypes.func.isRequired, } export default injectIntl(DialogWrapper) diff --git a/app/components/Channels/ChannelCount.js b/app/components/Channels/ChannelCount.js index 97a7d525b3b..22680e7812e 100644 --- a/app/components/Channels/ChannelCount.js +++ b/app/components/Channels/ChannelCount.js @@ -7,7 +7,7 @@ import messages from './messages' const ChannelCount = ({ channels, ...rest }) => { return ( - + @@ -17,7 +17,7 @@ const ChannelCount = ({ channels, ...rest }) => { } ChannelCount.propTypes = { - channels: PropTypes.array.isRequired + channels: PropTypes.array.isRequired, } export default ChannelCount diff --git a/app/components/Channels/ChannelCreate.js b/app/components/Channels/ChannelCreate.js index 5839fb24c46..029a398833e 100644 --- a/app/components/Channels/ChannelCreate.js +++ b/app/components/Channels/ChannelCreate.js @@ -10,9 +10,9 @@ import ChannelCreateHeader from './ChannelCreateHeader' class ChannelCreate extends React.Component { static propTypes = { isSearchValidNodeAddress: PropTypes.bool, - searchQuery: PropTypes.string, onSubmit: PropTypes.func, - updateContactFormSearchQuery: PropTypes.func.isRequired + searchQuery: PropTypes.string, + updateContactFormSearchQuery: PropTypes.func.isRequired, } componentWillUnmount() { @@ -29,14 +29,14 @@ class ChannelCreate extends React.Component { - + - + {isSearchValidNodeAddress ? ( - + ) : ( <> diff --git a/app/components/Channels/ChannelCreateForm.js b/app/components/Channels/ChannelCreateForm.js index 6c773c1ca8f..4becfa24d6e 100644 --- a/app/components/Channels/ChannelCreateForm.js +++ b/app/components/Channels/ChannelCreateForm.js @@ -17,7 +17,7 @@ import { Span, Spinner, Text, - Toggle + Toggle, } from 'components/UI' import { CurrencyFieldGroup, CryptoValue, CryptoSelector } from 'containers/UI' import Padlock from 'components/Icon/Padlock' @@ -28,7 +28,7 @@ import messages from './messages' import { TRANSACTION_SPEED_SLOW, TRANSACTION_SPEED_MEDIUM, - TRANSACTION_SPEED_FAST + TRANSACTION_SPEED_FAST, } from './constants' const speeds = [TRANSACTION_SPEED_SLOW, TRANSACTION_SPEED_MEDIUM, TRANSACTION_SPEED_FAST] @@ -42,16 +42,16 @@ const ShowHide = Keyframes.Spring({ await next({ pointerEvents: 'auto' }) await next({ opacity: 1 }) }, - hide: { opacity: 0, pointerEvents: 'none' } + hide: { opacity: 0, pointerEvents: 'none' }, }) const FormButtons = ({ isNextButtonDisabled, nextButtonText, onBack }) => ( - + - - @@ -61,7 +61,7 @@ const FormButtons = ({ isNextButtonDisabled, nextButtonText, onBack }) => ( FormButtons.propTypes = { isNextButtonDisabled: PropTypes.bool, nextButtonText: PropTypes.node.isRequired, - onBack: PropTypes.func.isRequired + onBack: PropTypes.func.isRequired, } const FormFooter = ({ walletBalance, currencyName }) => ( @@ -77,28 +77,27 @@ const FormFooter = ({ walletBalance, currencyName }) => ( ) FormFooter.propTypes = { + currencyName: PropTypes.string.isRequired, walletBalance: PropTypes.number.isRequired, - currencyName: PropTypes.string.isRequired } class ChannelCreateForm extends React.Component { state = { - step: 'form' + step: 'form', } static propTypes = { - intl: intlShape.isRequired, activeWalletSettings: PropTypes.shape({ - type: PropTypes.string.isRequired + type: PropTypes.string.isRequired, }).isRequired, - walletBalance: PropTypes.number.isRequired, currency: PropTypes.string.isRequired, currencyName: PropTypes.string.isRequired, + intl: intlShape.isRequired, isQueryingFees: PropTypes.bool, onchainFees: PropTypes.shape({ fastestFee: PropTypes.number, halfHourFee: PropTypes.number, - hourFee: PropTypes.number + hourFee: PropTypes.number, }), onSubmit: PropTypes.func.isRequired, openChannel: PropTypes.func.isRequired, @@ -106,12 +105,13 @@ class ChannelCreateForm extends React.Component { searchQuery: PropTypes.string, selectedNodeDisplayName: PropTypes.string, showNotification: PropTypes.func.isRequired, - updateContactFormSearchQuery: PropTypes.func.isRequired + updateContactFormSearchQuery: PropTypes.func.isRequired, + walletBalance: PropTypes.number.isRequired, } static defaultProps = { isQueryingFees: false, - onchainFees: {} + onchainFees: {}, } componentDidMount() { @@ -243,36 +243,36 @@ class ChannelCreateForm extends React.Component { 0} validateOnBlur={formState.submits > 0} - required - css={{ height: '88px' }} + validateOnChange={formState.submits > 0} /> - + - + {speeds.map(speed => ( } - mr={4} mb={0} + mr={4} + value={speed} /> ))} @@ -280,7 +280,7 @@ class ChannelCreateForm extends React.Component { {isQueryingFees && ( - + … @@ -292,7 +292,7 @@ class ChannelCreateForm extends React.Component { {!isQueryingFees && !fee && } {!isQueryingFees && fee && ( - + @@ -309,7 +309,7 @@ class ChannelCreateForm extends React.Component { {activeWalletSettings.type !== 'local' && ( <> - + @@ -340,9 +340,9 @@ class ChannelCreateForm extends React.Component { ) } @@ -383,7 +383,7 @@ class ChannelCreateForm extends React.Component { {styles => ( - + {this.renderFormFields()} )} @@ -398,6 +398,7 @@ class ChannelCreateForm extends React.Component { 0 && formState.invalid} nextButtonText={ } - isNextButtonDisabled={formState.submits > 0 && formState.invalid} onBack={this.onBack} /> - + ) diff --git a/app/components/Channels/ChannelCreateHeader.js b/app/components/Channels/ChannelCreateHeader.js index 7805484540c..ce805030bb3 100644 --- a/app/components/Channels/ChannelCreateHeader.js +++ b/app/components/Channels/ChannelCreateHeader.js @@ -8,9 +8,9 @@ import messages from './messages' const ChannelCreateHeader = props => (
} - subtitle={} logo={} + subtitle={} + title={} /> ) diff --git a/app/components/Channels/ChannelCreateSummary.js b/app/components/Channels/ChannelCreateSummary.js index 7ec3bb568b7..d418340543b 100644 --- a/app/components/Channels/ChannelCreateSummary.js +++ b/app/components/Channels/ChannelCreateSummary.js @@ -10,7 +10,7 @@ import { withEllipsis } from 'hocs' import { TRANSACTION_SPEED_SLOW, TRANSACTION_SPEED_MEDIUM, - TRANSACTION_SPEED_FAST + TRANSACTION_SPEED_FAST, } from './constants' import messages from './messages' @@ -20,13 +20,13 @@ class ChannelCreateSummary extends React.Component { static propTypes = { amount: PropTypes.number, fee: PropTypes.number.isRequired, + nodeDisplayName: PropTypes.string, + nodePubkey: PropTypes.string.isRequired, speed: PropTypes.oneOf([ TRANSACTION_SPEED_SLOW, TRANSACTION_SPEED_MEDIUM, - TRANSACTION_SPEED_FAST + TRANSACTION_SPEED_FAST, ]), - nodePubkey: PropTypes.string.isRequired, - nodeDisplayName: PropTypes.string } render() { @@ -39,8 +39,8 @@ class ChannelCreateSummary extends React.Component { - - + + @@ -50,24 +50,24 @@ class ChannelCreateSummary extends React.Component { - - + + {nodeDisplayName && ( - + {nodeDisplayName} )} {nodePubkey && ( - - + + )} @@ -81,10 +81,10 @@ class ChannelCreateSummary extends React.Component { } right={ - + - + @@ -100,7 +100,7 @@ class ChannelCreateSummary extends React.Component { right={ <> - + } /> diff --git a/app/components/Channels/ChannelData.js b/app/components/Channels/ChannelData.js index cde2fe3d578..00f29dc6448 100644 --- a/app/components/Channels/ChannelData.js +++ b/app/components/Channels/ChannelData.js @@ -22,7 +22,7 @@ const ChannelData = ({ channel, currencyName, networkInfo, viewMode, ...rest }) total_satoshis_sent, total_satoshis_received, csv_delay, - num_updates + num_updates, } = channel const [fundingTxid] = channel_point.split(':') @@ -35,9 +35,9 @@ const ChannelData = ({ channel, currencyName, networkInfo, viewMode, ...rest }) networkInfo && blockExplorer.showTransaction(networkInfo, fundingTxid)} > - + - ) + ), }, { id: 'closing_txid', @@ -47,21 +47,21 @@ const ChannelData = ({ channel, currencyName, networkInfo, viewMode, ...rest }) networkInfo && blockExplorer.showTransaction(networkInfo, closing_txid)} > - + - ) + ), }, { id: 'num_updates', label: , body: , - value: num_updates + value: num_updates, }, { id: 'csv_delay', label: , body: , - value: csv_delay + value: csv_delay, }, { id: 'total_satoshis_sent', @@ -73,7 +73,7 @@ const ChannelData = ({ channel, currencyName, networkInfo, viewMode, ...rest }) {` `} {currencyName} - ) + ), }, { id: 'total_satoshis_received', @@ -85,7 +85,7 @@ const ChannelData = ({ channel, currencyName, networkInfo, viewMode, ...rest }) {` `} {currencyName} - ) + ), }, { id: 'commit_fee', @@ -97,7 +97,7 @@ const ChannelData = ({ channel, currencyName, networkInfo, viewMode, ...rest }) {` `} {currencyName} - ) + ), }, { id: 'fee_per_kw', @@ -109,8 +109,8 @@ const ChannelData = ({ channel, currencyName, networkInfo, viewMode, ...rest }) {` `} {currencyName} - ) - } + ), + }, ] const idsToInclude = @@ -124,7 +124,7 @@ const ChannelData = ({ channel, currencyName, networkInfo, viewMode, ...rest }) 'total_satoshis_sent', 'total_satoshis_received', 'commit_fee', - 'fee_per_kw' + 'fee_per_kw', ] const rows = idsToInclude.filter(id => channel[id] != null).map(id => data.find(d => d.id === id)) @@ -135,11 +135,11 @@ const ChannelData = ({ channel, currencyName, networkInfo, viewMode, ...rest }) ))} @@ -150,15 +150,15 @@ const ChannelData = ({ channel, currencyName, networkInfo, viewMode, ...rest }) ChannelData.propTypes = { channel: PropTypes.object.isRequired, currencyName: PropTypes.string.isRequired, - viewMode: PropTypes.oneOf([CHANNEL_DATA_VIEW_MODE_BASIC, CHANNEL_DATA_VIEW_MODE_FULL]), networkInfo: PropTypes.shape({ id: PropTypes.string, - name: PropTypes.string - }).isRequired + name: PropTypes.string, + }).isRequired, + viewMode: PropTypes.oneOf([CHANNEL_DATA_VIEW_MODE_BASIC, CHANNEL_DATA_VIEW_MODE_FULL]), } ChannelData.defaultProps = { - viewMode: CHANNEL_DATA_VIEW_MODE_BASIC + viewMode: CHANNEL_DATA_VIEW_MODE_BASIC, } export default ChannelData diff --git a/app/components/Channels/ChannelDetail.js b/app/components/Channels/ChannelDetail.js index bf5e71360ff..6cb487a3060 100644 --- a/app/components/Channels/ChannelDetail.js +++ b/app/components/Channels/ChannelDetail.js @@ -16,28 +16,28 @@ const ChannelDetail = ({ ...rest }) => ( - + - + @@ -45,13 +45,13 @@ const ChannelDetail = ({ ChannelDetail.propTypes = { channel: PropTypes.object.isRequired, - currencyName: PropTypes.string.isRequired, closeChannel: PropTypes.func.isRequired, - setSelectedChannel: PropTypes.func.isRequired, + currencyName: PropTypes.string.isRequired, networkInfo: PropTypes.shape({ id: PropTypes.string, - name: PropTypes.string - }) + name: PropTypes.string, + }), + setSelectedChannel: PropTypes.func.isRequired, } export default ChannelDetail diff --git a/app/components/Channels/ChannelFilter.js b/app/components/Channels/ChannelFilter.js index 9b367055f4b..c8302796749 100644 --- a/app/components/Channels/ChannelFilter.js +++ b/app/components/Channels/ChannelFilter.js @@ -7,7 +7,7 @@ const ChannelFilter = ({ changeFilter, filter, filters, ...rest }) => { const items = filters.map(f => { return { key: f.key, - value: f.name + value: f.name, } }) @@ -15,11 +15,11 @@ const ChannelFilter = ({ changeFilter, filter, filters, ...rest }) => { diff --git a/app/components/Channels/ChannelSearch.js b/app/components/Channels/ChannelSearch.js index bb0928b7dce..dba7e3866d1 100644 --- a/app/components/Channels/ChannelSearch.js +++ b/app/components/Channels/ChannelSearch.js @@ -6,21 +6,21 @@ const ChannelSearch = ({ searchQuery, placeholder, updateChannelSearchQuery, ...
) ChannelSearch.propTypes = { - searchQuery: PropTypes.string, placeholder: PropTypes.string.isRequired, - updateChannelSearchQuery: PropTypes.func.isRequired + searchQuery: PropTypes.string, + updateChannelSearchQuery: PropTypes.func.isRequired, } export default ChannelSearch diff --git a/app/components/Channels/ChannelStatus.js b/app/components/Channels/ChannelStatus.js index 2e97af98db7..0f140628370 100644 --- a/app/components/Channels/ChannelStatus.js +++ b/app/components/Channels/ChannelStatus.js @@ -13,7 +13,7 @@ const variantMap = { pending_close: 'closing', pending_force_close: 'closing', waiting_close: 'closing', - offline: 'offline' + offline: 'offline', } const StatusText = styled(Text)` @@ -34,7 +34,7 @@ const ChannelStatus = ({ status, ...rest }) => ( ) ChannelStatus.propTypes = { - status: PropTypes.oneOf(Object.keys(variantMap)) + status: PropTypes.oneOf(Object.keys(variantMap)), } export default ChannelStatus diff --git a/app/components/Channels/ChannelSummaryList.js b/app/components/Channels/ChannelSummaryList.js index 192d000ec1b..6cc44996f41 100644 --- a/app/components/Channels/ChannelSummaryList.js +++ b/app/components/Channels/ChannelSummaryList.js @@ -25,14 +25,14 @@ const ChannelSummaryList = ({ channels, openModal, setSelectedChannel }) => { const { index, key, style } = rowProps const channel = channels[index].channel || channels[index] return ( -
+
) @@ -43,12 +43,12 @@ const ChannelSummaryList = ({ channels, openModal, setSelectedChannel }) => { {({ width, height }) => { return ( ) }} @@ -59,11 +59,11 @@ const ChannelSummaryList = ({ channels, openModal, setSelectedChannel }) => { ChannelSummaryList.propTypes = { channels: PropTypes.array, openModal: PropTypes.func.isRequired, - setSelectedChannel: PropTypes.func.isRequired + setSelectedChannel: PropTypes.func.isRequired, } ChannelSummaryList.defaultProps = { - channels: [] + channels: [], } export default ChannelSummaryList diff --git a/app/components/Channels/ChannelSummaryListItem.js b/app/components/Channels/ChannelSummaryListItem.js index c1c2069102f..2045ae9a2f2 100644 --- a/app/components/Channels/ChannelSummaryListItem.js +++ b/app/components/Channels/ChannelSummaryListItem.js @@ -19,7 +19,7 @@ const ChannelSummaryListItem = React.memo(props => { local_balance, remote_balance, display_status, - active + active, } = channel const opacity = active ? 1 : 0.3 @@ -38,14 +38,14 @@ const ChannelSummaryListItem = React.memo(props => { - + { setSelectedChannel(channel_point) @@ -63,7 +63,7 @@ ChannelSummaryListItem.displayName = 'ChannelSummaryListItem' ChannelSummaryListItem.propTypes = { channel: PropTypes.object.isRequired, openModal: PropTypes.func.isRequired, - setSelectedChannel: PropTypes.func.isRequired + setSelectedChannel: PropTypes.func.isRequired, } export default ChannelSummaryListItem diff --git a/app/components/Channels/Channels.js b/app/components/Channels/Channels.js index 284331e57f0..44651be8e13 100644 --- a/app/components/Channels/Channels.js +++ b/app/components/Channels/Channels.js @@ -16,27 +16,27 @@ const StyledPersistentTabControl = styled(PersistentTabControl)` class Channels extends React.Component { static propTypes = { allChannels: PropTypes.array, - channels: PropTypes.array, + changeFilter: PropTypes.func.isRequired, channelBalance: PropTypes.number.isRequired, + channels: PropTypes.array, + channelViewMode: PropTypes.string.isRequired, currencyName: PropTypes.string.isRequired, filter: PropTypes.string.isRequired, filters: PropTypes.array.isRequired, + networkInfo: PropTypes.shape({ + id: PropTypes.string, + name: PropTypes.string, + }), + openModal: PropTypes.func.isRequired, searchQuery: PropTypes.string, - changeFilter: PropTypes.func.isRequired, + setChannelViewMode: PropTypes.func.isRequired, setSelectedChannel: PropTypes.func.isRequired, - openModal: PropTypes.func.isRequired, updateChannelSearchQuery: PropTypes.func.isRequired, - channelViewMode: PropTypes.string.isRequired, - setChannelViewMode: PropTypes.func.isRequired, - networkInfo: PropTypes.shape({ - id: PropTypes.string, - name: PropTypes.string - }) } static defaultProps = { allChannels: [], - channels: [] + channels: [], } /*eslint-disable react/destructuring-assignment*/ @@ -65,16 +65,16 @@ class Channels extends React.Component { @@ -84,16 +84,16 @@ class Channels extends React.Component { diff --git a/app/components/Channels/ChannelsActions.js b/app/components/Channels/ChannelsActions.js index 51d3969f25c..38e35af2850 100644 --- a/app/components/Channels/ChannelsActions.js +++ b/app/components/Channels/ChannelsActions.js @@ -20,43 +20,43 @@ const ChannelsActions = ({ intl, ...rest }) => ( - + - ) ChannelsActions.propTypes = { + changeFilter: PropTypes.func.isRequired, + channelViewMode: PropTypes.string.isRequired, filter: PropTypes.string.isRequired, filters: PropTypes.array.isRequired, intl: intlShape.isRequired, + openModal: PropTypes.func.isRequired, searchQuery: PropTypes.string, - changeFilter: PropTypes.func.isRequired, - updateChannelSearchQuery: PropTypes.func.isRequired, - channelViewMode: PropTypes.string.isRequired, setChannelViewMode: PropTypes.func.isRequired, - openModal: PropTypes.func.isRequired + updateChannelSearchQuery: PropTypes.func.isRequired, } export default injectIntl(ChannelsActions) diff --git a/app/components/Channels/ChannelsHeader.js b/app/components/Channels/ChannelsHeader.js index 9532391b2aa..08e4e7741e3 100644 --- a/app/components/Channels/ChannelsHeader.js +++ b/app/components/Channels/ChannelsHeader.js @@ -18,35 +18,35 @@ const ChannelsHeader = ({ ...rest }) => ( - + ) ChannelsHeader.propTypes = { - channels: PropTypes.array, + changeFilter: PropTypes.func.isRequired, channelBalance: PropTypes.number.isRequired, + channels: PropTypes.array, + channelViewMode: PropTypes.string.isRequired, filter: PropTypes.string.isRequired, filters: PropTypes.array.isRequired, + openModal: PropTypes.func.isRequired, searchQuery: PropTypes.string, - changeFilter: PropTypes.func.isRequired, - updateChannelSearchQuery: PropTypes.func.isRequired, - channelViewMode: PropTypes.string.isRequired, setChannelViewMode: PropTypes.func.isRequired, - openModal: PropTypes.func.isRequired + updateChannelSearchQuery: PropTypes.func.isRequired, } ChannelsHeader.defaultProps = { - channels: [] + channels: [], } export default ChannelsHeader diff --git a/app/components/Channels/ChannelsInfo.js b/app/components/Channels/ChannelsInfo.js index 2731171b068..0e8816d3a77 100644 --- a/app/components/Channels/ChannelsInfo.js +++ b/app/components/Channels/ChannelsInfo.js @@ -5,19 +5,19 @@ import ChannelBalance from './ChannelBalance' import ChannelCount from './ChannelCount' const ChannelsInfo = ({ channels, channelBalance, ...rest }) => ( - + ) ChannelsInfo.propTypes = { + channelBalance: PropTypes.number.isRequired, channels: PropTypes.array, - channelBalance: PropTypes.number.isRequired } ChannelsInfo.defaultProps = { - channels: [] + channels: [], } export default ChannelsInfo diff --git a/app/components/Channels/ChannelsViewSwitcher.js b/app/components/Channels/ChannelsViewSwitcher.js index 212baa78903..3256aa22d39 100644 --- a/app/components/Channels/ChannelsViewSwitcher.js +++ b/app/components/Channels/ChannelsViewSwitcher.js @@ -16,17 +16,17 @@ const StyledButton = styled(Button)` } ` StyledButton.propTypes = { - active: PropTypes.bool + active: PropTypes.bool, } const CardButton = injectIntl(({ active, onClick, intl, ...rest }) => ( @@ -35,18 +35,18 @@ const CardButton = injectIntl(({ active, onClick, intl, ...rest }) => ( CardButton.propTypes = { active: PropTypes.bool, - onClick: PropTypes.func.isRequired + onClick: PropTypes.func.isRequired, } const ListButton = injectIntl(({ active, onClick, intl, ...rest }) => ( @@ -55,11 +55,11 @@ const ListButton = injectIntl(({ active, onClick, intl, ...rest }) => ( ListButton.propTypes = { active: PropTypes.bool, - onClick: PropTypes.func.isRequired + onClick: PropTypes.func.isRequired, } const ChannelsViewSwitcher = ({ channelViewMode, setChannelViewMode, ...rest }) => ( - + setChannelViewMode(CHANNEL_LIST_VIEW_MODE_CARD)} @@ -77,7 +77,7 @@ const ChannelsViewSwitcher = ({ channelViewMode, setChannelViewMode, ...rest }) ChannelsViewSwitcher.propTypes = { channelViewMode: PropTypes.string.isRequired, - setChannelViewMode: PropTypes.func.isRequired + setChannelViewMode: PropTypes.func.isRequired, } export default ChannelsViewSwitcher diff --git a/app/components/Channels/NodeCardList.js b/app/components/Channels/NodeCardList.js index f7e524af8dc..f6af8e9b870 100644 --- a/app/components/Channels/NodeCardList.js +++ b/app/components/Channels/NodeCardList.js @@ -21,10 +21,10 @@ const NodeCardList = ({ nodes, updateContactFormSearchQuery, ...rest }) => ( return ( @@ -36,11 +36,11 @@ const NodeCardList = ({ nodes, updateContactFormSearchQuery, ...rest }) => ( NodeCardList.propTypes = { nodes: PropTypes.array, - updateContactFormSearchQuery: PropTypes.func.isRequired + updateContactFormSearchQuery: PropTypes.func.isRequired, } NodeCardList.defaultProps = { - nodes: [] + nodes: [], } export default React.memo(NodeCardList) diff --git a/app/components/Channels/NodeCardView.js b/app/components/Channels/NodeCardView.js index 227897528e0..4d8cdcad148 100644 --- a/app/components/Channels/NodeCardView.js +++ b/app/components/Channels/NodeCardView.js @@ -44,7 +44,7 @@ const TextOverlay = styled(Flex)` const NodeCardView = ({ description, host, image, nickname, nodeClicked, pubkey, ...rest }) => ( nodeClicked(`${pubkey}@${host}`)}> - + {nickname} @@ -58,7 +58,7 @@ NodeCardView.propTypes = { image: PropTypes.string.isRequired, nickname: PropTypes.string.isRequired, nodeClicked: PropTypes.func.isRequired, - pubkey: PropTypes.string.isRequired + pubkey: PropTypes.string.isRequired, } export default React.memo(NodeCardView) diff --git a/app/components/Channels/messages.js b/app/components/Channels/messages.js index bdb8d11cc9e..2b44f4738a4 100644 --- a/app/components/Channels/messages.js +++ b/app/components/Channels/messages.js @@ -84,5 +84,5 @@ export default defineMessages({ node_search_placeholder: 'Search the network', node_search_description: 'Search for nodes by name, public key, or paste their pubkey@host', node_search_results_header: '{count, plural, =0 {No results} other {Search results ({count})}}', - node_suggestions_title: 'Suggested Nodes' + node_suggestions_title: 'Suggested Nodes', }) diff --git a/app/components/GlobalNotification/GlobalNotification.js b/app/components/GlobalNotification/GlobalNotification.js index 78c68b4cdac..5e766bb1da2 100644 --- a/app/components/GlobalNotification/GlobalNotification.js +++ b/app/components/GlobalNotification/GlobalNotification.js @@ -16,7 +16,7 @@ const Wrapper = styled(Box)` class GlobalNotification extends React.Component { static propTypes = { notifications: PropTypes.array, - removeNotification: PropTypes.func.isRequired + removeNotification: PropTypes.func.isRequired, } render() { @@ -32,24 +32,24 @@ class GlobalNotification extends React.Component { } return ( - + {notifications.map(item => ( {show => show && (springStyles => ( removeNotification(item.id)} mb={2} + onClick={() => removeNotification(item.id)} + variant={item.variant} > {prepareMessage(item.message, item.variant)} diff --git a/app/components/Home/CreateWalletButton.js b/app/components/Home/CreateWalletButton.js index 381bd24d07d..dcf538e11d5 100644 --- a/app/components/Home/CreateWalletButton.js +++ b/app/components/Home/CreateWalletButton.js @@ -7,10 +7,10 @@ import PlusCircle from 'components/Icon/PlusCircle' import messages from './messages' const CreateWalletButton = ({ history, ...rest }) => ( - ) CreateWalletButton.propTypes = { - history: PropTypes.object.isRequired + history: PropTypes.object.isRequired, } export default CreateWalletButton diff --git a/app/components/Home/DeleteWalletDialog.js b/app/components/Home/DeleteWalletDialog.js index 526de6aa5e3..fb0253e9df0 100644 --- a/app/components/Home/DeleteWalletDialog.js +++ b/app/components/Home/DeleteWalletDialog.js @@ -19,26 +19,26 @@ const DialogWrapper = ({ intl, isOpen, walletDir, onDelete, onCancel }) => { // bind button disabled state to a form field or ignore it if we are dealing with a remote // wallet and don't have confirmation checkbox const DeleteWalletButton = withFieldState(checkboxFieldName)(({ fieldState, ...rest }) => ( - ) const header = ( - + - + - + @@ -47,21 +47,21 @@ const DialogWrapper = ({ intl, isOpen, walletDir, onDelete, onCancel }) => { const handleSubmit = () => onDelete() return ( - +
- + {walletDir && ( - + - + {walletDir} @@ -73,11 +73,11 @@ const DialogWrapper = ({ intl, isOpen, walletDir, onDelete, onCancel }) => { } DialogWrapper.propTypes = { + intl: intlShape.isRequired, isOpen: PropTypes.bool.isRequired, - onDelete: PropTypes.func.isRequired, onCancel: PropTypes.func.isRequired, + onDelete: PropTypes.func.isRequired, walletDir: PropTypes.string, - intl: intlShape.isRequired } export default injectIntl(DialogWrapper) diff --git a/app/components/Home/Home.js b/app/components/Home/Home.js index 67b128dc355..db48897c43d 100644 --- a/app/components/Home/Home.js +++ b/app/components/Home/Home.js @@ -11,40 +11,40 @@ import WalletsMenu from './WalletsMenu' import WalletUnlocker from './WalletUnlocker' const NoMatch = ({ history, wallets }) => ( - + ) NoMatch.propTypes = { + history: PropTypes.object.isRequired, wallets: PropTypes.array.isRequired, - history: PropTypes.object.isRequired } class Home extends React.Component { static propTypes = { - history: PropTypes.object.isRequired, activeWallet: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), activeWalletSettings: PropTypes.object, + clearStartLndError: PropTypes.func.isRequired, deleteWallet: PropTypes.func.isRequired, + history: PropTypes.object.isRequired, + isLightningGrpcActive: PropTypes.bool.isRequired, + isStartingLnd: PropTypes.bool, + isUnlockingWallet: PropTypes.bool, + isWalletUnlockerGrpcActive: PropTypes.bool.isRequired, lndConnect: PropTypes.string, - startLndError: PropTypes.object, - startingLnd: PropTypes.bool, - lightningGrpcActive: PropTypes.bool.isRequired, - walletUnlockerGrpcActive: PropTypes.bool.isRequired, - wallets: PropTypes.array.isRequired, - startLnd: PropTypes.func.isRequired, - stopLnd: PropTypes.func.isRequired, + putWallet: PropTypes.func.isRequired, + refreshLndConnectURI: PropTypes.func.isRequired, setActiveWallet: PropTypes.func.isRequired, - unlockWallet: PropTypes.func.isRequired, setIsWalletOpen: PropTypes.func.isRequired, setUnlockWalletError: PropTypes.func.isRequired, - clearStartLndError: PropTypes.func.isRequired, - putWallet: PropTypes.func.isRequired, - showNotification: PropTypes.func.isRequired, - refreshLndConnectURI: PropTypes.func.isRequired, showError: PropTypes.func.isRequired, - unlockingWallet: PropTypes.bool, - unlockWalletError: PropTypes.string + showNotification: PropTypes.func.isRequired, + startLnd: PropTypes.func.isRequired, + startLndError: PropTypes.object, + stopLnd: PropTypes.func.isRequired, + unlockWallet: PropTypes.func.isRequired, + unlockWalletError: PropTypes.string, + wallets: PropTypes.array.isRequired, } /** @@ -73,21 +73,21 @@ class Home extends React.Component { deleteWallet, startLnd, startLndError, - startingLnd, + isStartingLnd, unlockWallet, wallets, setActiveWallet, clearStartLndError, showError, stopLnd, - lightningGrpcActive, - walletUnlockerGrpcActive, + isLightningGrpcActive, + isWalletUnlockerGrpcActive, setUnlockWalletError, - unlockingWallet, + isUnlockingWallet, unlockWalletError, putWallet, showNotification, - refreshLndConnectURI + refreshLndConnectURI, } = this.props return ( @@ -95,14 +95,14 @@ class Home extends React.Component { - + @@ -126,20 +126,20 @@ class Home extends React.Component { } return ( ) }} @@ -154,13 +154,13 @@ class Home extends React.Component { } return ( ) }} diff --git a/app/components/Home/NoWallets.js b/app/components/Home/NoWallets.js index f438b78d2f6..a01bf95bcd9 100644 --- a/app/components/Home/NoWallets.js +++ b/app/components/Home/NoWallets.js @@ -7,7 +7,7 @@ import CreateWalletButton from './CreateWalletButton' import messages from './messages' const NoWallets = ({ history, wallets }) => ( - + {wallets.length === 0 ? ( <> @@ -28,8 +28,8 @@ const NoWallets = ({ history, wallets }) => ( ) NoWallets.propTypes = { + history: PropTypes.object.isRequired, wallets: PropTypes.array.isRequired, - history: PropTypes.object.isRequired } export default NoWallets diff --git a/app/components/Home/WalletHeader.js b/app/components/Home/WalletHeader.js index a78e78ee54b..6bc5fd196f4 100644 --- a/app/components/Home/WalletHeader.js +++ b/app/components/Home/WalletHeader.js @@ -6,14 +6,14 @@ import { WalletName } from 'components/Util' const WalletHeader = ({ wallet }) => ( - + ) WalletHeader.propTypes = { - wallet: PropTypes.object.isRequired + wallet: PropTypes.object.isRequired, } export default WalletHeader diff --git a/app/components/Home/WalletLauncher.js b/app/components/Home/WalletLauncher.js index 359eb31049e..311975178f8 100644 --- a/app/components/Home/WalletLauncher.js +++ b/app/components/Home/WalletLauncher.js @@ -25,7 +25,7 @@ const autopilotDefaults = { autopilotMaxchannels: 5, autopilotMinchansize: 20000, autopilotMaxchansize: 16777215, - autopilotAllocation: 60 + autopilotAllocation: 60, } // converts form format to db/lnd compatible format @@ -98,36 +98,36 @@ const parseLndConnectURI = uri => { return { host: host && decodeURIComponent(host), cert: cert && decodeURIComponent(cert), - macaroon: macaroon && decodeURIComponent(macaroon) + macaroon: macaroon && decodeURIComponent(macaroon), } } catch (e) { return { host: '', cert: '', - macaroon: '' + macaroon: '', } } } class WalletLauncher extends React.Component { static propTypes = { - intl: intlShape.isRequired, - wallet: PropTypes.object.isRequired, - deleteWallet: PropTypes.func.isRequired, - startLnd: PropTypes.func.isRequired, - lightningGrpcActive: PropTypes.bool.isRequired, - walletUnlockerGrpcActive: PropTypes.bool.isRequired, - startLndError: PropTypes.object, - startingLnd: PropTypes.bool.isRequired, clearStartLndError: PropTypes.func.isRequired, + deleteWallet: PropTypes.func.isRequired, + history: PropTypes.shape({ + push: PropTypes.func.isRequired, + }), + intl: intlShape.isRequired, + isLightningGrpcActive: PropTypes.bool.isRequired, + isStartingLnd: PropTypes.bool.isRequired, + isWalletUnlockerGrpcActive: PropTypes.bool.isRequired, putWallet: PropTypes.func.isRequired, - showNotification: PropTypes.func.isRequired, + refreshLndConnectURI: PropTypes.func.isRequired, showError: PropTypes.func.isRequired, + showNotification: PropTypes.func.isRequired, + startLnd: PropTypes.func.isRequired, + startLndError: PropTypes.object, stopLnd: PropTypes.func.isRequired, - refreshLndConnectURI: PropTypes.func.isRequired, - history: PropTypes.shape({ - push: PropTypes.func.isRequired - }) + wallet: PropTypes.object.isRequired, } componentDidMount() { @@ -147,12 +147,12 @@ class WalletLauncher extends React.Component { componentDidUpdate(prevProps) { const { history, - lightningGrpcActive, - walletUnlockerGrpcActive, + isLightningGrpcActive, + isWalletUnlockerGrpcActive, startLndError, showError, clearStartLndError, - wallet + wallet, } = this.props // If we got lnd start errors, show as a global error. @@ -162,12 +162,12 @@ class WalletLauncher extends React.Component { } // If the wallet unlocker became active, switch to the login screen - if (walletUnlockerGrpcActive && !prevProps.walletUnlockerGrpcActive) { + if (isWalletUnlockerGrpcActive && !prevProps.isWalletUnlockerGrpcActive) { history.push(`/home/wallet/${wallet.id}/unlock`) } // If an active wallet connection has been established, switch to the app. - if (lightningGrpcActive && !prevProps.lightningGrpcActive) { + if (isLightningGrpcActive && !prevProps.isLightningGrpcActive) { if (wallet.type === 'local') { history.push('/syncing') } else { @@ -194,7 +194,7 @@ class WalletLauncher extends React.Component { showNotification, showError, intl, - wallet + wallet, } = this.props try { const { formApi } = this @@ -202,7 +202,9 @@ class WalletLauncher extends React.Component { const { values } = formState let result = values - if (wallet.type !== 'local') { + if (wallet.type === 'local') { + result = formToWalletFormat(values) + } else { const hasHideLndConnectUri = typeof formApi.getValue('hideLndConnectUri') !== 'undefined' const lndconnectType = getLndConnectType(values.lndconnectUri) if (lndconnectType === LNDCONNECT_EMBEDDED) { @@ -220,7 +222,7 @@ class WalletLauncher extends React.Component { const config = Object.assign({}, values, { ...parseLndConnectURI(values.lndconnectUri), lndconnectUri: undefined, // delete uris so the main process re-generates them - lndconnectQRCode: undefined + lndconnectQRCode: undefined, }) const generatedConfig = formToWalletFormat( await refreshLndConnectURI(config) // wait for the config generate complete message from the main process @@ -236,8 +238,6 @@ class WalletLauncher extends React.Component { if (hasHideLndConnectUri) { formApi.setValue('hideLndConnectUri', true) } - } else { - result = formToWalletFormat(values) } putWallet(result) @@ -294,7 +294,7 @@ class WalletLauncher extends React.Component { if (getLndConnectType(wallet.lndconnectUri) === LNDCONNECT_EMBEDDED) { return !unsafeShallowCompare(clean(wallet), clean(formState.values), { name: '', - lndconnectUri: '' + lndconnectUri: '', }) } @@ -307,7 +307,7 @@ class WalletLauncher extends React.Component { name: '', cert: '', host: '', - macaroon: '' + macaroon: '', } ) } @@ -316,7 +316,7 @@ class WalletLauncher extends React.Component { ...autopilotDefaults, autopilot: '', alias: '', - name: '' + name: '', } // local node return !unsafeShallowCompare( @@ -331,18 +331,18 @@ class WalletLauncher extends React.Component { } render() { - const { wallet, startingLnd } = this.props + const { wallet, isStartingLnd } = this.props const actionBarButtons = formState => ( <> - @@ -352,22 +352,22 @@ class WalletLauncher extends React.Component { const walletConverted = walletToFormFormat(wallet) return ( - - + + {({ formState }) => ( - - + + - + @@ -387,19 +387,19 @@ class WalletLauncher extends React.Component { ) : ( )} - + - diff --git a/app/components/Home/WalletSettingsFormLocal.js b/app/components/Home/WalletSettingsFormLocal.js index b65807f6ca2..3ba7db1b91b 100644 --- a/app/components/Home/WalletSettingsFormLocal.js +++ b/app/components/Home/WalletSettingsFormLocal.js @@ -9,11 +9,11 @@ import messages from './messages' class WalletSettingsFormLocal extends React.Component { static propTypes = { - intl: intlShape.isRequired, autopilotDefaults: PropTypes.object.isRequired, formApi: PropTypes.object.isRequired, formState: PropTypes.object.isRequired, - wallet: PropTypes.object.isRequired + intl: intlShape.isRequired, + wallet: PropTypes.object.isRequired, } resetAutopilotSettings = () => { @@ -32,29 +32,28 @@ class WalletSettingsFormLocal extends React.Component { autopilotMaxchannels, autopilotMinchansize, autopilotMaxchansize, - autopilotAllocation + autopilotAllocation, } = wallet return ( <> - + - + - } right={chain} /> - } right={network} /> + } py={2} right={chain} /> + } py={2} right={network} /> - + - + } + py={2} right={ } /> - + } + mt={4} + py={2} right={} /> - + {formState.values.autopilot ? ( <> } + py={2} right={ } /> } + py={2} right={ } /> } + py={2} right={ } /> } + py={2} right={ } /> - diff --git a/app/components/Home/WalletSettingsFormRemote.js b/app/components/Home/WalletSettingsFormRemote.js index 126e1eac5bf..eb47cc69174 100644 --- a/app/components/Home/WalletSettingsFormRemote.js +++ b/app/components/Home/WalletSettingsFormRemote.js @@ -10,7 +10,7 @@ import { Text, OpenDialogInput, RowLabel, - LndConnectionStringEditor + LndConnectionStringEditor, } from 'components/UI' import messages from './messages' @@ -21,91 +21,91 @@ const WalletSettingsFormRemote = ({ host, cert, macaroon, - isEmbeddedConnectionString + isEmbeddedConnectionString, }) => { return ( <> - + - + - } right={wallet.chain} /> - } right={wallet.network} /> + } py={2} right={wallet.chain} /> + } py={2} right={wallet.network} /> - + - + {isEmbeddedConnectionString ? ( } + isRequired label={intl.formatMessage({ - ...messages.connection_string + ...messages.connection_string, })} + name="lndconnectUri" placeholder={intl.formatMessage({ - ...messages.connection_string + ...messages.connection_string, })} validateOnBlur validateOnChange - required /> ) : ( <> } + py={2} right={ } /> } - right={} + py={2} + right={} /> } + py={2} right={ } @@ -113,32 +113,32 @@ const WalletSettingsFormRemote = ({ )} - + - + } + py={2} right={ } /> @@ -148,12 +148,12 @@ const WalletSettingsFormRemote = ({ } WalletSettingsFormRemote.propTypes = { - intl: intlShape.isRequired, - wallet: PropTypes.object.isRequired, - host: PropTypes.string.isRequired, cert: PropTypes.string.isRequired, + host: PropTypes.string.isRequired, + intl: intlShape.isRequired, + isEmbeddedConnectionString: PropTypes.bool.isRequired, macaroon: PropTypes.string.isRequired, - isEmbeddedConnectionString: PropTypes.bool.isRequired + wallet: PropTypes.object.isRequired, } export default injectIntl(WalletSettingsFormRemote) diff --git a/app/components/Home/WalletUnlocker.js b/app/components/Home/WalletUnlocker.js index c22efa69464..253ecae2588 100644 --- a/app/components/Home/WalletUnlocker.js +++ b/app/components/Home/WalletUnlocker.js @@ -18,26 +18,26 @@ class WalletUnlocker extends React.Component { static displayName = 'WalletUnlocker' static propTypes = { - intl: intlShape.isRequired, - wallet: PropTypes.object.isRequired, - lightningGrpcActive: PropTypes.bool.isRequired, history: PropTypes.shape({ - push: PropTypes.func.isRequired + push: PropTypes.func.isRequired, }), - unlockingWallet: PropTypes.bool, - unlockWalletError: PropTypes.string, + intl: intlShape.isRequired, + isLightningGrpcActive: PropTypes.bool.isRequired, + isUnlockingWallet: PropTypes.bool, + setUnlockWalletError: PropTypes.func.isRequired, unlockWallet: PropTypes.func.isRequired, - setUnlockWalletError: PropTypes.func.isRequired + unlockWalletError: PropTypes.string, + wallet: PropTypes.object.isRequired, } componentDidUpdate(prevProps) { const { wallet, - lightningGrpcActive, + isLightningGrpcActive, history, setUnlockWalletError, - unlockingWallet, - unlockWalletError + isUnlockingWallet, + unlockWalletError, } = this.props // Set the form error if we got an error unlocking. @@ -47,7 +47,7 @@ class WalletUnlocker extends React.Component { } // Redirect to the app if the wallet was successfully unlocked. - if (!unlockingWallet && prevProps.unlockingWallet && !unlockWalletError) { + if (!isUnlockingWallet && prevProps.isUnlockingWallet && !unlockWalletError) { if (wallet.type === 'local') { history.push('/syncing') } else { @@ -56,7 +56,7 @@ class WalletUnlocker extends React.Component { } // If an active wallet connection has been established, switch to the app. - if (lightningGrpcActive && !prevProps.lightningGrpcActive) { + if (isLightningGrpcActive && !prevProps.isLightningGrpcActive) { if (wallet.type === 'local') { history.push('/syncing') } else { @@ -87,36 +87,36 @@ class WalletUnlocker extends React.Component { } render = () => { - const { intl, unlockingWallet, wallet } = this.props + const { intl, isUnlockingWallet, wallet } = this.props return ( {({ formState }) => ( <> } - placeholder={intl.formatMessage({ ...messages.wallet_unlocker_password_placeholder })} my={3} + placeholder={intl.formatMessage({ ...messages.wallet_unlocker_password_placeholder })} validate={this.validatePassword} validateOnBlur validateOnChange={formState.invalid} + willAutoFocus /> - diff --git a/app/components/Home/WalletsMenu.js b/app/components/Home/WalletsMenu.js index 7853f10baab..3dd5e307ea5 100644 --- a/app/components/Home/WalletsMenu.js +++ b/app/components/Home/WalletsMenu.js @@ -15,22 +15,22 @@ const WalletGroup = ({ setActiveWallet, title, wallets, ...rest }) => ( {wallets.map(wallet => ( setActiveWallet(wallet.id)} style={{ display: 'block', whiteSpace: 'nowrap', overflow: 'hidden', - textOverflow: 'ellipsis' + textOverflow: 'ellipsis', }} + to={`/home/wallet/${wallet.id}`} > @@ -42,11 +42,11 @@ const WalletGroup = ({ setActiveWallet, title, wallets, ...rest }) => ( WalletGroup.propTypes = { setActiveWallet: PropTypes.func.isRequired, title: PropTypes.string.isRequired, - wallets: PropTypes.array + wallets: PropTypes.array, } WalletGroup.defaultProps = { - wallets: [] + wallets: [], } class WalletsMenu extends React.Component { @@ -55,7 +55,7 @@ class WalletsMenu extends React.Component { static propTypes = { intl: intlShape.isRequired, setActiveWallet: PropTypes.func.isRequired, - wallets: PropTypes.array.isRequired + wallets: PropTypes.array.isRequired, } render() { @@ -66,16 +66,16 @@ class WalletsMenu extends React.Component { return ( {otherWallets.length > 0 && ( )} diff --git a/app/components/Home/messages.js b/app/components/Home/messages.js index a8ad2b68937..2f2ad9c4380 100644 --- a/app/components/Home/messages.js +++ b/app/components/Home/messages.js @@ -50,5 +50,5 @@ export default defineMessages({ hostname_description: 'Hostname and port of the Lnd gRPC interface.', macaroon_description: 'Path to the lnd macaroon file.', hide_connection_string: 'Hide connection string', - connection_string: 'Connection string' + connection_string: 'Connection string', }) diff --git a/app/components/Icon/AngleDown.js b/app/components/Icon/AngleDown.js index a9304a26331..31c979a4eb2 100644 --- a/app/components/Icon/AngleDown.js +++ b/app/components/Icon/AngleDown.js @@ -1,8 +1,8 @@ import React from 'react' const SvgAngleDown = props => ( - - + + ) diff --git a/app/components/Icon/AngleLeft.js b/app/components/Icon/AngleLeft.js index e066cc30b5a..07775fd7459 100644 --- a/app/components/Icon/AngleLeft.js +++ b/app/components/Icon/AngleLeft.js @@ -1,8 +1,8 @@ import React from 'react' const SvgAngleLeft = props => ( - - + + ) diff --git a/app/components/Icon/AngleRight.js b/app/components/Icon/AngleRight.js index 2025fa9c932..10263ab850e 100644 --- a/app/components/Icon/AngleRight.js +++ b/app/components/Icon/AngleRight.js @@ -1,8 +1,8 @@ import React from 'react' const SvgAngleRight = props => ( - - + + ) diff --git a/app/components/Icon/AngleUp.js b/app/components/Icon/AngleUp.js index b02dc623727..3ba026c82e4 100644 --- a/app/components/Icon/AngleUp.js +++ b/app/components/Icon/AngleUp.js @@ -1,8 +1,8 @@ import React from 'react' const SvgAngleUp = props => ( - - + + ) diff --git a/app/components/Icon/ArrowLeft.js b/app/components/Icon/ArrowLeft.js index 824d915ceaa..736b3c0ce08 100644 --- a/app/components/Icon/ArrowLeft.js +++ b/app/components/Icon/ArrowLeft.js @@ -1,7 +1,7 @@ import React from 'react' const SvgArrowLeft = props => ( - + ( - + diff --git a/app/components/Icon/BigArrowRight.js b/app/components/Icon/BigArrowRight.js index 8c462bef431..356d07bf7c3 100644 --- a/app/components/Icon/BigArrowRight.js +++ b/app/components/Icon/BigArrowRight.js @@ -1,11 +1,11 @@ import React from 'react' const SvgBigArrowRight = props => ( - + diff --git a/app/components/Icon/Bitcoin.js b/app/components/Icon/Bitcoin.js index c432360cefd..27c3636909e 100644 --- a/app/components/Icon/Bitcoin.js +++ b/app/components/Icon/Bitcoin.js @@ -1,11 +1,11 @@ import React from 'react' const SvgBitcoin = props => ( - + ) diff --git a/app/components/Icon/Btcpay.js b/app/components/Icon/Btcpay.js index 9d8e195dcd6..233e5bd2371 100644 --- a/app/components/Icon/Btcpay.js +++ b/app/components/Icon/Btcpay.js @@ -1,7 +1,7 @@ import React from 'react' const SvgBtcpay = props => ( - + ( diff --git a/app/components/Icon/Channels.js b/app/components/Icon/Channels.js index 02d1abe8011..817eca4d89a 100644 --- a/app/components/Icon/Channels.js +++ b/app/components/Icon/Channels.js @@ -1,7 +1,7 @@ import React from 'react' const SvgChannels = props => ( - + diff --git a/app/components/Icon/Check.js b/app/components/Icon/Check.js index 8a3bdfbbb74..f0b4008aff9 100644 --- a/app/components/Icon/Check.js +++ b/app/components/Icon/Check.js @@ -2,15 +2,15 @@ import React from 'react' const SvgCheck = props => ( diff --git a/app/components/Icon/CheckCircle.js b/app/components/Icon/CheckCircle.js index 970c55169f1..a0604dcff5e 100644 --- a/app/components/Icon/CheckCircle.js +++ b/app/components/Icon/CheckCircle.js @@ -2,15 +2,15 @@ import React from 'react' const SvgCheckCircle = props => ( diff --git a/app/components/Icon/Circle.js b/app/components/Icon/Circle.js index 9adfce97139..b7eba89b138 100644 --- a/app/components/Icon/Circle.js +++ b/app/components/Icon/Circle.js @@ -1,8 +1,8 @@ import React from 'react' const SvgCircle = props => ( - - + + ) diff --git a/app/components/Icon/Clock.js b/app/components/Icon/Clock.js index 1d1a29cdf43..7f934708b8e 100644 --- a/app/components/Icon/Clock.js +++ b/app/components/Icon/Clock.js @@ -2,15 +2,15 @@ import React from 'react' const SvgClock = props => ( diff --git a/app/components/Icon/Close.js b/app/components/Icon/Close.js index e651126358f..8191453d6e9 100644 --- a/app/components/Icon/Close.js +++ b/app/components/Icon/Close.js @@ -1,7 +1,7 @@ import React from 'react' const SvgClose = props => ( - + diff --git a/app/components/Icon/CloudLightning.js b/app/components/Icon/CloudLightning.js index f897fc7924f..ffc1b35bd31 100644 --- a/app/components/Icon/CloudLightning.js +++ b/app/components/Icon/CloudLightning.js @@ -2,15 +2,15 @@ import React from 'react' const SvgCloudLightning = props => ( diff --git a/app/components/Icon/Cloudbolt.js b/app/components/Icon/Cloudbolt.js index 0bd59af0ce9..7c7104f1ea9 100644 --- a/app/components/Icon/Cloudbolt.js +++ b/app/components/Icon/Cloudbolt.js @@ -1,7 +1,7 @@ import React from 'react' const SvgCloudbolt = props => ( - + ( - + diff --git a/app/components/Icon/Copy.js b/app/components/Icon/Copy.js index 0191bbd8856..28b81369998 100644 --- a/app/components/Icon/Copy.js +++ b/app/components/Icon/Copy.js @@ -2,18 +2,18 @@ import React from 'react' const SvgCopy = props => ( - + ) diff --git a/app/components/Icon/Delete.js b/app/components/Icon/Delete.js index 57730e884b2..633d6dfeb54 100644 --- a/app/components/Icon/Delete.js +++ b/app/components/Icon/Delete.js @@ -1,14 +1,14 @@ import React from 'react' const SvgDelete = props => ( - + - + ( - + ) diff --git a/app/components/Icon/ExternalLink.js b/app/components/Icon/ExternalLink.js index 7df2a5d33e5..b0a34a09095 100644 --- a/app/components/Icon/ExternalLink.js +++ b/app/components/Icon/ExternalLink.js @@ -1,10 +1,10 @@ import React from 'react' const SvgExternalLink = props => ( - + ) diff --git a/app/components/Icon/Eye.js b/app/components/Icon/Eye.js index e651c68d03b..fd61604ca2b 100644 --- a/app/components/Icon/Eye.js +++ b/app/components/Icon/Eye.js @@ -2,15 +2,15 @@ import React from 'react' const SvgEye = props => ( diff --git a/app/components/Icon/FolderOpen.js b/app/components/Icon/FolderOpen.js index 24559606859..8bb4e662d92 100644 --- a/app/components/Icon/FolderOpen.js +++ b/app/components/Icon/FolderOpen.js @@ -1,10 +1,10 @@ import React from 'react' const SvgFolderOpen = props => ( - + ) diff --git a/app/components/Icon/Globe.js b/app/components/Icon/Globe.js index b1cf5dd9e3e..5cace3f9316 100644 --- a/app/components/Icon/Globe.js +++ b/app/components/Icon/Globe.js @@ -2,15 +2,15 @@ import React from 'react' const SvgGlobe = props => ( diff --git a/app/components/Icon/Help.js b/app/components/Icon/Help.js index ccf6996ccdf..182d10ee41d 100644 --- a/app/components/Icon/Help.js +++ b/app/components/Icon/Help.js @@ -2,15 +2,15 @@ import React from 'react' const SvgHelp = props => ( diff --git a/app/components/Icon/Help2.js b/app/components/Icon/Help2.js index 2994ec346cb..3de72f97ab2 100644 --- a/app/components/Icon/Help2.js +++ b/app/components/Icon/Help2.js @@ -1,15 +1,15 @@ import React from 'react' const SvgHelp2 = props => ( - + diff --git a/app/components/Icon/IconPlus.js b/app/components/Icon/IconPlus.js index fa6e5147a2c..f3f32e1356f 100644 --- a/app/components/Icon/IconPlus.js +++ b/app/components/Icon/IconPlus.js @@ -1,7 +1,7 @@ import React from 'react' const SvgIconPlus = props => ( - + diff --git a/app/components/Icon/LayoutCards.js b/app/components/Icon/LayoutCards.js index 4b96ee322ce..c6f6d8a2321 100644 --- a/app/components/Icon/LayoutCards.js +++ b/app/components/Icon/LayoutCards.js @@ -1,7 +1,7 @@ import React from 'react' const SvgLayoutCards = props => ( - + ( - + ( - + @@ -9,10 +9,10 @@ const SvgLightning = props => ( - + diff --git a/app/components/Icon/LightningChannel.js b/app/components/Icon/LightningChannel.js index 8186c9f0721..b4bd255e07d 100644 --- a/app/components/Icon/LightningChannel.js +++ b/app/components/Icon/LightningChannel.js @@ -1,12 +1,12 @@ import React from 'react' const SvgLightningChannel = props => ( - + - + diff --git a/app/components/Icon/Litecoin.js b/app/components/Icon/Litecoin.js index 7a0ca367977..e9549c452ef 100644 --- a/app/components/Icon/Litecoin.js +++ b/app/components/Icon/Litecoin.js @@ -1,7 +1,7 @@ import React from 'react' const SvgLitecoin = props => ( - + @@ -9,12 +9,12 @@ const SvgLitecoin = props => ( - + diff --git a/app/components/Icon/LndLogo.js b/app/components/Icon/LndLogo.js index 077eeb219bd..d0eb26d62ee 100644 --- a/app/components/Icon/LndLogo.js +++ b/app/components/Icon/LndLogo.js @@ -1,7 +1,7 @@ import React from 'react' const SvgLndLogo = props => ( - + ( - + ( - + diff --git a/app/components/Icon/Onchain.js b/app/components/Icon/Onchain.js index 4718637147d..0bcf0bd3f9e 100644 --- a/app/components/Icon/Onchain.js +++ b/app/components/Icon/Onchain.js @@ -1,7 +1,7 @@ import React from 'react' const SvgOnchain = props => ( - + @@ -9,18 +9,18 @@ const SvgOnchain = props => ( - + diff --git a/app/components/Icon/Orbit.js b/app/components/Icon/Orbit.js index ae28a6f6d55..cc1f353e3c8 100644 --- a/app/components/Icon/Orbit.js +++ b/app/components/Icon/Orbit.js @@ -1,9 +1,9 @@ import React from 'react' const SvgOrbit = props => ( - + - + ( /> - + ( /> - + diff --git a/app/components/Icon/Padlock.js b/app/components/Icon/Padlock.js index 5b2de973745..3283bace2b6 100644 --- a/app/components/Icon/Padlock.js +++ b/app/components/Icon/Padlock.js @@ -1,11 +1,11 @@ import React from 'react' const SvgPadlock = props => ( - + ) diff --git a/app/components/Icon/Peers.js b/app/components/Icon/Peers.js index fe099f96d4c..27f0b3fb533 100644 --- a/app/components/Icon/Peers.js +++ b/app/components/Icon/Peers.js @@ -1,14 +1,14 @@ import React from 'react' const SvgPeers = props => ( - + diff --git a/app/components/Icon/Plus.js b/app/components/Icon/Plus.js index 3b17508cf39..9ed9644f8d1 100644 --- a/app/components/Icon/Plus.js +++ b/app/components/Icon/Plus.js @@ -2,15 +2,15 @@ import React from 'react' const SvgPlus = props => ( diff --git a/app/components/Icon/PlusCircle.js b/app/components/Icon/PlusCircle.js index 2b0c4515aa5..97af664d5d3 100644 --- a/app/components/Icon/PlusCircle.js +++ b/app/components/Icon/PlusCircle.js @@ -1,7 +1,7 @@ import React from 'react' const SvgPlusCircle = props => ( - + diff --git a/app/components/Icon/Qrcode.js b/app/components/Icon/Qrcode.js index 53da37237f3..8cb71e5bcf0 100644 --- a/app/components/Icon/Qrcode.js +++ b/app/components/Icon/Qrcode.js @@ -1,7 +1,7 @@ import React from 'react' const SvgQrcode = props => ( - + diff --git a/app/components/Icon/Receive.js b/app/components/Icon/Receive.js index ea84e3db93f..0d47db4c4f6 100644 --- a/app/components/Icon/Receive.js +++ b/app/components/Icon/Receive.js @@ -1,7 +1,7 @@ import React from 'react' const SvgReceive = props => ( - + @@ -9,9 +9,9 @@ const SvgReceive = props => ( - - - + + + ) diff --git a/app/components/Icon/Search.js b/app/components/Icon/Search.js index 1a040bef2bd..0692e6ad52d 100644 --- a/app/components/Icon/Search.js +++ b/app/components/Icon/Search.js @@ -2,15 +2,15 @@ import React from 'react' const SvgSearch = props => ( diff --git a/app/components/Icon/Send.js b/app/components/Icon/Send.js index 8101ffe1575..dc9ea6842c0 100644 --- a/app/components/Icon/Send.js +++ b/app/components/Icon/Send.js @@ -1,7 +1,7 @@ import React from 'react' const SvgSend = props => ( - + @@ -9,9 +9,9 @@ const SvgSend = props => ( - - - + + + ) diff --git a/app/components/Icon/Settings.js b/app/components/Icon/Settings.js index 3babe437ca2..f0edade13af 100644 --- a/app/components/Icon/Settings.js +++ b/app/components/Icon/Settings.js @@ -1,14 +1,14 @@ import React from 'react' const SvgSettings = props => ( - + diff --git a/app/components/Icon/Spinner.js b/app/components/Icon/Spinner.js index a634a8df066..86d4d2410d7 100644 --- a/app/components/Icon/Spinner.js +++ b/app/components/Icon/Spinner.js @@ -1,11 +1,11 @@ import React from 'react' const SvgSpinner = props => ( - + diff --git a/app/components/Icon/Success.js b/app/components/Icon/Success.js index 50610f9988c..130f1b8964e 100644 --- a/app/components/Icon/Success.js +++ b/app/components/Icon/Success.js @@ -1,11 +1,11 @@ import React from 'react' const SvgSuccess = props => ( - + diff --git a/app/components/Icon/Sync.js b/app/components/Icon/Sync.js index c8952817082..25faabb216e 100644 --- a/app/components/Icon/Sync.js +++ b/app/components/Icon/Sync.js @@ -3,17 +3,17 @@ import React from 'react' const SvgSync = props => ( ) diff --git a/app/components/Icon/User.js b/app/components/Icon/User.js index fe067abcbd3..c662935ef11 100644 --- a/app/components/Icon/User.js +++ b/app/components/Icon/User.js @@ -2,15 +2,15 @@ import React from 'react' const SvgUser = props => ( diff --git a/app/components/Icon/Wallet.js b/app/components/Icon/Wallet.js index f971d77e84f..aef305aa14f 100644 --- a/app/components/Icon/Wallet.js +++ b/app/components/Icon/Wallet.js @@ -1,7 +1,7 @@ import React from 'react' const SvgWallet = props => ( - + diff --git a/app/components/Icon/Wallet2.js b/app/components/Icon/Wallet2.js index d96588a6021..cd5711883ed 100644 --- a/app/components/Icon/Wallet2.js +++ b/app/components/Icon/Wallet2.js @@ -1,7 +1,7 @@ import React from 'react' const SvgWallet2 = props => ( - + diff --git a/app/components/Icon/Warning.js b/app/components/Icon/Warning.js index d655ba4e4c7..a317b78bb0c 100644 --- a/app/components/Icon/Warning.js +++ b/app/components/Icon/Warning.js @@ -1,11 +1,11 @@ import React from 'react' const SvgWarning = props => ( - + diff --git a/app/components/Icon/X.js b/app/components/Icon/X.js index d1f60288e55..6024cf711b9 100644 --- a/app/components/Icon/X.js +++ b/app/components/Icon/X.js @@ -1,11 +1,11 @@ import React from 'react' const SvgX = props => ( - + ( - + ) diff --git a/app/components/Icon/ZapLogo.js b/app/components/Icon/ZapLogo.js index ae4e107a89c..bc483775457 100644 --- a/app/components/Icon/ZapLogo.js +++ b/app/components/Icon/ZapLogo.js @@ -1,7 +1,7 @@ import React from 'react' const SvgZapLogo = props => ( - + ( - + ) diff --git a/app/components/LoadingBolt/LoadingBolt.js b/app/components/LoadingBolt/LoadingBolt.js index b6f8eaf6dfc..607d38decdc 100644 --- a/app/components/LoadingBolt/LoadingBolt.js +++ b/app/components/LoadingBolt/LoadingBolt.js @@ -54,11 +54,11 @@ const FullPageGradient = styled(Flex)` class LoadingBolt extends React.PureComponent { static propTypes = { isLoading: PropTypes.bool.isRequired, - message: PropTypes.object + message: PropTypes.object, } static defaultProps = { - message: messages.loading + message: messages.loading, } render() { @@ -66,17 +66,17 @@ class LoadingBolt extends React.PureComponent { return ( {show => show && (springStyles => ( - + diff --git a/app/components/LoadingBolt/messages.js b/app/components/LoadingBolt/messages.js index f62e802e285..43f44649934 100644 --- a/app/components/LoadingBolt/messages.js +++ b/app/components/LoadingBolt/messages.js @@ -8,5 +8,5 @@ export default defineMessages({ starting_wallet_unlocker: 'Starting wallet unlocker', connecting_to_unlocker: 'Connecting to unlocker interface', starting_neutrino: 'Starting Neutrino', - fetching_tickers: 'Fetching tickers' + fetching_tickers: 'Fetching tickers', }) diff --git a/app/components/Onboarding/Onboarding.js b/app/components/Onboarding/Onboarding.js index 908e216339f..095d586d8cb 100644 --- a/app/components/Onboarding/Onboarding.js +++ b/app/components/Onboarding/Onboarding.js @@ -16,54 +16,54 @@ import { SeedConfirm, SeedView, WalletCreate, - WalletRecover + WalletRecover, } from './Steps' import messages from './messages' class Onboarding extends React.Component { static propTypes = { // STATE - autopilot: PropTypes.bool, - name: PropTypes.string, - connectionType: PropTypes.string, - connectionHost: PropTypes.string, + autopilot: PropTypes.bool, // eslint-disable-line react/boolean-prop-naming + clearStartLndError: PropTypes.func.isRequired, connectionCert: PropTypes.string, + connectionHost: PropTypes.string, connectionMacaroon: PropTypes.string, connectionString: PropTypes.string, - lightningGrpcActive: PropTypes.bool, - unlockWalletError: PropTypes.string, - walletUnlockerGrpcActive: PropTypes.bool, - seed: PropTypes.array, - startLndHostError: PropTypes.string, - startLndCertError: PropTypes.string, - startLndMacaroonError: PropTypes.string, - onboarded: PropTypes.bool, - fetchingSeed: PropTypes.bool, - lndConnect: PropTypes.string, - - // DISPATCH + connectionType: PropTypes.string, createNewWallet: PropTypes.func.isRequired, fetchSeed: PropTypes.func.isRequired, + isFetchingSeed: PropTypes.bool, + isLightningGrpcActive: PropTypes.bool, + isOnboarded: PropTypes.bool, + isWalletUnlockerGrpcActive: PropTypes.bool, + lndConnect: PropTypes.string, + name: PropTypes.string, recoverOldWallet: PropTypes.func.isRequired, resetOnboarding: PropTypes.func.isRequired, + + // DISPATCH + seed: PropTypes.array, setAutopilot: PropTypes.func.isRequired, - setConnectionType: PropTypes.func.isRequired, - setConnectionHost: PropTypes.func.isRequired, setConnectionCert: PropTypes.func.isRequired, + setConnectionHost: PropTypes.func.isRequired, setConnectionMacaroon: PropTypes.func.isRequired, setConnectionString: PropTypes.func.isRequired, + setConnectionType: PropTypes.func.isRequired, setLndconnect: PropTypes.func.isRequired, - clearStartLndError: PropTypes.func.isRequired, setName: PropTypes.func.isRequired, setPassword: PropTypes.func.isRequired, setSeed: PropTypes.func.isRequired, setUnlockWalletError: PropTypes.func.isRequired, startLnd: PropTypes.func.isRequired, + startLndCertError: PropTypes.string, + startLndHostError: PropTypes.string, + startLndMacaroonError: PropTypes.string, stopLnd: PropTypes.func.isRequired, unlockWallet: PropTypes.func.isRequired, - validateHost: PropTypes.func.isRequired, + unlockWalletError: PropTypes.string, validateCert: PropTypes.func.isRequired, - validateMacaroon: PropTypes.func.isRequired + validateHost: PropTypes.func.isRequired, + validateMacaroon: PropTypes.func.isRequired, } componentWillUnmount() { @@ -85,14 +85,14 @@ class Onboarding extends React.Component { connectionCert, connectionMacaroon, connectionString, - lightningGrpcActive, - walletUnlockerGrpcActive, + isLightningGrpcActive, + isWalletUnlockerGrpcActive, seed, startLndHostError, startLndCertError, startLndMacaroonError, unlockWalletError, - fetchingSeed, + isFetchingSeed, lndConnect, // DISPATCH @@ -117,7 +117,7 @@ class Onboarding extends React.Component { createNewWallet, recoverOldWallet, stopLnd, - unlockWallet + unlockWallet, } = this.props let formSteps = [] @@ -131,13 +131,13 @@ class Onboarding extends React.Component { , , , , , - + , ] break @@ -151,7 +151,7 @@ class Onboarding extends React.Component { , , , - + , ] break @@ -180,7 +180,7 @@ class Onboarding extends React.Component { clearStartLndError, validateHost, validateCert, - validateMacaroon + validateMacaroon, }} />, , + />, ] break } @@ -216,7 +216,7 @@ class Onboarding extends React.Component { component={ConnectionType} {...{ connectionType, setConnectionType, lndConnect, resetOnboarding, stopLnd }} />, - ...formSteps + ...formSteps, ] return steps } @@ -244,12 +244,12 @@ class Onboarding extends React.Component { } render() { - const { connectionType, onboarded } = this.props + const { connectionType, isOnboarded } = this.props const steps = this.getSteps() const previousStep = this.getPreviousStep() const backButtonText = this.getBackButtonText() - if (onboarded) { + if (isOnboarded) { return } @@ -257,7 +257,7 @@ class Onboarding extends React.Component { - + diff --git a/app/components/Onboarding/Steps/Alias.js b/app/components/Onboarding/Steps/Alias.js index 22834f31311..8083aed7d49 100644 --- a/app/components/Onboarding/Steps/Alias.js +++ b/app/components/Onboarding/Steps/Alias.js @@ -7,17 +7,17 @@ import messages from './messages' class Alias extends React.Component { static propTypes = { + alias: PropTypes.string, intl: intlShape.isRequired, + setAlias: PropTypes.func.isRequired, wizardApi: PropTypes.object, wizardState: PropTypes.object, - alias: PropTypes.string, - setAlias: PropTypes.func.isRequired } static defaultProps = { wizardApi: {}, wizardState: {}, - alias: '' + alias: '', } setFormApi = formApi => { @@ -57,20 +57,20 @@ class Alias extends React.Component { return ( <>
} - subtitle={} align="left" + subtitle={} + title={} /> } initialValue={alias} + label={} + name="alias" validateOnBlur={shouldValidateInline} validateOnChange={shouldValidateInline} + willAutoFocus /> diff --git a/app/components/Onboarding/Steps/Autopilot.js b/app/components/Onboarding/Steps/Autopilot.js index a14992e18f5..12519b01ed2 100644 --- a/app/components/Onboarding/Steps/Autopilot.js +++ b/app/components/Onboarding/Steps/Autopilot.js @@ -6,16 +6,16 @@ import messages from './messages' class Autopilot extends React.Component { static propTypes = { + autopilot: PropTypes.bool, // eslint-disable-line react/boolean-prop-naming + setAutopilot: PropTypes.func.isRequired, wizardApi: PropTypes.object, wizardState: PropTypes.object, - autopilot: PropTypes.bool, - setAutopilot: PropTypes.func.isRequired } static defaultProps = { wizardApi: {}, wizardState: {}, - autopilot: 'enable' + autopilot: 'enable', } handleSubmit = values => { @@ -50,20 +50,20 @@ class Autopilot extends React.Component { onSubmitFailure={onSubmitFailure} >
} - subtitle={} align="left" + subtitle={} + title={} /> - } /> + } value="enable" /> - } /> + } value="disable" /> ) diff --git a/app/components/Onboarding/Steps/ConnectionConfirm.js b/app/components/Onboarding/Steps/ConnectionConfirm.js index 78183e6b133..d3421d90576 100644 --- a/app/components/Onboarding/Steps/ConnectionConfirm.js +++ b/app/components/Onboarding/Steps/ConnectionConfirm.js @@ -9,25 +9,25 @@ import messages from './messages' class ConnectionConfirm extends React.Component { static propTypes = { - wizardApi: PropTypes.object, - wizardState: PropTypes.object, - connectionType: PropTypes.string.isRequired, - connectionHost: PropTypes.string, connectionCert: PropTypes.string, + connectionHost: PropTypes.string, connectionMacaroon: PropTypes.string, connectionString: PropTypes.string, + connectionType: PropTypes.string.isRequired, + isLightningGrpcActive: PropTypes.bool, + isWalletUnlockerGrpcActive: PropTypes.bool, lndConnect: PropTypes.string, - startLndHostError: PropTypes.string, + startLnd: PropTypes.func.isRequired, startLndCertError: PropTypes.string, + startLndHostError: PropTypes.string, startLndMacaroonError: PropTypes.string, - startLnd: PropTypes.func.isRequired, - walletUnlockerGrpcActive: PropTypes.bool, - lightningGrpcActive: PropTypes.bool + wizardApi: PropTypes.object, + wizardState: PropTypes.object, } static defaultProps = { wizardApi: {}, - wizardState: {} + wizardState: {}, } componentDidUpdate(prevProps) { @@ -43,7 +43,7 @@ class ConnectionConfirm extends React.Component { connectionCert, connectionMacaroon, connectionString, - startLnd + startLnd, } = this.props // If we have a hostname, assume we are using the custom form in which host, cer and macaroon paths are supplied. @@ -54,8 +54,8 @@ class ConnectionConfirm extends React.Component { lndconnectUri: encode({ host: connectionHost, cert: connectionCert, - macaroon: connectionMacaroon - }) + macaroon: connectionMacaroon, + }), }) } @@ -64,7 +64,7 @@ class ConnectionConfirm extends React.Component { return startLnd({ type: 'custom', decoder: 'lnd.lndconnect.v1', - lndconnectUri: connectionString + lndconnectUri: connectionString, }) } @@ -75,8 +75,8 @@ class ConnectionConfirm extends React.Component { decoder: 'lnd.lndconnect.v1', lndconnectUri: encode({ host: `${host}:${port}`, - macaroon - }) + macaroon, + }), }) } @@ -90,8 +90,8 @@ class ConnectionConfirm extends React.Component { connectionMacaroon, connectionString, lndConnect, - lightningGrpcActive, - walletUnlockerGrpcActive, + isLightningGrpcActive, + isWalletUnlockerGrpcActive, startLndHostError, startLndCertError, startLndMacaroonError, @@ -134,9 +134,9 @@ class ConnectionConfirm extends React.Component { onSubmitFailure={onSubmitFailure} >
} - subtitle={} align="left" + subtitle={} + title={} /> diff --git a/app/components/Onboarding/Steps/ConnectionDetails.js b/app/components/Onboarding/Steps/ConnectionDetails.js index ff0e852b30b..80c9ad83ba2 100644 --- a/app/components/Onboarding/Steps/ConnectionDetails.js +++ b/app/components/Onboarding/Steps/ConnectionDetails.js @@ -8,29 +8,29 @@ import { FORM_TYPE_CONNECTION_STRING, FORM_TYPE_MANUAL } from './constants' class ConnectionDetails extends React.Component { state = { - formType: null + formType: null, } static propTypes = { - wizardApi: PropTypes.object, - wizardState: PropTypes.object, - connectionHost: PropTypes.string, + clearStartLndError: PropTypes.func.isRequired, connectionCert: PropTypes.string, + connectionHost: PropTypes.string, connectionMacaroon: PropTypes.string, connectionString: PropTypes.string, - startLndHostError: PropTypes.string, - startLndCertError: PropTypes.string, - startLndMacaroonError: PropTypes.string, lndConnect: PropTypes.string, - setLndconnect: PropTypes.func.isRequired, - setConnectionHost: PropTypes.func.isRequired, setConnectionCert: PropTypes.func.isRequired, + setConnectionHost: PropTypes.func.isRequired, setConnectionMacaroon: PropTypes.func.isRequired, setConnectionString: PropTypes.func.isRequired, - clearStartLndError: PropTypes.func.isRequired, - validateHost: PropTypes.func.isRequired, + setLndconnect: PropTypes.func.isRequired, + startLndCertError: PropTypes.string, + startLndHostError: PropTypes.string, + startLndMacaroonError: PropTypes.string, validateCert: PropTypes.func.isRequired, - validateMacaroon: PropTypes.func.isRequired + validateHost: PropTypes.func.isRequired, + validateMacaroon: PropTypes.func.isRequired, + wizardApi: PropTypes.object, + wizardState: PropTypes.object, } componentDidMount() { @@ -49,7 +49,7 @@ class ConnectionDetails extends React.Component { setConnectionHost, setConnectionCert, setConnectionMacaroon, - setConnectionString + setConnectionString, } = this.props const { formType } = this.state if (formType && formType !== prevState.formType && prevState.formType) { @@ -94,7 +94,7 @@ class ConnectionDetails extends React.Component { clearStartLndError, validateHost, validateCert, - validateMacaroon + validateMacaroon, } = this.props const { formType } = this.state @@ -107,42 +107,42 @@ class ConnectionDetails extends React.Component { {formType === FORM_TYPE_CONNECTION_STRING ? ( ) : ( )} diff --git a/app/components/Onboarding/Steps/ConnectionDetailsContext.js b/app/components/Onboarding/Steps/ConnectionDetailsContext.js index 9c7003a8df3..ddd9808139c 100644 --- a/app/components/Onboarding/Steps/ConnectionDetailsContext.js +++ b/app/components/Onboarding/Steps/ConnectionDetailsContext.js @@ -1,7 +1,7 @@ import { createContext } from 'react' const ConnectionDetailsContext = createContext({ - openModal: () => {} + openModal: () => {}, }) export default ConnectionDetailsContext diff --git a/app/components/Onboarding/Steps/ConnectionDetailsManual.js b/app/components/Onboarding/Steps/ConnectionDetailsManual.js index 5c159204bb3..3d157c6d413 100644 --- a/app/components/Onboarding/Steps/ConnectionDetailsManual.js +++ b/app/components/Onboarding/Steps/ConnectionDetailsManual.js @@ -7,30 +7,30 @@ import messages from './messages' class ConnectionDetailsManual extends React.Component { static propTypes = { - wizardApi: PropTypes.object, - wizardState: PropTypes.object, - connectionHost: PropTypes.string, + clearStartLndError: PropTypes.func.isRequired, connectionCert: PropTypes.string, + connectionHost: PropTypes.string, connectionMacaroon: PropTypes.string, connectionString: PropTypes.string, - startLndHostError: PropTypes.string, - startLndCertError: PropTypes.string, - startLndMacaroonError: PropTypes.string, lndConnect: PropTypes.string, - - setLndconnect: PropTypes.func.isRequired, - setConnectionHost: PropTypes.func.isRequired, setConnectionCert: PropTypes.func.isRequired, + setConnectionHost: PropTypes.func.isRequired, setConnectionMacaroon: PropTypes.func.isRequired, - clearStartLndError: PropTypes.func.isRequired, - validateHost: PropTypes.func.isRequired, + setLndconnect: PropTypes.func.isRequired, + + startLndCertError: PropTypes.string, + startLndHostError: PropTypes.string, + startLndMacaroonError: PropTypes.string, validateCert: PropTypes.func.isRequired, - validateMacaroon: PropTypes.func.isRequired + validateHost: PropTypes.func.isRequired, + validateMacaroon: PropTypes.func.isRequired, + wizardApi: PropTypes.object, + wizardState: PropTypes.object, } static defaultProps = { wizardApi: {}, - wizardState: {} + wizardState: {}, } componentDidMount() { @@ -38,7 +38,7 @@ class ConnectionDetailsManual extends React.Component { startLndHostError, startLndCertError, startLndMacaroonError, - clearStartLndError + clearStartLndError, } = this.props // If at least one of the fields has an error, set them all as touched so that they get highlighted. @@ -176,56 +176,56 @@ class ConnectionDetailsManual extends React.Component { return ( <>
} - subtitle={} align="left" + subtitle={} + title={} /> - + } + asyncValidate={this.validateHost} description={} + field="connectionHost" initialValue={connectionHost} + isRequired + label={} + mb={3} + name="connectionHost" onValueChange={this.handleConnectionHostChange} validateOnBlur={shouldValidateInline} validateOnChange={shouldValidateInline} - asyncValidate={this.validateHost} - required + willAutoFocus /> } + asyncValidate={this.validateCert} description={} + field="connectionCert" initialValue={connectionCert} + isRequired + label={} + name="connectionCert" onValueChange={this.handleConnectionCertChange} validateOnBlur={shouldValidateInline} validateOnChange={shouldValidateInline} - asyncValidate={this.validateCert} - required + width={1} /> } + field="connectionMacaroon" initialValue={connectionMacaroon} + isRequired + label="Macaroon" + name="connectionMacaroon" onValueChange={this.handleConnectionMacaroonChange} validateOnBlur={shouldValidateInline} validateOnChange={shouldValidateInline} - asyncValidate={this.validateMacaroon} - required + width={1} /> ) diff --git a/app/components/Onboarding/Steps/ConnectionDetailsString.js b/app/components/Onboarding/Steps/ConnectionDetailsString.js index a9b84aee165..ba1d1c39873 100644 --- a/app/components/Onboarding/Steps/ConnectionDetailsString.js +++ b/app/components/Onboarding/Steps/ConnectionDetailsString.js @@ -8,22 +8,22 @@ import messages from './messages' class ConnectionDetailsString extends React.Component { static propTypes = { - wizardApi: PropTypes.object, - wizardState: PropTypes.object, + clearStartLndError: PropTypes.func.isRequired, connectionString: PropTypes.string, - startLndHostError: PropTypes.string, - startLndCertError: PropTypes.string, - startLndMacaroonError: PropTypes.string, lndConnect: PropTypes.string, - - setLndconnect: PropTypes.func.isRequired, setConnectionString: PropTypes.func.isRequired, - clearStartLndError: PropTypes.func.isRequired + setLndconnect: PropTypes.func.isRequired, + startLndCertError: PropTypes.string, + startLndHostError: PropTypes.string, + + startLndMacaroonError: PropTypes.string, + wizardApi: PropTypes.object, + wizardState: PropTypes.object, } static defaultProps = { wizardApi: {}, - wizardState: {} + wizardState: {}, } componentDidMount() { @@ -33,7 +33,7 @@ class ConnectionDetailsString extends React.Component { startLndMacaroonError, clearStartLndError, setLndconnect, - lndConnect + lndConnect, } = this.props // If we have an lndConnect link, populate the form annd submit immediately. @@ -132,18 +132,16 @@ class ConnectionDetailsString extends React.Component { return ( <>
} - subtitle={} align="left" + subtitle={} + title={} /> - + @@ -155,11 +153,13 @@ class ConnectionDetailsString extends React.Component { } + field="connectionString" initialValue={connectionString} + isRequired + rows="12" validateOnBlur={shouldValidateInline} validateOnChange={shouldValidateInline} - required - rows="12" + willAutoFocus /> ) diff --git a/app/components/Onboarding/Steps/ConnectionDetailsTabs.js b/app/components/Onboarding/Steps/ConnectionDetailsTabs.js index d1404670d6a..5998aed16a6 100644 --- a/app/components/Onboarding/Steps/ConnectionDetailsTabs.js +++ b/app/components/Onboarding/Steps/ConnectionDetailsTabs.js @@ -9,12 +9,12 @@ class ConnectionDetailsTabs extends React.PureComponent { items = [ { key: FORM_TYPE_CONNECTION_STRING, - name: + name: , }, { key: FORM_TYPE_MANUAL, - name: - } + name: , + }, ] render() { @@ -22,7 +22,7 @@ class ConnectionDetailsTabs extends React.PureComponent { {({ formType, openModal }) => { return ( - + ) }} diff --git a/app/components/Onboarding/Steps/ConnectionType.js b/app/components/Onboarding/Steps/ConnectionType.js index e0e0293ef10..ae2d33c0082 100644 --- a/app/components/Onboarding/Steps/ConnectionType.js +++ b/app/components/Onboarding/Steps/ConnectionType.js @@ -7,18 +7,18 @@ import messages from './messages' class ConnectionType extends React.Component { static propTypes = { - wizardApi: PropTypes.object, - wizardState: PropTypes.object, - lndConnect: PropTypes.string, connectionType: PropTypes.string, + lndConnect: PropTypes.string, resetOnboarding: PropTypes.func.isRequired, setConnectionType: PropTypes.func.isRequired, - stopLnd: PropTypes.func.isRequired + stopLnd: PropTypes.func.isRequired, + wizardApi: PropTypes.object, + wizardState: PropTypes.object, } static defaultProps = { wizardApi: {}, - wizardState: {} + wizardState: {}, } componentDidMount() { @@ -65,9 +65,9 @@ class ConnectionType extends React.Component { return (
} - subtitle={} align="left" + subtitle={} + title={} /> @@ -90,29 +90,29 @@ class ConnectionType extends React.Component { onSubmitFailure={onSubmitFailure} > } description={} + label={} mb={5} + value="create" /> } description={} + label={} mb={5} + value="import" /> } description={} + label={} + value="custom" /> diff --git a/app/components/Onboarding/Steps/Login.js b/app/components/Onboarding/Steps/Login.js index 98aa0e5e9f8..2fa6968db57 100644 --- a/app/components/Onboarding/Steps/Login.js +++ b/app/components/Onboarding/Steps/Login.js @@ -8,17 +8,17 @@ import messages from './messages' class Login extends React.Component { static propTypes = { intl: intlShape.isRequired, + setUnlockWalletError: PropTypes.func.isRequired, + unlockWallet: PropTypes.func.isRequired, + unlockWalletError: PropTypes.string, wizardApi: PropTypes.object, wizardState: PropTypes.object, - unlockWalletError: PropTypes.string, - setUnlockWalletError: PropTypes.func.isRequired, - unlockWallet: PropTypes.func.isRequired } static defaultProps = { wizardApi: {}, wizardState: {}, - unlockWalletError: null + unlockWalletError: null, } componentDidUpdate(prevProps) { @@ -79,25 +79,25 @@ class Login extends React.Component { return ( <>
} - subtitle={} align="left" + subtitle={} + title={} /> } field="password" - name="password" + isRequired label={} - description={} - required + name="password" + placeholder={intl.formatMessage({ ...messages.password_placeholder })} validateOnBlur={shouldValidateInline} validateOnChange={shouldValidateInline} - placeholder={intl.formatMessage({ ...messages.password_placeholder })} - autoComplete="current-password" + willAutoFocus /> diff --git a/app/components/Onboarding/Steps/Name.js b/app/components/Onboarding/Steps/Name.js index f5e3243c41a..4eca2b5a6f1 100644 --- a/app/components/Onboarding/Steps/Name.js +++ b/app/components/Onboarding/Steps/Name.js @@ -8,16 +8,16 @@ import messages from './messages' class Name extends React.Component { static propTypes = { intl: intlShape.isRequired, + name: PropTypes.string, + setName: PropTypes.func.isRequired, wizardApi: PropTypes.object, wizardState: PropTypes.object, - name: PropTypes.string, - setName: PropTypes.func.isRequired } static defaultProps = { wizardApi: {}, wizardState: {}, - name: '' + name: '', } setFormApi = formApi => { @@ -57,20 +57,20 @@ class Name extends React.Component { return ( <>
} - subtitle={} align="left" + subtitle={} + title={} /> } initialValue={name} + label={} + name="name" validateOnBlur={shouldValidateInline} validateOnChange={shouldValidateInline} + willAutoFocus /> diff --git a/app/components/Onboarding/Steps/Password.js b/app/components/Onboarding/Steps/Password.js index f643fa3a5ae..1ce0245277d 100644 --- a/app/components/Onboarding/Steps/Password.js +++ b/app/components/Onboarding/Steps/Password.js @@ -8,14 +8,14 @@ import messages from './messages' class Password extends React.Component { static propTypes = { intl: intlShape.isRequired, + setPassword: PropTypes.func.isRequired, wizardApi: PropTypes.object, wizardState: PropTypes.object, - setPassword: PropTypes.func.isRequired } static defaultProps = { wizardApi: {}, - wizardState: {} + wizardState: {}, } handleSubmit = async values => { @@ -55,24 +55,24 @@ class Password extends React.Component { return ( <>
} - subtitle={} align="left" + subtitle={} + title={} /> } - required + name="password" + placeholder={intl.formatMessage({ ...messages.password_placeholder })} validateOnBlur={shouldValidateInline} validateOnChange={shouldValidateInline} - placeholder={intl.formatMessage({ ...messages.password_placeholder })} - autoComplete="current-password" + willAutoFocus /> diff --git a/app/components/Onboarding/Steps/Recover.js b/app/components/Onboarding/Steps/Recover.js index 00c42ee93d8..cbbd8b8b528 100644 --- a/app/components/Onboarding/Steps/Recover.js +++ b/app/components/Onboarding/Steps/Recover.js @@ -12,7 +12,7 @@ class SeedWord extends React.Component { static propTypes = { index: PropTypes.number.isRequired, intl: intlShape.isRequired, - word: PropTypes.string + word: PropTypes.string, } validateWord = value => { @@ -22,19 +22,19 @@ class SeedWord extends React.Component { render() { const { index, intl, word } = this.props return ( - -
- + {styles => ( {currentStep === 'summary' && !hasEnoughFunds && ( - + )} {walletBalance !== null && ( - + : - + {` `} {cryptoCurrencyTicker} (onchain), - + {` `} {cryptoCurrencyTicker} (in channels) diff --git a/app/components/Pay/PayButtons.js b/app/components/Pay/PayButtons.js index f1cf357a19b..6aafc5325cb 100644 --- a/app/components/Pay/PayButtons.js +++ b/app/components/Pay/PayButtons.js @@ -11,43 +11,43 @@ import messages from './messages' */ class PayButtons extends React.PureComponent { static propTypes = { - disabled: PropTypes.bool, + hasBackButton: PropTypes.bool, + hasSubmitButton: PropTypes.bool, + isDisabled: PropTypes.bool, + isProcessing: PropTypes.bool, nextButtonText: PropTypes.node, previousStep: PropTypes.func, - processing: PropTypes.bool, - showBack: PropTypes.bool, - showSubmit: PropTypes.bool } static defaultProps = { - disabled: false, + isDisabled: false, nextButtonText: , previousStep: () => ({}), - processing: false, - showBack: true, - showSubmit: true + isProcessing: false, + hasBackButton: true, + hasSubmitButton: true, } render() { const { - disabled, + isDisabled, nextButtonText, previousStep, - processing, - showBack, - showSubmit, + isProcessing, + hasBackButton, + hasSubmitButton, ...rest } = this.props return ( - + - {showBack && ( + {hasBackButton && ( )} - {showSubmit && ( -
  } - return
+ return
} } diff --git a/app/components/Pay/PaySummaryLightning.js b/app/components/Pay/PaySummaryLightning.js index ac5d08902ec..45b888a7b7f 100644 --- a/app/components/Pay/PaySummaryLightning.js +++ b/app/components/Pay/PaySummaryLightning.js @@ -25,14 +25,14 @@ class PaySummaryLightning extends React.Component { /** List of nodes as returned by lnd */ nodes: PropTypes.array, /** Lightning Payment request */ - payReq: PropTypes.string.isRequired + payReq: PropTypes.string.isRequired, } static defaultProps = { isQueryingRoutes: false, minFee: null, maxFee: null, - nodes: [] + nodes: [], } render() { @@ -82,9 +82,9 @@ class PaySummaryLightning extends React.Component { - + - + @@ -96,13 +96,13 @@ class PaySummaryLightning extends React.Component { - - + + - - {} + + {} @@ -114,7 +114,7 @@ class PaySummaryLightning extends React.Component { left={} right={ isQueryingRoutes ? ( - + … diff --git a/app/components/Pay/PaySummaryOnChain.js b/app/components/Pay/PaySummaryOnChain.js index ec80fe34b85..524aa64b84f 100644 --- a/app/components/Pay/PaySummaryOnChain.js +++ b/app/components/Pay/PaySummaryOnChain.js @@ -12,27 +12,27 @@ import messages from './messages' class PaySummaryOnChain extends React.Component { static propTypes = { /** Amount to send (in satoshis). */ - amount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired, - /** Onchain address of recipient. */ address: PropTypes.string.isRequired, + /** Onchain address of recipient. */ + amount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired, /** Ticker symbol of the currently selected cryptocurrency. */ cryptoCurrencyTicker: PropTypes.string.isRequired, /** Current fee information as provided by bitcoinfees.earn.com */ + isQueryingFees: PropTypes.bool, + /** Boolean indicating wether routing information is currently being fetched. */ onchainFees: PropTypes.shape({ fastestFee: PropTypes.number, halfHourFee: PropTypes.number, - hourFee: PropTypes.number + hourFee: PropTypes.number, }), - /** Boolean indicating wether routing information is currently being fetched. */ - isQueryingFees: PropTypes.bool, /** Method to fetch fee information for onchain transactions. */ - queryFees: PropTypes.func.isRequired + queryFees: PropTypes.func.isRequired, } static defaultProps = { isQueryingFees: false, - onchainFees: {} + onchainFees: {}, } componentDidMount() { @@ -56,9 +56,9 @@ class PaySummaryOnChain extends React.Component { - + - + @@ -70,12 +70,12 @@ class PaySummaryOnChain extends React.Component { - - + + - + @@ -88,16 +88,14 @@ class PaySummaryOnChain extends React.Component { left={} right={ isQueryingFees ? ( - + - ) : !fee ? ( - - ) : ( + ) : fee ? ( {fee} satoshis @@ -106,6 +104,8 @@ class PaySummaryOnChain extends React.Component { () + ) : ( + ) } /> diff --git a/app/components/Pay/messages.js b/app/components/Pay/messages.js index cc84254b798..89bab0b509a 100644 --- a/app/components/Pay/messages.js +++ b/app/components/Pay/messages.js @@ -25,5 +25,5 @@ export default defineMessages({ total: 'Total', memo: 'Memo', description: - 'You can send {chain} ({ticker}) through the Lightning Network or make a On-Chain Transaction. Just paste your Lightning Payment Request or the {chain} Address in the field below. Zap will guide you to the process.' + 'You can send {chain} ({ticker}) through the Lightning Network or make a On-Chain Transaction. Just paste your Lightning Payment Request or the {chain} Address in the field below. Zap will guide you to the process.', }) diff --git a/app/components/Request/Request.js b/app/components/Request/Request.js index fb2f6ebc378..b2bfe3456d2 100644 --- a/app/components/Request/Request.js +++ b/app/components/Request/Request.js @@ -13,32 +13,32 @@ import messages from './messages' */ class Request extends React.Component { state = { - currentStep: 'form' + currentStep: 'form', } static propTypes = { /** Currently selected cryptocurrency (key). */ - cryptoCurrency: PropTypes.string.isRequired, + createInvoice: PropTypes.func.isRequired, /** Human readable chain name */ - cryptoName: PropTypes.string.isRequired, + cryptoCurrency: PropTypes.string.isRequired, /** Ticker symbol of the currently selected cryptocurrency. */ cryptoCurrencyTicker: PropTypes.string.isRequired, /** Boolean indicating wether the form is being processed. If true, form buttons are disabled. */ - isProcessing: PropTypes.bool, + cryptoName: PropTypes.string.isRequired, /** Lnd invoice object for the payment request */ - invoice: PropTypes.object, + intl: intlShape.isRequired, /** Lightning Payment request. */ - payReq: PropTypes.string, + invoice: PropTypes.object, /** Show a notification */ - showNotification: PropTypes.func.isRequired, + isProcessing: PropTypes.bool, /** Create an invoice using the supplied details */ - createInvoice: PropTypes.func.isRequired, - intl: intlShape.isRequired + payReq: PropTypes.string, + showNotification: PropTypes.func.isRequired, } static defaultProps = { isProcessing: false, - payReq: null + payReq: null, } amountInput = React.createRef() @@ -125,7 +125,12 @@ class Request extends React.Component { renderAmountFields = () => { return ( - + ) } @@ -133,16 +138,16 @@ class Request extends React.Component { const { intl } = this.props return (