mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-03 03:59:10 +01:00
ADD: import LNDHub from QR
This commit is contained in:
parent
6aa4ac5b71
commit
d2c5aa8e55
1 changed files with 17 additions and 2 deletions
|
@ -2,8 +2,7 @@
|
|||
import React, { useState, useEffect, useCallback } from 'react';
|
||||
import { View, TextInput, Linking, StyleSheet } from 'react-native';
|
||||
import { Button } from 'react-native-elements';
|
||||
import { useTheme } from '@react-navigation/native';
|
||||
|
||||
import { useTheme, useNavigation, useRoute } from '@react-navigation/native';
|
||||
import { AppStorage } from '../../class';
|
||||
import AsyncStorage from '@react-native-community/async-storage';
|
||||
import {
|
||||
|
@ -14,6 +13,7 @@ import {
|
|||
BlueNavigationStyle,
|
||||
BlueLoadingHook,
|
||||
BlueTextHooks,
|
||||
BlueButtonLink,
|
||||
} from '../../BlueComponents';
|
||||
import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
|
||||
import loc from '../../loc';
|
||||
|
@ -51,6 +51,8 @@ const LightningSettings = () => {
|
|||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [URI, setURI] = useState();
|
||||
const { colors } = useTheme();
|
||||
const route = useRoute();
|
||||
const navigation = useNavigation();
|
||||
|
||||
useEffect(() => {
|
||||
AsyncStorage.getItem(AppStorage.LNDHUB)
|
||||
|
@ -79,6 +81,18 @@ const LightningSettings = () => {
|
|||
setIsLoading(false);
|
||||
}, [URI]);
|
||||
|
||||
const importScan = () => {
|
||||
navigation.navigate('ScanQRCodeRoot', {
|
||||
screen: 'ScanQRCode',
|
||||
params: {
|
||||
launchedBy: route.name,
|
||||
onBarScanned: setLndhubURI,
|
||||
showFileImportButton: true,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<SafeBlueArea forceInset={{ horizontal: 'always' }} style={styles.root}>
|
||||
<BlueCard>
|
||||
|
@ -115,6 +129,7 @@ const LightningSettings = () => {
|
|||
/>
|
||||
</View>
|
||||
|
||||
<BlueButtonLink title={loc.wallets.import_scan_qr} onPress={importScan} />
|
||||
<BlueSpacing20 />
|
||||
{isLoading ? <BlueLoadingHook /> : <BlueButton onPress={save} title={loc.settings.save} />}
|
||||
</BlueCard>
|
||||
|
|
Loading…
Add table
Reference in a new issue