From 9a845bd7db779a9cc0e33e7e814f7483d0177af4 Mon Sep 17 00:00:00 2001 From: flaviomoceri Date: Wed, 24 Jan 2024 12:29:06 +0100 Subject: [PATCH] feat(receive): added onboarding ln text --- src/assets/icons/wallet.ts | 6 ++++++ src/screens/Wallets/Receive/ReceiveAmount.tsx | 2 +- src/screens/Wallets/Receive/ReceiveQR.tsx | 21 +++++++++++++++++-- src/styles/icons.ts | 14 +++++++++++++ src/utils/i18n/locales/en/wallet.json | 1 + src/utils/i18n/locales/it/onboarding.json | 2 +- src/utils/i18n/locales/it/settings.json | 2 +- src/utils/i18n/locales/it/wallet.json | 5 +++-- 8 files changed, 46 insertions(+), 7 deletions(-) diff --git a/src/assets/icons/wallet.ts b/src/assets/icons/wallet.ts index e817d5f9b..8dbf94d8e 100644 --- a/src/assets/icons/wallet.ts +++ b/src/assets/icons/wallet.ts @@ -401,3 +401,9 @@ export const mapPinLineIcon = (color = 'white'): string => `; + +export const arrowLNfunds = (color = 'white'): string => + ` + + +`; diff --git a/src/screens/Wallets/Receive/ReceiveAmount.tsx b/src/screens/Wallets/Receive/ReceiveAmount.tsx index cb775503a..3d2f0a767 100644 --- a/src/screens/Wallets/Receive/ReceiveAmount.tsx +++ b/src/screens/Wallets/Receive/ReceiveAmount.tsx @@ -25,7 +25,7 @@ import type { ReceiveScreenProps } from '../../../navigation/types'; // hardcoded to be above fee (1092) // TODO: fee is dynamic so this should be fetched from the API -const MINIMUM_AMOUNT = 20500; +const MINIMUM_AMOUNT = 20000; const ReceiveAmount = ({ navigation, diff --git a/src/screens/Wallets/Receive/ReceiveQR.tsx b/src/screens/Wallets/Receive/ReceiveQR.tsx index b2c627a7f..0f191990e 100644 --- a/src/screens/Wallets/Receive/ReceiveQR.tsx +++ b/src/screens/Wallets/Receive/ReceiveQR.tsx @@ -18,7 +18,7 @@ import { FadeIn, useSharedValue } from 'react-native-reanimated'; import Clipboard from '@react-native-clipboard/clipboard'; import Share from 'react-native-share'; import Carousel, { ICarouselInstance } from 'react-native-reanimated-carousel'; -import { useTranslation } from 'react-i18next'; +import { Trans, useTranslation } from 'react-i18next'; import { View as ThemedView, @@ -26,6 +26,7 @@ import { AnimatedView, } from '../../../styles/components'; import { + ArrowLNFunds, BitcoinCircleIcon, BitcoinSlantedIcon, CopyIcon, @@ -35,7 +36,7 @@ import { ShareIcon, UnifiedIcon, } from '../../../styles/icons'; -import { Caption13Up, Text01S, Text02S } from '../../../styles/text'; +import { Caption13Up, Text01S, Text02S, Title } from '../../../styles/text'; import { createLightningInvoice } from '../../../store/utils/lightning'; import { updatePendingInvoice } from '../../../store/slices/metadata'; import { generateNewReceiveAddress } from '../../../store/actions/wallet'; @@ -607,11 +608,23 @@ const ReceiveQR = ({ {displayReceiveInstantlySwitch && ( + {!enableInstant && ( + + <Trans + t={t} + i18nKey="receive_text_lnfunds" + components={{ + purpleText: <Title color="purple" />, + }} + /> + + )} + {!enableInstant && } {t('receive_instantly')} @@ -710,6 +723,10 @@ const styles = StyleSheet.create({ paddingHorizontal: 16, marginTop: 'auto', }, + textLNfunds: { + marginBottom: 10, + width: '60%', + }, }); export default memo(ReceiveQR); diff --git a/src/styles/icons.ts b/src/styles/icons.ts index 066cfcfd6..f435d05c6 100644 --- a/src/styles/icons.ts +++ b/src/styles/icons.ts @@ -73,6 +73,7 @@ import { lightningCircleIcon, mapTrifoldIcon, mapPinLineIcon, + arrowLNfunds, } from '../assets/icons/wallet'; import { chevronRightIcon, @@ -522,6 +523,19 @@ export const UpArrow = styled(SvgXml).attrs((props) => ({ color: props.color ? props.theme.colors[props.color] : 'white', })); +export const ArrowLNFunds = styled(SvgXml).attrs((props) => ({ + xml: arrowLNfunds( + props.color ? props.theme.colors[props.color] : props.theme.colors.white, + ), + height: props.height ?? '52px', + width: props.width ?? '97px', + position: 'absolute', + right: 15, + bottom: 0, +}))((props) => ({ + color: props.color ? props.theme.colors[props.color] : 'white', +})); + export const DownArrow = styled(SvgXml).attrs((props) => ({ xml: downArrowIcon( props.color ? props.theme.colors[props.color] : props.theme.colors.white, diff --git a/src/utils/i18n/locales/en/wallet.json b/src/utils/i18n/locales/en/wallet.json index a611d1868..2a4170a39 100644 --- a/src/utils/i18n/locales/en/wallet.json +++ b/src/utils/i18n/locales/en/wallet.json @@ -88,6 +88,7 @@ "receive_lightning_invoice": "Lightning invoice", "receive_note_placeholder": "Optional note to payer", "receive_show_qr": "Show QR Code", + "receive_text_lnfunds": "Want to receive Lightning funds?", "receive_instantly": "Receive Instantly", "receive_connect_initial": "To receive instant Bitcoin, Bitkit first has to connect you to Lightning. A {lspFee} service provider fee will be deducted from the amount you specified.", "receive_connect_additional": "To receive more instant Bitcoin, Bitkit has to increase your liquidity. A {lspFee} service provider fee will be deducted from the amount you specified.", diff --git a/src/utils/i18n/locales/it/onboarding.json b/src/utils/i18n/locales/it/onboarding.json index c93cb9bca..41ed39700 100644 --- a/src/utils/i18n/locales/it/onboarding.json +++ b/src/utils/i18n/locales/it/onboarding.json @@ -3,7 +3,7 @@ "tos_checkbox": "Termini di Utilizzo", "tos_checkbox_value": "Dichiaro di aver letto e accettato le condizioni di utilizzo.", "pp_checkbox": "Informativa Privacy", - "pp_checkbox_value": "Dichiaro di aver letto e accettato l'informativa sulla privacy.", + "pp_checkbox_value": "Dichiaro di aver letto e accettato l''informativa sulla privacy.", "toolkit": "Il tuo Bitcoin\nToolkit.", "toolkit_text": "Bitkit ti consegna le chiavi per i tuoi soldi, il tuo profilo, i tuoi contatti e i tuoi account web.", "get_started": "Inizia", diff --git a/src/utils/i18n/locales/it/settings.json b/src/utils/i18n/locales/it/settings.json index 4ca84f8f8..f58e78ce7 100644 --- a/src/utils/i18n/locales/it/settings.json +++ b/src/utils/i18n/locales/it/settings.json @@ -15,7 +15,7 @@ "text": "Bitkit ti consegna le chiavi del tuo denaro, del tuo profilo, dei tuoi contatti e dei tuoi account web.\n\nQuesta Orange-Pillazione è stata accuratamente realizzata da Synonym Software Ltd.", "support": "Supporto", "report_bug": "Segnala un bug o contribuisci", - "legal": "Termini di Servizio", + "legal": "Termini di Utilizzo", "version": "Versione", "op_title": "Orange Pillato", "op_text": "Chi Orange-Pillerai?", diff --git a/src/utils/i18n/locales/it/wallet.json b/src/utils/i18n/locales/it/wallet.json index 65277dd59..a4643eb69 100644 --- a/src/utils/i18n/locales/it/wallet.json +++ b/src/utils/i18n/locales/it/wallet.json @@ -88,9 +88,10 @@ "receive_lightning_invoice": "Lightning invoice", "receive_note_placeholder": "Nota opzionale per chi paga", "receive_show_qr": "Visualizza QR Code", + "receive_text_lnfunds": "Vuoi ricevere fondi Lightning?", "receive_instantly": "Ricevi istantaneamente", - "receive_connect_initial": "Per ricevere Bitcoin istantantaneamente, Bitkit deve prima connettersi a Lightning. Una commissione di 1{lspFee}1 del fornitore di servizi verrà detratta dall'importo specificato.", - "receive_connect_additional": "Per ricevere più Bitcoin istantanei, Bitkit deve aumentare la tua liquidità. Una commissione di 1{lspFee}1 del fornitore di servizi verrà detratta dall'importo specificato.", + "receive_connect_initial": "Per ricevere Bitcoin istantantaneamente, Bitkit deve prima connettersi a Lightning. Una commissione di {lspFee} del fornitore di servizi verrà detratta dall'importo specificato.", + "receive_connect_additional": "Per ricevere più Bitcoin istantanei, Bitkit deve aumentare la tua liquidità. Una commissione di {lspFee} del fornitore di servizi verrà detratta dall'importo specificato.", "receive_error_min_title": "Al di sotto dell'importo minimo", "receive_error_min_description": "La fattura deve essere almeno {txt}", "receive_error_max_title": "Sopra l'importo massimo",