mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-13 11:09:20 +01:00
wip
This commit is contained in:
parent
0bdfc6fa85
commit
ec2bc5e627
2 changed files with 7 additions and 9 deletions
|
@ -13,7 +13,6 @@ import {
|
||||||
Text,
|
Text,
|
||||||
View,
|
View,
|
||||||
Animated,
|
Animated,
|
||||||
RefreshControl,
|
|
||||||
LayoutChangeEvent,
|
LayoutChangeEvent,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { Icon } from '@rneui/themed';
|
import { Icon } from '@rneui/themed';
|
||||||
|
@ -298,7 +297,6 @@ const WalletTransactions: React.FC<WalletTransactionsProps> = ({ route }) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const renderItem = useCallback(
|
const renderItem = useCallback(
|
||||||
// eslint-disable-next-line react/no-unused-prop-types
|
|
||||||
({ item }: { item: Transaction }) => {
|
({ item }: { item: Transaction }) => {
|
||||||
return <TransactionListItem item={item} itemPriceUnit={wallet?.preferredBalanceUnit} walletID={walletID} />;
|
return <TransactionListItem item={item} itemPriceUnit={wallet?.preferredBalanceUnit} walletID={walletID} />;
|
||||||
},
|
},
|
||||||
|
@ -468,6 +466,9 @@ const WalletTransactions: React.FC<WalletTransactionsProps> = ({ route }) => {
|
||||||
setHeaderHeight(height);
|
setHeaderHeight(height);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const refreshProps =
|
||||||
|
!isDesktop && !isElectrumDisabled ? { onRefresh: refreshTransactions, progressViewOffset: headerHeight, refreshing: isLoading } : {};
|
||||||
|
|
||||||
const renderHeader = useCallback(() => {
|
const renderHeader = useCallback(() => {
|
||||||
return (
|
return (
|
||||||
<View style={{ backgroundColor: colors.background }}>
|
<View style={{ backgroundColor: colors.background }}>
|
||||||
|
@ -517,7 +518,8 @@ const WalletTransactions: React.FC<WalletTransactionsProps> = ({ route }) => {
|
||||||
testID="TransactionsListView"
|
testID="TransactionsListView"
|
||||||
contentInsetAdjustmentBehavior="automatic"
|
contentInsetAdjustmentBehavior="automatic"
|
||||||
automaticallyAdjustContentInsets
|
automaticallyAdjustContentInsets
|
||||||
contentContainerStyle={{ backgroundColor: colors.background, marginTop: headerHeight }}
|
automaticallyAdjustsScrollIndicatorInsets
|
||||||
|
contentContainerStyle={{ backgroundColor: colors.background, paddingTop: headerHeight }}
|
||||||
maxToRenderPerBatch={15}
|
maxToRenderPerBatch={15}
|
||||||
onScroll={Animated.event([{ nativeEvent: { contentOffset: { y: scrollY } } }], { useNativeDriver: true, listener: handleScroll })}
|
onScroll={Animated.event([{ nativeEvent: { contentOffset: { y: scrollY } } }], { useNativeDriver: true, listener: handleScroll })}
|
||||||
scrollEventThrottle={16}
|
scrollEventThrottle={16}
|
||||||
|
@ -529,11 +531,7 @@ const WalletTransactions: React.FC<WalletTransactionsProps> = ({ route }) => {
|
||||||
{isLightning() && <Text style={styles.emptyTxsLightning}>{loc.wallets.list_empty_txs2_lightning}</Text>}
|
{isLightning() && <Text style={styles.emptyTxsLightning}>{loc.wallets.list_empty_txs2_lightning}</Text>}
|
||||||
</View>
|
</View>
|
||||||
}
|
}
|
||||||
refreshControl={
|
{...refreshProps}
|
||||||
!isElectrumDisabled && !isDesktop ? (
|
|
||||||
<RefreshControl refreshing={isLoading} onRefresh={() => refreshTransactions(true)} progressViewOffset={headerHeight} />
|
|
||||||
) : undefined
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<FContainer ref={walletActionButtonsRef}>
|
<FContainer ref={walletActionButtonsRef}>
|
||||||
{wallet?.allowReceive() && (
|
{wallet?.allowReceive() && (
|
||||||
|
|
|
@ -758,7 +758,7 @@ describe('BlueWallet UI Tests - import BIP84 wallet', () => {
|
||||||
await waitForId('TransactionsListEmpty');
|
await waitForId('TransactionsListEmpty');
|
||||||
assert.strictEqual(await countElements('TransactionListItem'), 0);
|
assert.strictEqual(await countElements('TransactionListItem'), 0);
|
||||||
|
|
||||||
await element(by.id('TransactionsListView')).swipe('down', 'slow'); // pul-to-refresh
|
await element(by.id('TransactionsListView')).swipe('down', 'slow', 0.5, 0.5); // pul-to-refresh
|
||||||
|
|
||||||
// asserting balance and txs loaded:
|
// asserting balance and txs loaded:
|
||||||
await waitForText('0.00105526'); // the wait inside allows network request to propagate
|
await waitForText('0.00105526'); // the wait inside allows network request to propagate
|
||||||
|
|
Loading…
Add table
Reference in a new issue