Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
feat(ui): show tooltip when fee limit is unknown
Browse files Browse the repository at this point in the history
fix #2676
  • Loading branch information
mrfelton committed May 24, 2020
1 parent 0e30609 commit 8410149
Show file tree
Hide file tree
Showing 37 changed files with 60 additions and 14 deletions.
18 changes: 13 additions & 5 deletions renderer/components/Pay/PaySummaryLightning.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CoinBig } from '@zap/utils/coin'
import { convert } from '@zap/utils/btc'
import { decodePayReq, getNodeAlias, getTag } from '@zap/utils/crypto'
import BigArrowRight from 'components/Icon/BigArrowRight'
import { Bar, DataRow, Spinner, Text } from 'components/UI'
import { Bar, DataRow, Spinner, Text, Tooltip } from 'components/UI'
import { CryptoSelector, CryptoValue, FiatValue } from 'containers/UI'
import { Truncate } from 'components/Util'
import messages from './messages'
Expand Down Expand Up @@ -55,9 +55,7 @@ class PaySummaryLightning extends React.Component {
}

// Select an appropriate fee message...
// Default to configured limit.
let feeMessage = messages.fee_config_limit

let feeMessage
if (hasMinFee || hasMaxFee) {
// If thex max fee is 0 or 1 then show a message like "less than 1".
if (hasMaxFee && maxFee >= 0 && maxFee < 1) {
Expand All @@ -82,7 +80,17 @@ class PaySummaryLightning extends React.Component {
)
}

return null
return (
<Flex alignItems="center">
<Tooltip mr={1}>
<FormattedMessage {...messages.no_route_tooltip} />
</Tooltip>
<FormattedMessage
{...messages.fee_config_limit}
values={{ maxFee: config.payments.feeLimit }}
/>
</Flex>
)
}

render() {
Expand Down
4 changes: 3 additions & 1 deletion renderer/components/Pay/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export default defineMessages({
request_label_onchain: 'Address',
request_label_pubkey: 'Node Pubkey',
searching_routes: 'searching for routes…',
no_route_tooltip:
'Unable to find payment route. You can try sending the payment anyway and fees will be capped at your configured payment fee limit, which you can edit in your preferences.',
subtitle_onchain: 'On-Chain Payment',
subtitle_offchain: 'Lightning Payment',
next_block_confirmation: 'next block confirmation',
Expand All @@ -23,7 +25,7 @@ export default defineMessages({
fee_upto: 'up to {maxFee} satoshi',
fee_unknown: 'unknown',
fee_per_byte: 'per byte',
fee_config_limit: 'unknown (no more than {maxFee} satoshi)',
fee_config_limit: 'unknown (up to {maxFee} satoshi)',
fee_subtraction: 'Deducted from total',
fee_addition: 'Added to total',
amount: 'Amount',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@ exports[`component.Form.PaySummaryLightning should render correctly 1`] = `
<Styled(styled.div)
alignItems="baseline"
>
<Memo(Connect(Dropdown))
mr={2}
/>
<CryptoValue
value="10000"
/>
<React.Fragment>
<Memo(Connect(Dropdown))
mr={2}
/>
<CryptoValue
value="10000"
/>
</React.Fragment>
</Styled(styled.div)>
}
/>
Expand Down
1 change: 1 addition & 0 deletions translations/af-ZA.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/ar-SA.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/bg-BG.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "Бележка",
"components.Pay.next": "Напред",
"components.Pay.next_block_confirmation": "следващ блок за потвърждение",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "{amount} {cryptoUnitName} (on-chain)",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "Заявка за плащане",
Expand Down
1 change: 1 addition & 0 deletions translations/ca-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/cs-CZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "Poznámka",
"components.Pay.next": "Další",
"components.Pay.next_block_confirmation": "další potvrzení bloku",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "{amount} {cryptoUnitName} (on-chain)",
"components.Pay.request_label_combined": "Žádost o platbu nebo adresa",
"components.Pay.request_label_offchain": "Žádost o platbu",
Expand Down
1 change: 1 addition & 0 deletions translations/da-DK.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "Notat",
"components.Pay.next": "Næste",
"components.Pay.next_block_confirmation": "næste blok bekæftelse",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "Betalings Anmodning eller Adresse",
"components.Pay.request_label_offchain": "Betalings Anmodning",
Expand Down
1 change: 1 addition & 0 deletions translations/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "Memo",
"components.Pay.next": "Weiter",
"components.Pay.next_block_confirmation": "nächste Blockbestätigung",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "{amount} {cryptoUnitName} (Onchain)",
"components.Pay.request_label_combined": "Zahlungsanforderung oder Adresse",
"components.Pay.request_label_offchain": "Zahlungsanfrage",
Expand Down
1 change: 1 addition & 0 deletions translations/el-GR.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "Τιμολόγιο",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
3 changes: 2 additions & 1 deletion translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
"components.Pay.error_not_onetime_send_capacity": "You are trying to send more than your current one time send capacity of {capacity} {unit}",
"components.Pay.fee": "Fee",
"components.Pay.fee_addition": "Added to total",
"components.Pay.fee_config_limit": "unknown (no more than {maxFee} satoshi)",
"components.Pay.fee_config_limit": "unknown (up to {maxFee} satoshi)",
"components.Pay.fee_less_than_1": "less than 1 satoshi",
"components.Pay.fee_per_byte": "per byte",
"components.Pay.fee_range": "between {minFee} and {maxFee} satoshis",
Expand All @@ -453,6 +453,7 @@
"components.Pay.memo": "Memo",
"components.Pay.next": "Next",
"components.Pay.next_block_confirmation": "next block confirmation",
"components.Pay.no_route_tooltip": "Unable to find payment route. You can try sending the payment anyway and fees will be capped at your configured payment fee limit, which you can edit in your preferences.",
"components.Pay.onchain_balance": "{amount} {cryptoUnitName} (onchain)",
"components.Pay.request_label_combined": "Payment Request, Address, or Node Pubkey",
"components.Pay.request_label_offchain": "Payment Request",
Expand Down
1 change: 1 addition & 0 deletions translations/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "Memorándum",
"components.Pay.next": "Siguiente",
"components.Pay.next_block_confirmation": "próxima confirmación de bloque",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "{amount} {cryptoUnitName} (onchain)",
"components.Pay.request_label_combined": "Solicitud de Pago o Dirección",
"components.Pay.request_label_offchain": "Solicitud de Pago",
Expand Down
1 change: 1 addition & 0 deletions translations/fi-FI.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "Note",
"components.Pay.next": "Continuer",
"components.Pay.next_block_confirmation": "confirmation au prochain bloc",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "{amount} {cryptoUnitName} (On-chain)",
"components.Pay.request_label_combined": "Demande de paiement ou adresse",
"components.Pay.request_label_offchain": "Demande de paiement",
Expand Down
1 change: 1 addition & 0 deletions translations/ga-IE.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "Meabhrán",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/he-IL.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "תזכיר",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/hi-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/hr-HR.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "Bilješka",
"components.Pay.next": "Slijedeće",
"components.Pay.next_block_confirmation": "potvrda u slijedećem bloku",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "Zahtjev za plaćanjem ili adresa",
"components.Pay.request_label_offchain": "Zahtjev za plaćanjem",
Expand Down
1 change: 1 addition & 0 deletions translations/hu-HU.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "メモ",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/nl-NL.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/no-NO.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "Beskjed",
"components.Pay.next": "Neste",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "Betalingsforespørsel",
Expand Down
1 change: 1 addition & 0 deletions translations/pl-PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "Notatka",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/ro-RO.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "Notificare",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "Памятка",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "Запрос платежа",
Expand Down
1 change: 1 addition & 0 deletions translations/sr-SP.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/sv-SE.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/tr-TR.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "Açıklama",
"components.Pay.next": "Sonraki",
"components.Pay.next_block_confirmation": "sıradaki blok onayında",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "{amount} {cryptoUnitName} (Ana-Ağ'da)",
"components.Pay.request_label_combined": "Ödeme Talebi, Adres veya Nod Anahtarı",
"components.Pay.request_label_offchain": "Ödeme Talebi",
Expand Down
3 changes: 2 additions & 1 deletion translations/uk-UA.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "Пам'ятка",
"components.Pay.next": "Далі",
"components.Pay.next_block_confirmation": "наступне підтвердження блоку",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "{amount} {cryptoUnitName} (в каналі)",
"components.Pay.request_label_combined": "Запит на оплату, адреса або вузол відкритого ключа",
"components.Pay.request_label_offchain": "Запит оплати",
Expand Down Expand Up @@ -664,7 +665,7 @@
"reducers.activity.activity_invoice_download_success": "Звантаження завершено",
"reducers.channels.channels_open_warning": "Ініційовано відкриття каналу",
"reducers.invoice.invoice_keysend_receive_body": "Вітання, хтось щойно вам заплатив",
"reducers.invoice.invoice_receive_body":"Вітаю, хтось щойно оплатив ваш рахунок",
"reducers.invoice.invoice_receive_body": "Вітаю, хтось щойно оплатив ваш рахунок",
"reducers.invoice.invoice_receive_title": "Ви були Zap-нуті",
"reducers.messages.address_new_address_error": "Не вдалося отримати {addressType} адресу: {error}",
"reducers.messages.app_init_db_error": "Не вдається ініціалізувати базу даних: {error}",
Expand Down
1 change: 1 addition & 0 deletions translations/vi-VN.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "备注",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down
1 change: 1 addition & 0 deletions translations/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"components.Pay.memo": "备注",
"components.Pay.next": "",
"components.Pay.next_block_confirmation": "",
"components.Pay.no_route_tooltip": "",
"components.Pay.onchain_balance": "",
"components.Pay.request_label_combined": "",
"components.Pay.request_label_offchain": "",
Expand Down

0 comments on commit 8410149

Please sign in to comment.