mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-15 11:59:21 +01:00
REF: Load WalletLists faster with useEffet
This commit is contained in:
parent
538a1327b6
commit
430e4e34ad
1 changed files with 4 additions and 20 deletions
|
@ -1,4 +1,4 @@
|
||||||
import React, { useCallback, useEffect, useLayoutEffect, useReducer, useRef } from 'react';
|
import React, { useCallback, useEffect, useReducer, useRef } from 'react';
|
||||||
import {
|
import {
|
||||||
View,
|
View,
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
|
@ -166,7 +166,7 @@ const WalletsList: React.FC = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useEffect(() => {
|
||||||
setOptions({
|
setOptions({
|
||||||
navigationBarColor: colors.navigationBarColor,
|
navigationBarColor: colors.navigationBarColor,
|
||||||
headerShown: !isDesktop,
|
headerShown: !isDesktop,
|
||||||
|
@ -176,26 +176,14 @@ const WalletsList: React.FC = () => {
|
||||||
// eslint-disable-next-line react/no-unstable-nested-components
|
// eslint-disable-next-line react/no-unstable-nested-components
|
||||||
headerRight: () =>
|
headerRight: () =>
|
||||||
I18nManager.isRTL ? null : (
|
I18nManager.isRTL ? null : (
|
||||||
<TouchableOpacity
|
<TouchableOpacity accessibilityRole="button" accessibilityLabel={loc._.more} testID="SettingsButton" onPress={navigateToSettings}>
|
||||||
accessibilityRole="button"
|
|
||||||
accessibilityLabel={loc._.more}
|
|
||||||
testID="SettingsButton"
|
|
||||||
style={styles.headerTouch}
|
|
||||||
onPress={navigateToSettings}
|
|
||||||
>
|
|
||||||
<Icon size={22} name="more-horiz" type="material" color={colors.foregroundColor} />
|
<Icon size={22} name="more-horiz" type="material" color={colors.foregroundColor} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
),
|
),
|
||||||
// eslint-disable-next-line react/no-unstable-nested-components
|
// eslint-disable-next-line react/no-unstable-nested-components
|
||||||
headerLeft: () =>
|
headerLeft: () =>
|
||||||
I18nManager.isRTL ? (
|
I18nManager.isRTL ? (
|
||||||
<TouchableOpacity
|
<TouchableOpacity accessibilityRole="button" accessibilityLabel={loc._.more} testID="SettingsButton" onPress={navigateToSettings}>
|
||||||
accessibilityRole="button"
|
|
||||||
accessibilityLabel={loc._.more}
|
|
||||||
testID="SettingsButton"
|
|
||||||
style={styles.headerTouch}
|
|
||||||
onPress={navigateToSettings}
|
|
||||||
>
|
|
||||||
<Icon size={22} name="more-horiz" type="material" color={colors.foregroundColor} />
|
<Icon size={22} name="more-horiz" type="material" color={colors.foregroundColor} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
) : null,
|
) : null,
|
||||||
|
@ -472,10 +460,6 @@ const styles = StyleSheet.create({
|
||||||
walletsListWrapper: {
|
walletsListWrapper: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
headerTouch: {
|
|
||||||
height: 48,
|
|
||||||
paddingVertical: 10,
|
|
||||||
},
|
|
||||||
listHeaderBack: {
|
listHeaderBack: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
|
|
Loading…
Add table
Reference in a new issue