@@ -10,24 +10,26 @@ import { Menu } from 'react-native-paper';
10
10
import { AppbarOptions } from '#/Appbar/AppbarOptions' ;
11
11
import { withSuspense } from '#/skeleton/withSuspense' ;
12
12
import { ScreenSkeleton } from '#/skeleton/ScreenSkeleton' ;
13
- import { ScrollableScreenSurface } from '#/layout/ScrollableScreenSurface' ;
14
13
import { z } from 'zod' ;
15
14
import { zHex , zUAddress } from '~/lib/zod' ;
16
15
import { useLocalParams } from '~/hooks/useLocalParams' ;
17
16
import { zodResolver } from '@hookform/resolvers/zod' ;
18
17
import { ListItem } from '#/list/ListItem' ;
19
18
import { CHAINS } from 'chains' ;
20
19
import { View } from 'react-native' ;
21
- import { createStyles } from '@theme/styles' ;
20
+ import { createStyles , useStyles } from '@theme/styles' ;
22
21
import { Button } from '#/Button' ;
23
22
import { ExternalLinkIcon , GenericTokenIcon } from '@theme/icons' ;
24
23
import { ICON_SIZE } from '@theme/paper' ;
25
- import { graphql , ROOT_ID } from 'relay-runtime' ;
24
+ import { graphql } from 'relay-runtime' ;
26
25
import { useLazyLoadQuery } from 'react-relay' ;
27
26
import { useUpsertToken } from '~/hooks/mutations/useUpsertToken' ;
28
27
import { Address_TokenScreenQuery } from '~/api/__generated__/Address_TokenScreenQuery.graphql' ;
29
28
import { useRemoveToken } from '~/hooks/mutations/useRemoveToken' ;
30
- import { useInvalidateQueryOn , useQuery } from '~/api/useQuery' ;
29
+ import { useInvalidateQueryOn } from '~/api/useQuery' ;
30
+ import { Scrollable } from '#/Scrollable' ;
31
+ import { Pane } from '#/layout/Pane' ;
32
+ import { ItemList } from '#/layout/ItemList' ;
31
33
32
34
const PYTH_PRICE_FEEDS_URL = 'https://pyth.network/developers/price-feed-ids' ;
33
35
@@ -68,6 +70,7 @@ const TokenScreenParams = z.object({ address: zUAddress() });
68
70
69
71
function TokenScreen_ ( ) {
70
72
const { address : token } = useLocalParams ( TokenScreenParams ) ;
73
+ const { styles } = useStyles ( stylesheet ) ;
71
74
const router = useRouter ( ) ;
72
75
const chain = asChain ( token ) ;
73
76
@@ -90,7 +93,7 @@ function TokenScreen_() {
90
93
const iconValid = ! ! tryOrIgnore ( ( ) => icon && new URL ( icon ) ) ;
91
94
92
95
return (
93
- < >
96
+ < Pane flex >
94
97
< AppbarOptions
95
98
headline = "Token"
96
99
{ ...( query . token ?. userOwned && {
@@ -110,19 +113,23 @@ function TokenScreen_() {
110
113
} ) }
111
114
/>
112
115
113
- < ScrollableScreenSurface contentContainerStyle = { styles . sheet } >
114
- < ListItem
115
- leading = {
116
- icon && iconValid ? (
117
- < Image source = { [ { uri : icon } ] } style = { styles . icon } />
118
- ) : (
119
- GenericTokenIcon
120
- )
121
- }
122
- headline = { `${ name || 'Token' } (${ symbol || 'TKN' } )` }
123
- supporting = { asAddress ( token ) }
124
- trailing = { CHAINS [ chain ] . name }
125
- />
116
+ < Scrollable contentContainerStyle = { styles . sheet } >
117
+ < ItemList >
118
+ < ListItem
119
+ leading = {
120
+ icon && iconValid ? (
121
+ < Image source = { [ { uri : icon } ] } style = { styles . icon } />
122
+ ) : (
123
+ GenericTokenIcon
124
+ )
125
+ }
126
+ headline = { `${ name || 'Token' } (${ symbol || 'TKN' } )` }
127
+ supporting = { asAddress ( token ) }
128
+ trailing = { CHAINS [ chain ] . name }
129
+ containerStyle = { styles . item }
130
+ />
131
+ </ ItemList >
132
+
126
133
< View style = { styles . fields } >
127
134
< FormTextField label = "Name" name = "name" placeholder = "Token name" control = { control } />
128
135
@@ -167,15 +174,18 @@ function TokenScreen_() {
167
174
{ query . token ? 'Update' : 'Add' }
168
175
</ FormSubmitButton >
169
176
</ Actions >
170
- </ ScrollableScreenSurface >
171
- </ >
177
+ </ Scrollable >
178
+ </ Pane >
172
179
) ;
173
180
}
174
181
175
- const styles = createStyles ( {
182
+ const stylesheet = createStyles ( ( { colors } ) => ( {
176
183
sheet : {
177
184
paddingTop : 8 ,
178
185
} ,
186
+ item : {
187
+ backgroundColor : colors . surface ,
188
+ } ,
179
189
fields : {
180
190
marginVertical : 16 ,
181
191
marginHorizontal : 16 ,
@@ -185,7 +195,7 @@ const styles = createStyles({
185
195
width : ICON_SIZE . medium ,
186
196
height : ICON_SIZE . medium ,
187
197
} ,
188
- } ) ;
198
+ } ) ) ;
189
199
190
200
export default withSuspense ( TokenScreen_ , < ScreenSkeleton /> ) ;
191
201
0 commit comments