-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathDefiEmptyState.tsx
More file actions
46 lines (41 loc) · 1.52 KB
/
DefiEmptyState.tsx
File metadata and controls
46 lines (41 loc) · 1.52 KB
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
import React from 'react';
import { Image } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import { useAssetFromTheme } from '../../../util/theme';
import { useTailwind } from '@metamask/design-system-twrnc-preset';
import {
TabEmptyState,
type TabEmptyStateProps,
} from '../../../component-library/components-temp/TabEmptyState';
import { strings } from '../../../../locales/i18n';
import Routes from '../../../constants/navigation/Routes';
import emptyStateDefiLight from '../../../images/empty-state-defi-light.png';
import emptyStateDefiDark from '../../../images/empty-state-defi-dark.png';
export interface DefiEmptyStateProps extends TabEmptyStateProps {}
export const DefiEmptyState: React.FC<DefiEmptyStateProps> = (props) => {
const defiImage = useAssetFromTheme(emptyStateDefiLight, emptyStateDefiDark);
const { navigate } = useNavigation();
const tw = useTailwind();
const handleExploreDefi = () => {
// Open the Explore tab on the main feed, then push Sites (root stack).
navigate(Routes.TRENDING_VIEW, {
screen: Routes.TRENDING_FEED,
});
navigate(Routes.SITES_FULL_VIEW);
};
return (
<TabEmptyState
icon={
<Image
source={defiImage}
resizeMode="contain"
style={tw.style('w-[72px] h-[72px]')}
/>
}
description={strings('defi_positions.empty_state.description')}
actionButtonText={strings('defi_positions.empty_state.explore_defi')}
onAction={handleExploreDefi}
{...props}
/>
);
};