Merge pull request #6515 from BlueWallet/loadli

REF: Load WalletLists faster with useEffet
This commit is contained in:
GLaDOS 2024-05-06 10:37:53 +00:00 committed by GitHub
commit faea6142c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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',