2019-03-05 02:14:28 +01:00
|
|
|
/* global alert */
|
2020-09-08 18:06:41 +02:00
|
|
|
import React, { useEffect, useState } from 'react';
|
2019-08-14 05:12:42 +02:00
|
|
|
import { Chain } from '../../models/bitcoinUnits';
|
2019-09-19 01:26:28 +02:00
|
|
|
import {
|
|
|
|
Text,
|
|
|
|
Platform,
|
2019-09-29 22:01:27 +02:00
|
|
|
StyleSheet,
|
2019-09-19 01:26:28 +02:00
|
|
|
View,
|
2019-09-29 22:01:27 +02:00
|
|
|
Keyboard,
|
2019-09-19 01:26:28 +02:00
|
|
|
ActivityIndicator,
|
|
|
|
FlatList,
|
2019-11-02 21:58:55 +01:00
|
|
|
ScrollView,
|
2019-09-19 01:26:28 +02:00
|
|
|
TouchableOpacity,
|
|
|
|
StatusBar,
|
2019-09-29 22:01:27 +02:00
|
|
|
Linking,
|
|
|
|
KeyboardAvoidingView,
|
2020-01-01 04:31:04 +01:00
|
|
|
Alert,
|
2020-09-08 18:06:41 +02:00
|
|
|
InteractionManager,
|
|
|
|
useWindowDimensions,
|
2019-09-19 01:26:28 +02:00
|
|
|
} from 'react-native';
|
2020-04-03 05:53:53 +02:00
|
|
|
import ImagePicker from 'react-native-image-picker';
|
2020-08-21 00:50:38 +02:00
|
|
|
import Clipboard from '@react-native-community/clipboard';
|
2019-09-29 22:01:27 +02:00
|
|
|
import {
|
|
|
|
BlueSendButtonIcon,
|
|
|
|
BlueReceiveButtonIcon,
|
|
|
|
BlueTransactionListItem,
|
|
|
|
BlueWalletNavigationHeader,
|
2019-12-25 04:35:47 +01:00
|
|
|
BlueAlertWalletExportReminder,
|
2020-09-08 18:06:41 +02:00
|
|
|
BlueListItemHooks,
|
2019-09-29 22:01:27 +02:00
|
|
|
} from '../../BlueComponents';
|
2020-05-24 12:27:08 +02:00
|
|
|
import WalletGradient from '../../class/wallet-gradient';
|
2018-10-09 06:25:36 +02:00
|
|
|
import { Icon } from 'react-native-elements';
|
2020-02-26 15:39:19 +01:00
|
|
|
import { LightningCustodianWallet, WatchOnlyWallet } from '../../class';
|
2019-09-29 22:01:27 +02:00
|
|
|
import Modal from 'react-native-modal';
|
2020-03-29 04:06:45 +02:00
|
|
|
import HandoffSettings from '../../class/handoff';
|
|
|
|
import Handoff from 'react-native-handoff';
|
2020-04-03 05:53:53 +02:00
|
|
|
import ActionSheet from '../ActionSheet';
|
2020-07-20 15:38:46 +02:00
|
|
|
import loc from '../../loc';
|
2020-08-21 00:50:38 +02:00
|
|
|
import { getSystemName } from 'react-native-device-info';
|
2020-09-08 18:06:41 +02:00
|
|
|
import { useRoute, useNavigation, useTheme } from '@react-navigation/native';
|
2020-09-05 02:47:34 +02:00
|
|
|
import BuyBitcoin from './buyBitcoin';
|
2020-06-01 14:54:23 +02:00
|
|
|
const BlueApp = require('../../BlueApp');
|
2020-07-01 13:56:52 +02:00
|
|
|
const EV = require('../../blue_modules/events');
|
|
|
|
const BlueElectrum = require('../../blue_modules/BlueElectrum');
|
2020-04-03 05:53:53 +02:00
|
|
|
const LocalQRCode = require('@remobile/react-native-qrcode-local-image');
|
2020-08-21 00:50:38 +02:00
|
|
|
const isDesktop = getSystemName() === 'Mac OS X';
|
2018-10-09 06:25:36 +02:00
|
|
|
|
2020-05-24 11:17:26 +02:00
|
|
|
const styles = StyleSheet.create({
|
|
|
|
flex: {
|
|
|
|
flex: 1,
|
|
|
|
},
|
|
|
|
scrollViewContent: {
|
|
|
|
flex: 1,
|
|
|
|
justifyContent: 'center',
|
|
|
|
paddingHorizontal: 16,
|
|
|
|
paddingVertical: 40,
|
|
|
|
},
|
|
|
|
modalContent: {
|
|
|
|
backgroundColor: '#FFFFFF',
|
|
|
|
padding: 22,
|
|
|
|
justifyContent: 'center',
|
|
|
|
alignItems: 'center',
|
|
|
|
borderTopLeftRadius: 16,
|
|
|
|
borderTopRightRadius: 16,
|
|
|
|
borderColor: 'rgba(0, 0, 0, 0.1)',
|
|
|
|
minHeight: 200,
|
|
|
|
height: 200,
|
|
|
|
},
|
|
|
|
advancedTransactionOptionsModalContent: {
|
|
|
|
padding: 22,
|
|
|
|
borderTopLeftRadius: 16,
|
|
|
|
borderTopRightRadius: 16,
|
|
|
|
borderColor: 'rgba(0, 0, 0, 0.1)',
|
|
|
|
minHeight: 130,
|
|
|
|
},
|
|
|
|
bottomModal: {
|
|
|
|
justifyContent: 'flex-end',
|
|
|
|
margin: 0,
|
|
|
|
},
|
|
|
|
walletDetails: {
|
|
|
|
marginHorizontal: 16,
|
|
|
|
minWidth: 150,
|
|
|
|
justifyContent: 'center',
|
|
|
|
alignItems: 'flex-end',
|
|
|
|
},
|
|
|
|
activityIndicator: {
|
|
|
|
marginVertical: 20,
|
|
|
|
},
|
|
|
|
listHeader: {
|
|
|
|
flexDirection: 'row',
|
|
|
|
margin: 16,
|
|
|
|
justifyContent: 'space-evenly',
|
|
|
|
},
|
2020-08-21 00:50:38 +02:00
|
|
|
listHeaderTextRow: {
|
2020-05-24 11:17:26 +02:00
|
|
|
flex: 1,
|
2020-08-21 00:50:38 +02:00
|
|
|
marginHorizontal: 16,
|
|
|
|
flexDirection: 'row',
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
},
|
|
|
|
listHeaderText: {
|
2020-05-24 11:17:26 +02:00
|
|
|
marginTop: 8,
|
|
|
|
marginBottom: 8,
|
|
|
|
fontWeight: 'bold',
|
|
|
|
fontSize: 24,
|
|
|
|
},
|
|
|
|
marketplaceButton1: {
|
|
|
|
borderRadius: 9,
|
|
|
|
minHeight: 49,
|
|
|
|
flex: 1,
|
|
|
|
paddingHorizontal: 8,
|
|
|
|
justifyContent: 'center',
|
|
|
|
flexDirection: 'row',
|
|
|
|
alignItems: 'center',
|
|
|
|
},
|
|
|
|
marketplaceButton2: {
|
|
|
|
marginLeft: 5,
|
|
|
|
borderRadius: 9,
|
|
|
|
minHeight: 49,
|
|
|
|
flex: 1,
|
|
|
|
paddingHorizontal: 8,
|
|
|
|
justifyContent: 'center',
|
|
|
|
flexDirection: 'row',
|
|
|
|
alignItems: 'center',
|
|
|
|
},
|
|
|
|
marketpalceText1: {
|
|
|
|
fontSize: 18,
|
|
|
|
},
|
|
|
|
marketpalceText2: {
|
|
|
|
fontSize: 18,
|
|
|
|
marginHorizontal: 8,
|
|
|
|
},
|
|
|
|
list: {
|
|
|
|
flex: 1,
|
|
|
|
},
|
|
|
|
emptyTxs: {
|
|
|
|
fontSize: 18,
|
|
|
|
color: '#9aa0aa',
|
|
|
|
textAlign: 'center',
|
|
|
|
marginVertical: 16,
|
|
|
|
},
|
|
|
|
emptyTxsLightning: {
|
|
|
|
fontSize: 18,
|
|
|
|
color: '#9aa0aa',
|
|
|
|
textAlign: 'center',
|
|
|
|
fontWeight: '600',
|
|
|
|
},
|
|
|
|
buyBitcoin: {
|
|
|
|
backgroundColor: '#007AFF',
|
|
|
|
minWidth: 260,
|
|
|
|
borderRadius: 8,
|
|
|
|
alignSelf: 'center',
|
|
|
|
paddingVertical: 14,
|
|
|
|
paddingHorizontal: 32,
|
|
|
|
},
|
|
|
|
buyBitcoinText: {
|
|
|
|
fontSize: 15,
|
|
|
|
color: '#fff',
|
|
|
|
textAlign: 'center',
|
|
|
|
fontWeight: '600',
|
|
|
|
},
|
|
|
|
floatButtons: {
|
|
|
|
flexDirection: 'row',
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
position: 'absolute',
|
2020-08-11 01:21:02 +02:00
|
|
|
alignSelf: 'center',
|
2020-05-24 11:17:26 +02:00
|
|
|
bottom: 30,
|
|
|
|
borderRadius: 30,
|
2020-08-11 01:21:02 +02:00
|
|
|
width: '60%',
|
2020-08-12 17:59:56 +02:00
|
|
|
maxWidth: 400,
|
2020-08-11 01:21:02 +02:00
|
|
|
flex: 1,
|
2020-08-12 18:09:19 +02:00
|
|
|
height: '6.3%',
|
2020-08-12 17:59:56 +02:00
|
|
|
minHeight: 44,
|
2020-05-24 11:17:26 +02:00
|
|
|
overflow: 'hidden',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
const WalletTransactions = () => {
|
|
|
|
const [isHandOffUseEnabled, setIsHandOffUseEnabled] = useState(false);
|
|
|
|
const [isLoading, setIsLoading] = useState(false);
|
|
|
|
const [isManageFundsModalVisible, setIsManageFundsModalVisible] = useState(false);
|
|
|
|
const { wallet } = useRoute().params;
|
|
|
|
const name = useRoute().name;
|
|
|
|
const [itemPriceUnit, setItemPriceUnit] = useState(wallet.getPreferredBalanceUnit());
|
2020-09-10 15:16:19 +02:00
|
|
|
const [dataSource, setDataSource] = useState(wallet.getTransactions(15));
|
2020-09-08 18:06:41 +02:00
|
|
|
const [timeElapsed, setTimeElapsed] = useState(0);
|
|
|
|
const [limit, setLimit] = useState(15);
|
|
|
|
const [pageSize, setPageSize] = useState(20);
|
|
|
|
const { setParams, navigate } = useNavigation();
|
|
|
|
const { colors } = useTheme();
|
|
|
|
|
|
|
|
const windowHeight = useWindowDimensions().height;
|
|
|
|
const windowWidth = useWindowDimensions().width;
|
|
|
|
const stylesHook = StyleSheet.create({
|
|
|
|
advancedTransactionOptionsModalContent: {
|
|
|
|
backgroundColor: colors.elevated,
|
|
|
|
},
|
|
|
|
listHeaderText: {
|
|
|
|
color: colors.foregroundColor,
|
|
|
|
},
|
|
|
|
marketplaceButton1: {
|
|
|
|
backgroundColor: colors.lightButton,
|
|
|
|
},
|
|
|
|
marketplaceButton2: {
|
|
|
|
backgroundColor: colors.lightButton,
|
|
|
|
},
|
|
|
|
marketpalceText1: {
|
|
|
|
color: colors.cta2,
|
|
|
|
},
|
|
|
|
marketpalceText2: {
|
|
|
|
color: colors.cta2,
|
|
|
|
},
|
|
|
|
list: {
|
|
|
|
backgroundColor: colors.background,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
const interval = setInterval(() => setTimeElapsed(prev => ({ timeElapsed: prev.timeElapsed + 1 })), 60000);
|
2018-10-09 06:25:36 +02:00
|
|
|
|
2019-02-19 00:37:53 +01:00
|
|
|
/**
|
|
|
|
* Simple wrapper for `wallet.getTransactions()`, where `wallet` is current wallet.
|
|
|
|
* Sorts. Provides limiting.
|
|
|
|
*
|
|
|
|
* @param limit {Integer} How many txs return, starting from the earliest. Default: all of them.
|
|
|
|
* @returns {Array}
|
|
|
|
*/
|
2020-09-08 18:06:41 +02:00
|
|
|
const getTransactions = (limit = Infinity) => {
|
2019-02-19 00:37:53 +01:00
|
|
|
let txs = wallet.getTransactions();
|
2020-06-01 14:54:23 +02:00
|
|
|
for (const tx of txs) {
|
2019-02-19 00:37:53 +01:00
|
|
|
tx.sort_ts = +new Date(tx.received);
|
|
|
|
}
|
2020-06-01 14:54:23 +02:00
|
|
|
txs = txs.sort(function (a, b) {
|
2019-02-19 00:37:53 +01:00
|
|
|
return b.sort_ts - a.sort_ts;
|
|
|
|
});
|
|
|
|
return txs.slice(0, limit);
|
2020-09-08 18:06:41 +02:00
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
};
|
2019-02-19 00:37:53 +01:00
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
useEffect(() => {
|
|
|
|
EV(EV.enum.REMOTE_TRANSACTIONS_COUNT_CHANGED, refreshTransactionsFunction, true);
|
|
|
|
HandoffSettings.isHandoffUseEnabled().then(setIsHandOffUseEnabled);
|
|
|
|
return () => {
|
|
|
|
clearInterval(interval);
|
|
|
|
navigate('DrawerRoot', { selectedWallet: '' });
|
|
|
|
};
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
setIsLoading(true);
|
|
|
|
setLimit(15);
|
|
|
|
setPageSize(20);
|
|
|
|
setTimeElapsed(0);
|
2020-09-10 04:28:03 +02:00
|
|
|
setDataSource(wallet.getTransactions(15));
|
2020-09-08 18:06:41 +02:00
|
|
|
setItemPriceUnit(wallet.getPreferredBalanceUnit());
|
|
|
|
setParams({ wallet, isLoading: false });
|
|
|
|
setIsLoading(false);
|
|
|
|
navigate('DrawerRoot', { selectedWallet: wallet.getID() });
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
}, [wallet]);
|
2018-10-09 06:25:36 +02:00
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
/**
|
|
|
|
* Forcefully fetches TXs and balance for wallet
|
|
|
|
*/
|
|
|
|
const refreshTransactionsFunction = delay => {
|
|
|
|
delay = delay || 4000;
|
|
|
|
setTimeout(function () {
|
|
|
|
refreshTransactions();
|
|
|
|
}, delay); // giving a chance to remote server to propagate
|
|
|
|
};
|
2018-10-09 06:25:36 +02:00
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
const isLightning = () => {
|
|
|
|
const w = wallet;
|
2019-12-25 21:53:53 +01:00
|
|
|
if (w && w.chain === Chain.OFFCHAIN) {
|
2018-10-09 06:25:36 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2020-09-08 18:06:41 +02:00
|
|
|
};
|
2018-10-09 06:25:36 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Forcefully fetches TXs and balance for wallet
|
|
|
|
*/
|
2020-09-08 18:06:41 +02:00
|
|
|
const refreshTransactions = async () => {
|
|
|
|
if (isLoading) return;
|
|
|
|
setIsLoading(true);
|
|
|
|
let noErr = true;
|
|
|
|
let smthChanged = false;
|
|
|
|
try {
|
|
|
|
// await BlueElectrum.ping();
|
|
|
|
await BlueElectrum.waitTillConnected();
|
|
|
|
/** @type {LegacyWallet} */
|
|
|
|
const balanceStart = +new Date();
|
|
|
|
const oldBalance = wallet.getBalance();
|
|
|
|
await wallet.fetchBalance();
|
|
|
|
if (oldBalance !== wallet.getBalance()) smthChanged = true;
|
|
|
|
const balanceEnd = +new Date();
|
|
|
|
console.log(wallet.getLabel(), 'fetch balance took', (balanceEnd - balanceStart) / 1000, 'sec');
|
|
|
|
const start = +new Date();
|
|
|
|
const oldTxLen = wallet.getTransactions().length;
|
|
|
|
await wallet.fetchTransactions();
|
|
|
|
if (wallet.fetchPendingTransactions) {
|
|
|
|
await wallet.fetchPendingTransactions();
|
|
|
|
}
|
|
|
|
if (wallet.fetchUserInvoices) {
|
|
|
|
await wallet.fetchUserInvoices();
|
|
|
|
}
|
|
|
|
if (oldTxLen !== wallet.getTransactions().length) smthChanged = true;
|
|
|
|
const end = +new Date();
|
|
|
|
console.log(wallet.getLabel(), 'fetch tx took', (end - start) / 1000, 'sec');
|
|
|
|
} catch (err) {
|
|
|
|
noErr = false;
|
|
|
|
alert(err.message);
|
|
|
|
setIsLoading(false);
|
|
|
|
}
|
|
|
|
if (noErr && smthChanged) {
|
|
|
|
console.log('saving to disk');
|
|
|
|
await BlueApp.saveToDisk(); // caching
|
|
|
|
EV(EV.enum.TRANSACTIONS_COUNT_CHANGED); // let other components know they should redraw
|
2020-09-10 04:28:03 +02:00
|
|
|
setDataSource(getTransactions(limit));
|
2020-09-08 18:06:41 +02:00
|
|
|
}
|
|
|
|
setIsLoading(false);
|
|
|
|
};
|
2018-10-09 06:25:36 +02:00
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
const _keyExtractor = (_item, index) => index.toString();
|
2018-10-09 06:25:36 +02:00
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
const renderListFooterComponent = () => {
|
2019-02-19 21:32:45 +01:00
|
|
|
// if not all txs rendered - display indicator
|
2020-09-08 18:06:41 +02:00
|
|
|
return (getTransactions(Infinity).length > limit && <ActivityIndicator style={styles.activityIndicator} />) || <View />;
|
2019-02-19 21:32:45 +01:00
|
|
|
};
|
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
const renderListHeaderComponent = () => {
|
|
|
|
const style = { opacity: isLoading ? 0.5 : 1.0 };
|
2018-10-09 06:25:36 +02:00
|
|
|
return (
|
2020-05-24 11:17:26 +02:00
|
|
|
<View style={styles.flex}>
|
|
|
|
<View style={styles.listHeader}>
|
2020-04-29 15:59:47 +02:00
|
|
|
{/*
|
2020-04-29 17:40:55 +02:00
|
|
|
Current logic - Onchain:
|
|
|
|
- Shows buy button on middle when empty
|
|
|
|
- Show buy button on top when not empty
|
|
|
|
- Shows Marketplace button on details screen, open in browser (iOS)
|
|
|
|
- Shows Marketplace button on details screen, open in in-app (android)
|
|
|
|
Current logic - Offchain:
|
|
|
|
- Shows Lapp Browser empty (iOS)
|
|
|
|
- Shows Lapp Browser with marketplace (android)
|
|
|
|
- Shows Marketplace button to open in browser (iOS)
|
|
|
|
|
|
|
|
The idea is to avoid showing on iOS an appstore/market style app that goes against the TOS.
|
2020-05-27 13:12:17 +02:00
|
|
|
|
2020-04-29 15:59:47 +02:00
|
|
|
*/}
|
2020-09-08 18:06:41 +02:00
|
|
|
{wallet.getTransactions().length > 0 && wallet.type !== LightningCustodianWallet.type && renderSellFiat()}
|
|
|
|
{wallet.type === LightningCustodianWallet.type && renderMarketplaceButton()}
|
|
|
|
{wallet.type === LightningCustodianWallet.type && Platform.OS === 'ios' && renderLappBrowserButton()}
|
2019-12-25 21:53:53 +01:00
|
|
|
</View>
|
2020-09-08 18:06:41 +02:00
|
|
|
<View style={[styles.listHeaderTextRow, stylesHook.listHeaderTextRow]}>
|
|
|
|
<Text style={[styles.listHeaderText, stylesHook.listHeaderText]}>{loc.transactions.list_title}</Text>
|
2020-08-21 00:50:38 +02:00
|
|
|
{isDesktop && (
|
2020-09-08 18:06:41 +02:00
|
|
|
<TouchableOpacity style={style} onPress={refreshTransactions} disabled={isLoading}>
|
|
|
|
<Icon name="refresh" type="font-awesome" color={colors.feeText} />
|
2020-08-21 00:50:38 +02:00
|
|
|
</TouchableOpacity>
|
|
|
|
)}
|
|
|
|
</View>
|
2018-10-09 06:25:36 +02:00
|
|
|
</View>
|
|
|
|
);
|
|
|
|
};
|
2019-09-29 22:01:27 +02:00
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
const renderManageFundsModal = () => {
|
2019-09-29 22:01:27 +02:00
|
|
|
return (
|
|
|
|
<Modal
|
2020-08-08 04:22:51 +02:00
|
|
|
deviceHeight={windowHeight}
|
2020-09-08 18:06:41 +02:00
|
|
|
deviceWidth={windowWidth}
|
|
|
|
isVisible={isManageFundsModalVisible}
|
2019-09-29 22:01:27 +02:00
|
|
|
style={styles.bottomModal}
|
|
|
|
onBackdropPress={() => {
|
|
|
|
Keyboard.dismiss();
|
2020-09-08 18:06:41 +02:00
|
|
|
setIsManageFundsModalVisible(false);
|
2019-09-29 22:01:27 +02:00
|
|
|
}}
|
|
|
|
>
|
|
|
|
<KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'position' : null}>
|
2020-09-08 18:06:41 +02:00
|
|
|
<View style={[styles.advancedTransactionOptionsModalContent, stylesHook.advancedTransactionOptionsModalContent]}>
|
|
|
|
<BlueListItemHooks
|
2019-09-29 22:01:27 +02:00
|
|
|
hideChevron
|
|
|
|
component={TouchableOpacity}
|
2020-09-05 02:49:32 +02:00
|
|
|
onPress={() => {
|
2019-09-29 22:01:27 +02:00
|
|
|
const wallets = [...BlueApp.getWallets().filter(item => item.chain === Chain.ONCHAIN && item.allowSend())];
|
|
|
|
if (wallets.length === 0) {
|
2020-07-20 15:38:46 +02:00
|
|
|
alert(loc.lnd.refill_create);
|
2019-09-29 22:01:27 +02:00
|
|
|
} else {
|
2020-09-08 18:06:41 +02:00
|
|
|
setIsManageFundsModalVisible(false);
|
|
|
|
navigate('SelectWallet', { onWalletSelect, chainType: Chain.ONCHAIN });
|
2019-09-29 22:01:27 +02:00
|
|
|
}
|
|
|
|
}}
|
2019-10-01 00:13:22 +02:00
|
|
|
title={loc.lnd.refill}
|
2019-09-29 22:01:27 +02:00
|
|
|
/>
|
2020-09-08 18:06:41 +02:00
|
|
|
<BlueListItemHooks
|
2019-09-29 22:01:27 +02:00
|
|
|
hideChevron
|
|
|
|
component={TouchableOpacity}
|
2020-09-05 02:49:32 +02:00
|
|
|
onPress={() => {
|
2020-09-08 18:06:41 +02:00
|
|
|
setIsManageFundsModalVisible(false);
|
|
|
|
|
|
|
|
navigate('ReceiveDetails', {
|
|
|
|
secret: wallet.getSecret(),
|
|
|
|
});
|
2019-09-29 22:01:27 +02:00
|
|
|
}}
|
2020-07-20 15:38:46 +02:00
|
|
|
title={loc.lnd.refill_external}
|
2019-09-29 22:01:27 +02:00
|
|
|
/>
|
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
<BlueListItemHooks
|
2020-04-17 16:41:35 +02:00
|
|
|
hideChevron
|
|
|
|
component={TouchableOpacity}
|
2020-09-05 02:49:32 +02:00
|
|
|
onPress={() => {
|
2020-09-08 18:06:41 +02:00
|
|
|
setIsManageFundsModalVisible(false);
|
|
|
|
navigateToBuyBitcoin();
|
2020-04-17 16:41:35 +02:00
|
|
|
}}
|
2020-07-20 15:38:46 +02:00
|
|
|
title={loc.lnd.refill_card}
|
2020-04-17 16:41:35 +02:00
|
|
|
/>
|
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
<BlueListItemHooks
|
2020-06-16 17:08:25 +02:00
|
|
|
title={loc.lnd.exchange}
|
2019-09-29 22:01:27 +02:00
|
|
|
hideChevron
|
|
|
|
component={TouchableOpacity}
|
2020-09-05 02:49:32 +02:00
|
|
|
onPress={() => {
|
2020-09-08 18:06:41 +02:00
|
|
|
setIsManageFundsModalVisible(false);
|
2019-09-29 22:01:27 +02:00
|
|
|
Linking.openURL('https://zigzag.io/?utm_source=integration&utm_medium=bluewallet&utm_campaign=withdrawLink');
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</View>
|
|
|
|
</KeyboardAvoidingView>
|
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
const navigateToBuyBitcoin = () => {
|
|
|
|
BuyBitcoin.navigate(wallet);
|
|
|
|
};
|
|
|
|
|
|
|
|
const renderMarketplaceButton = () => {
|
2019-10-17 03:51:22 +02:00
|
|
|
return Platform.select({
|
|
|
|
android: (
|
|
|
|
<TouchableOpacity
|
|
|
|
onPress={() => {
|
2020-09-08 18:06:41 +02:00
|
|
|
if (wallet.type === LightningCustodianWallet.type) {
|
|
|
|
navigate('LappBrowser', { fromSecret: wallet.getSecret(), fromWallet: wallet });
|
2020-04-29 17:40:55 +02:00
|
|
|
} else {
|
2020-09-08 18:06:41 +02:00
|
|
|
navigate('Marketplace', { fromWallet: wallet });
|
2020-04-29 17:40:55 +02:00
|
|
|
}
|
2019-10-17 03:51:22 +02:00
|
|
|
}}
|
2020-09-08 18:06:41 +02:00
|
|
|
style={[styles.marketplaceButton1, stylesHook.marketplaceButton1]}
|
2019-10-17 03:51:22 +02:00
|
|
|
>
|
2020-09-08 18:06:41 +02:00
|
|
|
<Text style={[styles.marketpalceText1, stylesHook.marketpalceText1]}>marketplace</Text>
|
2019-10-17 03:51:22 +02:00
|
|
|
</TouchableOpacity>
|
|
|
|
),
|
|
|
|
ios:
|
2020-09-08 18:06:41 +02:00
|
|
|
wallet.getBalance() > 0 ? (
|
2019-10-17 03:51:22 +02:00
|
|
|
<TouchableOpacity
|
|
|
|
onPress={async () => {
|
2020-04-16 13:41:12 +02:00
|
|
|
Linking.openURL('https://bluewallet.io/marketplace/');
|
2019-10-17 03:51:22 +02:00
|
|
|
}}
|
2020-09-08 18:06:41 +02:00
|
|
|
style={[styles.marketplaceButton1, stylesHook.marketplaceButton1]}
|
2019-10-17 03:51:22 +02:00
|
|
|
>
|
2019-10-17 04:08:09 +02:00
|
|
|
<Icon name="external-link" size={18} type="font-awesome" color="#9aa0aa" />
|
2020-09-08 18:06:41 +02:00
|
|
|
<Text style={[styles.marketpalceText2, stylesHook.marketpalceText2]}>marketplace</Text>
|
2019-10-17 03:51:22 +02:00
|
|
|
</TouchableOpacity>
|
|
|
|
) : null,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
const renderLappBrowserButton = () => {
|
2019-10-21 13:52:38 +02:00
|
|
|
return (
|
|
|
|
<TouchableOpacity
|
|
|
|
onPress={() => {
|
2020-09-08 18:06:41 +02:00
|
|
|
navigate('LappBrowser', {
|
|
|
|
fromSecret: wallet.getSecret(),
|
|
|
|
fromWallet: wallet,
|
2019-10-23 23:54:09 +02:00
|
|
|
url: 'https://duckduckgo.com',
|
2019-10-21 13:52:38 +02:00
|
|
|
});
|
|
|
|
}}
|
2020-09-08 18:06:41 +02:00
|
|
|
style={[styles.marketplaceButton2, stylesHook.marketplaceButton2]}
|
2019-10-21 13:52:38 +02:00
|
|
|
>
|
2020-09-08 18:06:41 +02:00
|
|
|
<Text style={[styles.marketpalceText1, stylesHook.marketpalceText1]}>LApp Browser</Text>
|
2019-10-21 13:52:38 +02:00
|
|
|
</TouchableOpacity>
|
|
|
|
);
|
|
|
|
};
|
2020-06-01 14:54:23 +02:00
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
const renderSellFiat = () => {
|
2020-04-16 15:43:53 +02:00
|
|
|
return (
|
2020-09-08 18:06:41 +02:00
|
|
|
<TouchableOpacity onPress={navigateToBuyBitcoin} style={[styles.marketplaceButton2, stylesHook.marketplaceButton2]}>
|
|
|
|
<Text style={[styles.marketpalceText1, stylesHook.marketpalceText1]}>{loc.wallets.list_tap_here_to_buy}</Text>
|
2020-04-16 15:43:53 +02:00
|
|
|
</TouchableOpacity>
|
|
|
|
);
|
|
|
|
};
|
2020-03-23 17:32:51 +01:00
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
const onWalletSelect = async wallet => {
|
2019-11-03 01:25:55 +01:00
|
|
|
if (wallet) {
|
2020-09-08 18:06:41 +02:00
|
|
|
navigate('WalletTransactions', {
|
2019-11-03 01:25:55 +01:00
|
|
|
key: `WalletTransactions-${wallet.getID()}`,
|
|
|
|
});
|
|
|
|
/** @type {LightningCustodianWallet} */
|
|
|
|
let toAddress = false;
|
2020-09-08 18:06:41 +02:00
|
|
|
if (wallet.refill_addressess.length > 0) {
|
|
|
|
toAddress = wallet.refill_addressess[0];
|
2019-11-03 01:25:55 +01:00
|
|
|
} else {
|
|
|
|
try {
|
2020-09-08 18:06:41 +02:00
|
|
|
await wallet.fetchBtcAddress();
|
|
|
|
toAddress = wallet.refill_addressess[0];
|
2019-11-03 01:25:55 +01:00
|
|
|
} catch (Err) {
|
|
|
|
return alert(Err.message);
|
|
|
|
}
|
2019-09-29 22:01:27 +02:00
|
|
|
}
|
2020-09-08 18:06:41 +02:00
|
|
|
navigate('SendDetailsRoot', {
|
2020-05-27 13:12:17 +02:00
|
|
|
screen: 'SendDetails',
|
|
|
|
params: {
|
|
|
|
memo: loc.lnd.refill_lnd_balance,
|
|
|
|
address: toAddress,
|
|
|
|
fromWallet: wallet,
|
|
|
|
},
|
2019-09-29 22:01:27 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
2020-09-08 18:06:41 +02:00
|
|
|
const navigateToSendScreen = () => {
|
|
|
|
navigate('SendDetailsRoot', {
|
2020-05-27 13:12:17 +02:00
|
|
|
screen: 'SendDetails',
|
|
|
|
params: {
|
2020-09-08 18:06:41 +02:00
|
|
|
fromWallet: wallet,
|
2020-05-27 13:12:17 +02:00
|
|
|
},
|
2020-01-01 04:31:04 +01:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
const renderItem = item => <BlueTransactionListItem item={item.item} itemPriceUnit={itemPriceUnit} timeElapsed={timeElapsed} />;
|
|
|
|
|
|
|
|
const onBarCodeRead = ret => {
|
|
|
|
if (!isLoading) {
|
|
|
|
setIsLoading(true);
|
|
|
|
const params = {
|
|
|
|
fromSecret: wallet.getSecret(),
|
|
|
|
// ScanLndInvoice actrually uses `fromSecret` so keeping it for now
|
|
|
|
uri: ret.data ? ret.data : ret,
|
|
|
|
fromWallet: wallet,
|
|
|
|
};
|
|
|
|
if (wallet.chain === Chain.ONCHAIN) {
|
|
|
|
navigate('SendDetailsRoot', { screen: 'SendDetails', params });
|
|
|
|
} else {
|
|
|
|
navigate('ScanLndInvoiceRoot', { screen: 'ScanLndInvoice', params });
|
|
|
|
}
|
2020-04-03 05:53:53 +02:00
|
|
|
}
|
2020-09-08 18:06:41 +02:00
|
|
|
setIsLoading(false);
|
2020-04-03 05:53:53 +02:00
|
|
|
};
|
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
const choosePhoto = () => {
|
2020-04-03 05:53:53 +02:00
|
|
|
ImagePicker.launchImageLibrary(
|
|
|
|
{
|
|
|
|
title: null,
|
|
|
|
mediaType: 'photo',
|
|
|
|
takePhotoButtonTitle: null,
|
|
|
|
},
|
|
|
|
response => {
|
|
|
|
if (response.uri) {
|
|
|
|
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
|
|
|
|
LocalQRCode.decode(uri, (error, result) => {
|
|
|
|
if (!error) {
|
2020-09-08 18:06:41 +02:00
|
|
|
onBarCodeRead({ data: result });
|
2020-04-03 05:53:53 +02:00
|
|
|
} else {
|
2020-07-20 15:38:46 +02:00
|
|
|
alert(loc.send.qr_error_no_qrcode);
|
2020-04-03 05:53:53 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
const copyFromClipbard = async () => {
|
|
|
|
onBarCodeRead({ data: await Clipboard.getString() });
|
2020-04-05 22:09:53 +02:00
|
|
|
};
|
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
const sendButtonLongPress = async () => {
|
2020-05-28 10:44:15 +02:00
|
|
|
const isClipboardEmpty = (await Clipboard.getString()).replace(' ', '').length === 0;
|
2020-04-03 05:53:53 +02:00
|
|
|
if (Platform.OS === 'ios') {
|
2020-07-20 15:38:46 +02:00
|
|
|
const options = [loc._.cancel, loc.wallets.list_long_choose, loc.wallets.list_long_scan];
|
2020-05-28 10:44:15 +02:00
|
|
|
if (!isClipboardEmpty) {
|
2020-07-20 15:38:46 +02:00
|
|
|
options.push(loc.wallets.list_long_clipboard);
|
2020-05-28 10:44:15 +02:00
|
|
|
}
|
|
|
|
ActionSheet.showActionSheetWithOptions({ options, cancelButtonIndex: 0 }, buttonIndex => {
|
|
|
|
if (buttonIndex === 1) {
|
2020-09-08 18:06:41 +02:00
|
|
|
choosePhoto();
|
2020-05-28 10:44:15 +02:00
|
|
|
} else if (buttonIndex === 2) {
|
2020-09-08 18:06:41 +02:00
|
|
|
navigate('ScanQRCodeRoot', {
|
2020-08-11 02:11:11 +02:00
|
|
|
screen: 'ScanQRCode',
|
|
|
|
params: {
|
2020-09-08 18:06:41 +02:00
|
|
|
launchedBy: name,
|
|
|
|
onBarScanned: onBarCodeRead,
|
2020-08-11 02:11:11 +02:00
|
|
|
showFileImportButton: false,
|
|
|
|
},
|
2020-05-28 10:44:15 +02:00
|
|
|
});
|
|
|
|
} else if (buttonIndex === 3) {
|
2020-09-08 18:06:41 +02:00
|
|
|
copyFromClipbard();
|
2020-05-28 10:44:15 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
} else if (Platform.OS === 'android') {
|
2020-06-01 14:54:23 +02:00
|
|
|
const buttons = [
|
2020-05-28 10:44:15 +02:00
|
|
|
{
|
2020-07-20 15:38:46 +02:00
|
|
|
text: loc._.cancel,
|
2020-05-28 10:44:15 +02:00
|
|
|
onPress: () => {},
|
|
|
|
style: 'cancel',
|
|
|
|
},
|
|
|
|
{
|
2020-07-20 15:38:46 +02:00
|
|
|
text: loc.wallets.list_long_choose,
|
2020-09-08 18:06:41 +02:00
|
|
|
onPress: choosePhoto,
|
2020-05-28 10:44:15 +02:00
|
|
|
},
|
|
|
|
{
|
2020-07-20 15:38:46 +02:00
|
|
|
text: loc.wallets.list_long_scan,
|
2020-05-28 10:44:15 +02:00
|
|
|
onPress: () =>
|
2020-09-08 18:06:41 +02:00
|
|
|
navigate('ScanQRCodeRoot', {
|
2020-08-11 02:11:11 +02:00
|
|
|
screen: 'ScanQRCode',
|
|
|
|
params: {
|
2020-09-08 18:06:41 +02:00
|
|
|
launchedBy: name,
|
|
|
|
onBarScanned: onBarCodeRead,
|
2020-08-11 02:11:11 +02:00
|
|
|
showFileImportButton: false,
|
|
|
|
},
|
2020-05-28 10:44:15 +02:00
|
|
|
}),
|
2020-04-03 05:53:53 +02:00
|
|
|
},
|
2020-05-28 10:44:15 +02:00
|
|
|
];
|
|
|
|
if (!isClipboardEmpty) {
|
|
|
|
buttons.push({
|
2020-07-20 15:38:46 +02:00
|
|
|
text: loc.wallets.list_long_clipboard,
|
2020-09-08 18:06:41 +02:00
|
|
|
onPress: copyFromClipbard,
|
2020-05-28 10:44:15 +02:00
|
|
|
});
|
|
|
|
}
|
2020-04-03 05:53:53 +02:00
|
|
|
ActionSheet.showActionSheetWithOptions({
|
|
|
|
title: '',
|
|
|
|
message: '',
|
2020-05-28 10:44:15 +02:00
|
|
|
buttons,
|
2020-04-03 05:53:53 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
return (
|
|
|
|
<View style={styles.flex}>
|
|
|
|
<StatusBar barStyle="light-content" backgroundColor={WalletGradient.headerColorFor(wallet.type)} />
|
|
|
|
{wallet.chain === Chain.ONCHAIN && isHandOffUseEnabled && (
|
|
|
|
<Handoff
|
|
|
|
title={`Bitcoin Wallet ${wallet.getLabel()}`}
|
|
|
|
type="io.bluewallet.bluewallet"
|
|
|
|
url={`https://blockpath.com/search/addr?q=${wallet.getXpub()}`}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
<BlueWalletNavigationHeader
|
|
|
|
wallet={wallet}
|
|
|
|
onWalletUnitChange={wallet =>
|
|
|
|
InteractionManager.runAfterInteractions(async () => {
|
|
|
|
setItemPriceUnit(wallet.getPreferredBalanceUnit());
|
|
|
|
BlueApp.saveToDisk();
|
|
|
|
})
|
|
|
|
}
|
|
|
|
onManageFundsPressed={() => {
|
|
|
|
if (wallet.getUserHasSavedExport()) {
|
|
|
|
setIsManageFundsModalVisible(true);
|
|
|
|
} else {
|
|
|
|
BlueAlertWalletExportReminder({
|
|
|
|
onSuccess: async () => {
|
|
|
|
wallet.setUserHasSavedExport(true);
|
|
|
|
await BlueApp.saveToDisk();
|
|
|
|
setIsManageFundsModalVisible(true);
|
|
|
|
},
|
|
|
|
onFailure: () =>
|
|
|
|
navigate('WalletExport', {
|
|
|
|
wallet,
|
|
|
|
}),
|
|
|
|
});
|
2019-08-04 08:42:05 +02:00
|
|
|
}
|
2020-09-08 18:06:41 +02:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<View style={[styles.list, stylesHook.list]}>
|
|
|
|
<FlatList
|
|
|
|
ListHeaderComponent={renderListHeaderComponent}
|
|
|
|
onEndReachedThreshold={0.3}
|
|
|
|
onEndReached={async () => {
|
|
|
|
// pagination in works. in this block we will add more txs to flatlist
|
|
|
|
// so as user scrolls closer to bottom it will render mode transactions
|
|
|
|
|
|
|
|
if (getTransactions(Infinity).length < limit) {
|
|
|
|
// all list rendered. nop
|
|
|
|
return;
|
2019-12-25 04:35:47 +01:00
|
|
|
}
|
2020-09-08 18:06:41 +02:00
|
|
|
|
|
|
|
setDataSource(getTransactions(limit + pageSize));
|
|
|
|
setLimit(prev => prev + pageSize);
|
|
|
|
setPageSize(prev => prev * 2);
|
2019-12-25 04:35:47 +01:00
|
|
|
}}
|
2020-09-08 18:06:41 +02:00
|
|
|
ListFooterComponent={renderListFooterComponent}
|
|
|
|
ListEmptyComponent={
|
|
|
|
<ScrollView style={styles.flex} contentContainerStyle={styles.scrollViewContent}>
|
|
|
|
<Text numberOfLines={0} style={styles.emptyTxs}>
|
|
|
|
{(isLightning() && loc.wallets.list_empty_txs1_lightning) || loc.wallets.list_empty_txs1}
|
|
|
|
</Text>
|
|
|
|
{isLightning() && <Text style={styles.emptyTxsLightning}>{loc.wallets.list_empty_txs2_lightning}</Text>}
|
|
|
|
|
|
|
|
{!isLightning() && (
|
|
|
|
<TouchableOpacity onPress={navigateToBuyBitcoin} style={styles.buyBitcoin}>
|
|
|
|
<Text style={styles.buyBitcoinText}>{loc.wallets.list_tap_here_to_buy}</Text>
|
|
|
|
</TouchableOpacity>
|
|
|
|
)}
|
|
|
|
</ScrollView>
|
|
|
|
}
|
|
|
|
onRefresh={refreshTransactions}
|
|
|
|
refreshing={isLoading}
|
|
|
|
data={dataSource}
|
|
|
|
extraData={timeElapsed}
|
|
|
|
keyExtractor={_keyExtractor}
|
|
|
|
renderItem={renderItem}
|
|
|
|
contentInset={{ top: 0, left: 0, bottom: 90, right: 0 }}
|
2019-08-04 08:42:05 +02:00
|
|
|
/>
|
2020-09-08 18:06:41 +02:00
|
|
|
{renderManageFundsModal()}
|
|
|
|
</View>
|
|
|
|
<View style={styles.floatButtons}>
|
|
|
|
{(() => {
|
|
|
|
if (wallet.allowReceive()) {
|
|
|
|
return (
|
|
|
|
<BlueReceiveButtonIcon
|
|
|
|
onPress={() => {
|
|
|
|
if (wallet.chain === Chain.OFFCHAIN) {
|
|
|
|
navigate('LNDCreateInvoiceRoot', { screen: 'LNDCreateInvoice', params: { fromWallet: wallet } });
|
|
|
|
} else {
|
|
|
|
navigate('ReceiveDetails', { secret: wallet.getSecret() });
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
})()}
|
|
|
|
|
|
|
|
{(() => {
|
|
|
|
if (wallet.allowSend() || (wallet.type === WatchOnlyWallet.type && wallet.isHd() && wallet.getSecret().startsWith('zpub'))) {
|
|
|
|
return (
|
|
|
|
<BlueSendButtonIcon
|
|
|
|
onLongPress={sendButtonLongPress}
|
|
|
|
onPress={() => {
|
|
|
|
if (wallet.chain === Chain.OFFCHAIN) {
|
|
|
|
navigate('ScanLndInvoiceRoot', { screen: 'ScanLndInvoice', params: { fromSecret: wallet.getSecret() } });
|
|
|
|
} else {
|
|
|
|
if (wallet.type === WatchOnlyWallet.type && wallet.isHd() && wallet.getSecret().startsWith('zpub')) {
|
|
|
|
if (wallet.useWithHardwareWalletEnabled()) {
|
|
|
|
navigateToSendScreen();
|
|
|
|
} else {
|
|
|
|
Alert.alert(
|
|
|
|
loc.wallets.details_title,
|
|
|
|
loc.transactions.enable_hw,
|
|
|
|
[
|
|
|
|
{
|
|
|
|
text: loc._.ok,
|
|
|
|
onPress: async () => {
|
|
|
|
wallet.setUseWithHardwareWalletEnabled(true);
|
|
|
|
await BlueApp.saveToDisk();
|
|
|
|
navigateToSendScreen();
|
2020-01-01 04:31:04 +01:00
|
|
|
},
|
2020-09-08 18:06:41 +02:00
|
|
|
style: 'default',
|
|
|
|
},
|
2020-01-01 04:31:04 +01:00
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
{ text: loc._.cancel, onPress: () => {}, style: 'cancel' },
|
|
|
|
],
|
|
|
|
{ cancelable: false },
|
|
|
|
);
|
2020-01-01 04:31:04 +01:00
|
|
|
}
|
2020-09-08 18:06:41 +02:00
|
|
|
} else {
|
|
|
|
navigateToSendScreen();
|
2018-10-09 06:25:36 +02:00
|
|
|
}
|
2020-09-08 18:06:41 +02:00
|
|
|
}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
})()}
|
2018-10-09 06:25:36 +02:00
|
|
|
</View>
|
2020-09-08 18:06:41 +02:00
|
|
|
</View>
|
|
|
|
);
|
2019-08-14 05:12:42 +02:00
|
|
|
};
|
2020-07-15 19:32:59 +02:00
|
|
|
|
2020-09-08 18:06:41 +02:00
|
|
|
export default WalletTransactions;
|
|
|
|
|
2020-07-15 19:32:59 +02:00
|
|
|
WalletTransactions.navigationOptions = ({ navigation, route }) => {
|
|
|
|
return {
|
|
|
|
headerRight: () => (
|
|
|
|
<TouchableOpacity
|
|
|
|
disabled={route.params.isLoading === true}
|
|
|
|
style={styles.walletDetails}
|
|
|
|
onPress={() =>
|
|
|
|
navigation.navigate('WalletDetails', {
|
|
|
|
wallet: route.params.wallet,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
>
|
|
|
|
<Icon name="kebab-horizontal" type="octicon" size={22} color="#FFFFFF" />
|
|
|
|
</TouchableOpacity>
|
|
|
|
),
|
|
|
|
headerTitle: () => null,
|
|
|
|
headerStyle: {
|
|
|
|
backgroundColor: WalletGradient.headerColorFor(route.params.wallet.type),
|
|
|
|
borderBottomWidth: 0,
|
|
|
|
elevation: 0,
|
|
|
|
// shadowRadius: 0,
|
|
|
|
shadowOffset: { height: 0, width: 0 },
|
|
|
|
},
|
|
|
|
headerTintColor: '#FFFFFF',
|
|
|
|
headerBackTitleVisible: false,
|
|
|
|
};
|
|
|
|
};
|