mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 18:00:17 +01:00
Merge pull request #6515 from BlueWallet/loadli
REF: Load WalletLists faster with useEffet
This commit is contained in:
commit
faea6142c8
@ -1,4 +1,4 @@
|
||||
import React, { useCallback, useEffect, useLayoutEffect, useReducer, useRef } from 'react';
|
||||
import React, { useCallback, useEffect, useReducer, useRef } from 'react';
|
||||
import {
|
||||
View,
|
||||
TouchableOpacity,
|
||||
@ -166,7 +166,7 @@ const WalletsList: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
useLayoutEffect(() => {
|
||||
useEffect(() => {
|
||||
setOptions({
|
||||
navigationBarColor: colors.navigationBarColor,
|
||||
headerShown: !isDesktop,
|
||||
@ -176,26 +176,14 @@ const WalletsList: React.FC = () => {
|
||||
// eslint-disable-next-line react/no-unstable-nested-components
|
||||
headerRight: () =>
|
||||
I18nManager.isRTL ? null : (
|
||||
<TouchableOpacity
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={loc._.more}
|
||||
testID="SettingsButton"
|
||||
style={styles.headerTouch}
|
||||
onPress={navigateToSettings}
|
||||
>
|
||||
<TouchableOpacity accessibilityRole="button" accessibilityLabel={loc._.more} testID="SettingsButton" onPress={navigateToSettings}>
|
||||
<Icon size={22} name="more-horiz" type="material" color={colors.foregroundColor} />
|
||||
</TouchableOpacity>
|
||||
),
|
||||
// eslint-disable-next-line react/no-unstable-nested-components
|
||||
headerLeft: () =>
|
||||
I18nManager.isRTL ? (
|
||||
<TouchableOpacity
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={loc._.more}
|
||||
testID="SettingsButton"
|
||||
style={styles.headerTouch}
|
||||
onPress={navigateToSettings}
|
||||
>
|
||||
<TouchableOpacity accessibilityRole="button" accessibilityLabel={loc._.more} testID="SettingsButton" onPress={navigateToSettings}>
|
||||
<Icon size={22} name="more-horiz" type="material" color={colors.foregroundColor} />
|
||||
</TouchableOpacity>
|
||||
) : null,
|
||||
@ -472,10 +460,6 @@ const styles = StyleSheet.create({
|
||||
walletsListWrapper: {
|
||||
flex: 1,
|
||||
},
|
||||
headerTouch: {
|
||||
height: 48,
|
||||
paddingVertical: 10,
|
||||
},
|
||||
listHeaderBack: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
|
Loading…
Reference in New Issue
Block a user