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