Commit bef7ca4 1 parent 145d162 commit bef7ca4 Copy full SHA for bef7ca4
File tree 4 files changed +15
-18
lines changed
components/ProfileScreen/DefaultPaymentTokenScreen
4 files changed +15
-18
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { setSearchText } from '@/store/defaultPaymentTokenScreen';
7
7
import { useAppDispatch , useAppSelector } from '@/store/hooks' ;
8
8
import { setDefaultPaymentToken } from '@/store/secureStore' ;
9
9
import { Trans , useLingui } from '@lingui/react/macro' ;
10
- import { Sx , Text , View } from 'dripsy' ;
10
+ import { ScrollView , Sx , Text } from 'dripsy' ;
11
11
import { Check , Search } from 'lucide-react-native' ;
12
12
import useFilteredAssets from './useFilteredAssets' ;
13
13
import TextInputIconStartAdornment from '@/components/TextInputIconStartAdornment' ;
@@ -20,7 +20,7 @@ export default function DefaultPaymentTokenScreen() {
20
20
const { t } = useLingui ( ) ;
21
21
22
22
return (
23
- < View sx = { sx . root } >
23
+ < ScrollView contentContainerSx = { sx . root } >
24
24
< Text variant = 'h4' >
25
25
< Trans > Default payment token</ Trans >
26
26
</ Text >
@@ -49,7 +49,7 @@ export default function DefaultPaymentTokenScreen() {
49
49
/>
50
50
) ) }
51
51
</ List >
52
- </ View >
52
+ </ ScrollView >
53
53
) ;
54
54
}
55
55
Original file line number Diff line number Diff line change 1
1
import { useAppSelector } from '@/store/hooks' ;
2
- import ASSETS from './assets' ;
2
+ import { PENUMBRA_CHAIN_ID } from '@/utils/constants' ;
3
+ import { ChainRegistryClient } from '@penumbra-labs/registry' ;
3
4
import { useMemo } from 'react' ;
4
5
6
+ /**
7
+ * @todo : Use remote client? (To avoid having to update the app just to get the
8
+ * latest metadatas.)
9
+ */
10
+ const ALL_METADATAS = new ChainRegistryClient ( ) . bundled . get ( PENUMBRA_CHAIN_ID ) . getAllAssets ( ) ;
11
+
5
12
/**
6
13
* Returns asset types filtered by the search text from state.
7
14
*
@@ -14,11 +21,11 @@ export default function useFilteredAssets() {
14
21
15
22
const filteredAssets = useMemo (
16
23
( ) =>
17
- ASSETS . filter ( asset => {
24
+ ALL_METADATAS . filter ( metadata => {
18
25
const searchTextLowerCase = searchText . toLocaleLowerCase ( ) ;
19
26
20
- if ( asset . name . toLocaleLowerCase ( ) . includes ( searchTextLowerCase ) ) return true ;
21
- if ( asset . symbol . toLocaleLowerCase ( ) . includes ( searchTextLowerCase ) ) return true ;
27
+ if ( metadata . name . toLocaleLowerCase ( ) . includes ( searchTextLowerCase ) ) return true ;
28
+ if ( metadata . symbol . toLocaleLowerCase ( ) . includes ( searchTextLowerCase ) ) return true ;
22
29
23
30
return false ;
24
31
} ) ,
Original file line number Diff line number Diff line change
1
+ export const PENUMBRA_CHAIN_ID = 'penumbra-1' ;
You can’t perform that action at this time.
0 commit comments