-
Notifications
You must be signed in to change notification settings - Fork 587
/
AssetList.js
50 lines (46 loc) · 1.3 KB
/
AssetList.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import lang from 'i18n-js';
import React from 'react';
import { useSafeArea } from 'react-native-safe-area-context';
import { FabWrapperBottomPosition, FloatingActionButtonSize } from '../fab';
import { ListFooter } from '../list';
import EmptyAssetList from './EmptyAssetList';
import RecyclerAssetList from './RecyclerAssetList';
import RecyclerAssetList2 from './RecyclerAssetList2';
const FabSizeWithPadding =
FloatingActionButtonSize + FabWrapperBottomPosition * 2;
const AssetList = ({
hideHeader,
isEmpty,
isLoading,
isWalletEthZero,
network,
scrollViewTracker,
sections,
walletBriefSectionsData,
...props
}) => {
const insets = useSafeArea();
return isEmpty || isLoading ? (
<EmptyAssetList
{...props}
hideHeader={hideHeader}
isLoading={isLoading}
isWalletEthZero={isWalletEthZero}
network={network}
title={lang.t('account.tab_balances')}
/>
) : props.showcase ? (
<RecyclerAssetList
hideHeader={hideHeader}
paddingBottom={
insets.bottom + FabSizeWithPadding - ListFooter.height + (android && 60)
}
scrollViewTracker={scrollViewTracker}
sections={sections}
{...props}
/>
) : (
<RecyclerAssetList2 walletBriefSectionsData={walletBriefSectionsData} />
);
};
export default React.memo(AssetList);