diff --git a/components/Text.tsx b/components/Text.tsx index 53168b310..ae6283a89 100644 --- a/components/Text.tsx +++ b/components/Text.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import { Text, TextStyle, TouchableOpacity } from 'react-native'; import { inject, observer } from 'mobx-react'; -import { Row } from './layout/Row'; import { themeColor } from './../utils/ThemeUtils'; @@ -34,16 +33,14 @@ export default class ZeusText extends React.Component { const { toggleInfoModal } = ModalStore!; const CoreText = () => ( - - - {children} - + + {children} {infoModalText && ( { {' ⓘ'} )} - + ); if (infoModalText) { diff --git a/views/Receive.tsx b/views/Receive.tsx index f315a5a69..8d7869dc9 100644 --- a/views/Receive.tsx +++ b/views/Receive.tsx @@ -2019,59 +2019,73 @@ export default class Receive extends React.Component< <> {BackendUtils.supportsLSPs() && !lspNotConfigured && ( - <> - + + - navigation.navigate( - 'LspExplanationOverview' - ) - } - ]} - > - {localeString( - 'views.Settings.LSP.enableLSP' - )} - - { - this.setState({ - enableLSP: - !enableLSP, - lspIsActive: - !enableLSP && - BackendUtils.supportsLSPs() && - !lspNotConfigured - }); - await updateSettings( + localeString( + 'views.Receive.lspSwitchExplainer2' + ) + ]} + infoModalAdditionalButtons={[ { - enableLSP: - !enableLSP + title: localeString( + 'general.learnMore' + ), + callback: + () => + navigation.navigate( + 'LspExplanationOverview' + ) } - ); + ]} + > + {localeString( + 'views.Settings.LSP.enableLSP' + )} + + + - + > + { + this.setState({ + enableLSP: + !enableLSP, + lspIsActive: + !enableLSP && + BackendUtils.supportsLSPs() && + !lspNotConfigured + }); + await updateSettings( + { + enableLSP: + !enableLSP + } + ); + }} + /> + + )} {(!enableLSP || lspNotConfigured) && ( @@ -2533,39 +2547,54 @@ export default class Receive extends React.Component< {BackendUtils.isLNDBased() && !lspIsActive && ( - <> - + + + {localeString( + 'views.Receive.routeHints' + )} + + + - {localeString( - 'views.Receive.routeHints' - )} - - - this.setState({ - routeHints: - !routeHints - }) - } - disabled={blindedPaths} - /> - + + this.setState({ + routeHints: + !routeHints + }) + } + disabled={ + blindedPaths + } + /> + + )} {BackendUtils.isLNDBased() && @@ -2667,81 +2696,109 @@ export default class Receive extends React.Component< {BackendUtils.supportsAMP() && !lspIsActive && ( - <> - + + + {localeString( + 'views.Receive.ampInvoice' + )} + + + - {localeString( - 'views.Receive.ampInvoice' - )} - - - this.setState({ - ampInvoice: - !ampInvoice - }) - } - disabled={blindedPaths} - /> - + + this.setState({ + ampInvoice: + !ampInvoice + }) + } + disabled={ + blindedPaths + } + /> + + )} {BackendUtils.supportsBolt11BlindedRoutes() && !lspIsActive && ( - <> - + + + {localeString( + 'views.Receive.blindedPaths' + )} + + + - {localeString( - 'views.Receive.blindedPaths' - )} - - - this.setState({ - blindedPaths: - !blindedPaths, - ampInvoice: - false, - routeHints: - false - }) - } - /> - + + this.setState({ + blindedPaths: + !blindedPaths, + ampInvoice: + false, + routeHints: + false + }) + } + /> + + )} diff --git a/views/Settings/InvoicesSettings.tsx b/views/Settings/InvoicesSettings.tsx index ebec8a856..3efe2e2fa 100644 --- a/views/Settings/InvoicesSettings.tsx +++ b/views/Settings/InvoicesSettings.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { StyleSheet, TouchableOpacity, View } from 'react-native'; +import { StyleSheet, TouchableOpacity, ScrollView, View } from 'react-native'; import { inject, observer } from 'mobx-react'; import BigNumber from 'bignumber.js'; import _map from 'lodash/map'; @@ -173,9 +173,10 @@ export default class InvoicesSettings extends React.Component< } navigation={navigation} /> - - + + + {localeString('views.Receive.routeHints')} + + + - {localeString('views.Receive.routeHints')} - - { - this.setState({ - routeHints: !routeHints - }); - await updateSettings({ - invoices: { - addressType, - memo, - expiry, - timePeriod, - expirySeconds, - routeHints: !routeHints, - ampInvoice, - blindedPaths, - showCustomPreimageField - } - }); - }} - disabled={blindedPaths} - /> - + { + this.setState({ + routeHints: !routeHints + }); + await updateSettings({ + invoices: { + addressType, + memo, + expiry, + timePeriod, + expirySeconds, + routeHints: !routeHints, + ampInvoice, + blindedPaths, + showCustomPreimageField + } + }); + }} + disabled={blindedPaths} + /> + + )} {BackendUtils.supportsAMP() && ( - <> - + + + {localeString('views.Receive.ampInvoice')} + + + - {localeString('views.Receive.ampInvoice')} - - { - this.setState({ - ampInvoice: !ampInvoice - }); - await updateSettings({ - invoices: { - addressType, - memo, - expiry, - timePeriod, - expirySeconds, - routeHints, - ampInvoice: !ampInvoice, - showCustomPreimageField - } - }); - }} - disabled={blindedPaths} - /> - + { + this.setState({ + ampInvoice: !ampInvoice + }); + await updateSettings({ + invoices: { + addressType, + memo, + expiry, + timePeriod, + expirySeconds, + routeHints, + ampInvoice: !ampInvoice, + showCustomPreimageField + } + }); + }} + disabled={blindedPaths} + /> + + )} {BackendUtils.supportsBolt11BlindedRoutes() && ( - <> - + + + {localeString('views.Receive.blindedPaths')} + + + - {localeString('views.Receive.blindedPaths')} - - { - this.setState({ - blindedPaths: !blindedPaths, - ampInvoice: false, - routeHints: false - }); - - await updateSettings({ - invoices: { - addressType, - memo, - expiry, - timePeriod, - expirySeconds, - routeHints: false, - ampInvoice: false, + { + this.setState({ blindedPaths: !blindedPaths, - showCustomPreimageField - } - }); - }} - /> - + ampInvoice: false, + routeHints: false + }); + + await updateSettings({ + invoices: { + addressType, + memo, + expiry, + timePeriod, + expirySeconds, + routeHints: false, + ampInvoice: false, + blindedPaths: !blindedPaths, + showCustomPreimageField + } + }); + }} + /> + + )} {BackendUtils.supportsCustomPreimages() && ( - <> + + + + {localeString( + 'views.Settings.Invoices.showCustomPreimageField' + )} + {} + + + + { + this.setState({ + showCustomPreimageField: + !showCustomPreimageField + }); + await updateSettings({ + invoices: { + addressType, + memo, + expiry, + timePeriod, + expirySeconds, + routeHints, + ampInvoice, + showCustomPreimageField: + !showCustomPreimageField + } + }); + }} + /> + + + )} + + + {localeString( - 'views.Settings.Invoices.showCustomPreimageField' + 'views.Settings.Invoices.displayAmountOnInvoice' )} {} + + { this.setState({ - showCustomPreimageField: - !showCustomPreimageField + displayAmountOnInvoice: + !displayAmountOnInvoice }); await updateSettings({ invoices: { @@ -503,53 +589,16 @@ export default class InvoicesSettings extends React.Component< expirySeconds, routeHints, ampInvoice, - showCustomPreimageField: - !showCustomPreimageField + showCustomPreimageField, + displayAmountOnInvoice: + !displayAmountOnInvoice } }); }} /> - - )} - - <> - - {localeString( - 'views.Settings.Invoices.displayAmountOnInvoice' - )} - {} - - { - this.setState({ - displayAmountOnInvoice: - !displayAmountOnInvoice - }); - await updateSettings({ - invoices: { - addressType, - memo, - expiry, - timePeriod, - expirySeconds, - routeHints, - ampInvoice, - showCustomPreimageField, - displayAmountOnInvoice: - !displayAmountOnInvoice - } - }); - }} - /> - - + + + - + {error_msg && ( )} - - - {localeString( - 'views.Settings.LightningAddressSettings.automaticallyAccept' - )} - + + + + {localeString( + 'views.Settings.LightningAddressSettings.automaticallyAccept' + )} + + - - + + - - + + {localeString('views.Receive.routeHints')} - - { - this.setState({ - routeHints: !routeHints - }); - await updateSettings({ - lightningAddress: { - enabled, - automaticallyAccept, - automaticallyAcceptAttestationLevel, - automaticallyRequestOlympusChannels: - false, // deprecated - routeHints: !routeHints, - allowComments, - nostrPrivateKey, - nostrRelays, - notifications - } - }); - }} - /> - - - - - + - {localeString( - 'views.Settings.LightningAddressSettings.allowComments' - )} - + { + this.setState({ + routeHints: !routeHints + }); + await updateSettings({ + lightningAddress: { + enabled, + automaticallyAccept, + automaticallyAcceptAttestationLevel, + automaticallyRequestOlympusChannels: + false, // deprecated + routeHints: !routeHints, + allowComments, + nostrPrivateKey, + nostrRelays, + notifications + } + }); + }} + /> + + + + + + {localeString( + 'views.Settings.LightningAddressSettings.allowComments' + )} + + - - + + navigation.navigate('NostrKeys')} > @@ -357,14 +359,16 @@ export default class LightningAddressSettings extends React.Component< navigation.navigate('NostrRelays')} > @@ -380,14 +384,16 @@ export default class LightningAddressSettings extends React.Component< navigation.navigate('ChangeAddress')} > @@ -407,10 +413,3 @@ export default class LightningAddressSettings extends React.Component< ); } } - -const styles = StyleSheet.create({ - listItem: { - borderBottomWidth: 0, - backgroundColor: 'transparent' - } -}); diff --git a/views/Settings/PaymentsSettings.tsx b/views/Settings/PaymentsSettings.tsx index 5185a57d0..39ff8ce03 100644 --- a/views/Settings/PaymentsSettings.tsx +++ b/views/Settings/PaymentsSettings.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { Text, View } from 'react-native'; -import { ListItem } from 'react-native-elements'; import { inject, observer } from 'mobx-react'; import { StackNavigationProp } from '@react-navigation/stack'; @@ -105,8 +104,8 @@ export default class PaymentsSettings extends React.Component< /> {BackendUtils.isLNDBased() && ( @@ -114,7 +113,6 @@ export default class PaymentsSettings extends React.Component< @@ -162,7 +160,7 @@ export default class PaymentsSettings extends React.Component< paddingTop: 5, color: themeColor('text'), top: 28, - right: 30 + right: 35 }} > {localeString('general.sats')} @@ -220,7 +218,6 @@ export default class PaymentsSettings extends React.Component< @@ -345,30 +342,24 @@ export default class PaymentsSettings extends React.Component< /> )} - - {localeString( 'views.Settings.Privacy.enableMempoolRates' )} - - + + { @@ -394,29 +385,31 @@ export default class PaymentsSettings extends React.Component< }} /> - - { - this.setState({ - preferredMempoolRate: value - }); - await updateSettings({ - payments: { - defaultFeeMethod: feeLimitMethod, - defaultFeePercentage: feePercentage, - defaultFeeFixed: feeLimit, - timeoutSeconds, + + + { + this.setState({ preferredMempoolRate: value - } - }); - }} - values={MEMPOOL_RATES_KEYS} - disabled={!enableMempoolRates} - /> + }); + await updateSettings({ + payments: { + defaultFeeMethod: feeLimitMethod, + defaultFeePercentage: feePercentage, + defaultFeeFixed: feeLimit, + timeoutSeconds, + preferredMempoolRate: value + } + }); + }} + values={MEMPOOL_RATES_KEYS} + disabled={!enableMempoolRates} + /> + ); diff --git a/views/Settings/Privacy.tsx b/views/Settings/Privacy.tsx index 416086792..df9ded47e 100644 --- a/views/Settings/Privacy.tsx +++ b/views/Settings/Privacy.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { ScrollView, View } from 'react-native'; -import { ListItem } from 'react-native-elements'; import { inject, observer } from 'mobx-react'; import { StackNavigationProp } from '@react-navigation/stack'; @@ -102,7 +101,7 @@ export default class Privacy extends React.Component< navigation={navigation} /> )} - - - {localeString('views.Settings.Privacy.clipboard')} - - + + + {localeString( + 'views.Settings.Privacy.clipboard' + )} + + + { @@ -204,38 +200,35 @@ export default class Privacy extends React.Component< }} /> - - + - - {localeString('views.Settings.Privacy.lurkerMode')} - - + + + {localeString( + 'views.Settings.Privacy.lurkerMode' + )} + + + { @@ -254,31 +247,27 @@ export default class Privacy extends React.Component< }} /> - - + - - {localeString( - 'views.Settings.Privacy.enableMempoolRates' - )} - - + + + {localeString( + 'views.Settings.Privacy.enableMempoolRates' + )} + + + { @@ -298,7 +287,7 @@ export default class Privacy extends React.Component< }} /> - + );