@@ -23,7 +23,7 @@ export default function Balances() {
23
23
onScroll = { scrollHandler }
24
24
contentContainerStyle = { { flexGrow : 1 } }
25
25
>
26
- < View style = { { flexGrow : 1 } } >
26
+ < View style = { styles . container } >
27
27
< AccountHeader offsetY = { scrollYOffset } />
28
28
29
29
< View style = { styles . contentContainer } >
@@ -40,36 +40,40 @@ function TabsRoot({ defaultTab }: { defaultTab: string }) {
40
40
41
41
return (
42
42
< View >
43
- < View style = { styles . tabList } >
43
+ < View style = { styles . tabContainer } >
44
44
< TouchableOpacity
45
- style = { [ styles . tab , activeTab === "assets" && styles . activeTab ] }
45
+ style = { [
46
+ styles . tabButton ,
47
+ activeTab === "assets" && styles . activeTabButton ,
48
+ ] }
46
49
onPress = { ( ) => setActiveTab ( "assets" ) }
47
50
>
48
- < Text style = { styles . tabText } > Assets</ Text >
51
+ < Text style = { styles . tabButtonText } > Assets</ Text >
49
52
</ TouchableOpacity >
50
53
< TouchableOpacity
51
- style = { [ styles . tab , activeTab === "transactions" && styles . activeTab ] }
54
+ style = { [
55
+ styles . tabButton ,
56
+ activeTab === "transactions" && styles . activeTabButton ,
57
+ ] }
52
58
onPress = { ( ) => setActiveTab ( "transactions" ) }
53
59
>
54
- < Text style = { styles . tabText } > Transactions</ Text >
60
+ < Text style = { styles . tabButtonText } > Transactions</ Text >
55
61
</ TouchableOpacity >
56
62
</ View >
57
63
58
- { activeTab === "assets" && (
59
- < View style = { styles . tabContent } >
60
- < AssetRow />
61
- < AssetRow />
62
- < AssetRow />
63
- < AssetRow />
64
- < AssetRow />
65
- < AssetRow />
66
- </ View >
67
- ) }
68
- { activeTab === "transactions" && (
69
- < View style = { styles . tabContent } >
70
- < BottomSheetDemo />
71
- </ View >
72
- ) }
64
+ < View style = { styles . tabContent } >
65
+ { activeTab === "assets" && (
66
+ < >
67
+ < AssetRow />
68
+ < AssetRow />
69
+ < AssetRow />
70
+ < AssetRow />
71
+ < AssetRow />
72
+ < AssetRow />
73
+ </ >
74
+ ) }
75
+ { activeTab === "transactions" && < BottomSheetDemo /> }
76
+ </ View >
73
77
</ View >
74
78
) ;
75
79
}
@@ -78,26 +82,23 @@ function AccountHeader({ offsetY }: { offsetY: SharedValue<number> }) {
78
82
return (
79
83
< Animated . View style = { { transform : [ { translateY : offsetY } ] } } >
80
84
< View style = { styles . headerTop } >
81
- < Text > ☰</ Text >
85
+ < Text style = { styles . menuIcon } > ☰</ Text >
82
86
< Text style = { styles . headerTitle } > Account 1</ Text >
83
- < Text > ⚙️</ Text >
87
+ < Text style = { styles . settingsIcon } > ⚙️</ Text >
84
88
</ View >
85
- < View style = { styles . headerContent } >
86
- < Text style = { styles . balanceText } > 100.55</ Text >
87
- < Text style = { styles . currencyText } > IRON</ Text >
89
+ < View style = { styles . headerBalance } >
90
+ < Text style = { styles . balanceAmount } > 100.55</ Text >
91
+ < Text style = { styles . balanceCurrency } > IRON</ Text >
88
92
89
93
< View style = { styles . actionButtons } >
90
- < TouchableOpacity style = { styles . iconButton } >
91
- < Text > ↓</ Text >
92
- < Text > Receive</ Text >
94
+ < TouchableOpacity style = { styles . actionButton } >
95
+ < Text style = { styles . actionButtonText } > ↓ Receive</ Text >
93
96
</ TouchableOpacity >
94
- < TouchableOpacity style = { styles . iconButton } >
95
- < Text > ↑</ Text >
96
- < Text > Send</ Text >
97
+ < TouchableOpacity style = { styles . actionButton } >
98
+ < Text style = { styles . actionButtonText } > ↑ Send</ Text >
97
99
</ TouchableOpacity >
98
- < TouchableOpacity style = { styles . iconButton } >
99
- < Text > ⇄</ Text >
100
- < Text > Bridge</ Text >
100
+ < TouchableOpacity style = { styles . actionButton } >
101
+ < Text style = { styles . actionButtonText } > ⇄ Bridge</ Text >
101
102
</ TouchableOpacity >
102
103
</ View >
103
104
</ View >
@@ -111,34 +112,34 @@ function AssetBadge() {
111
112
112
113
function AssetRow ( ) {
113
114
return (
114
- < View style = { styles . card } >
115
- < View style = { styles . assetRow } >
115
+ < TouchableOpacity style = { styles . assetCard } >
116
+ < View style = { styles . assetCardContent } >
116
117
< AssetBadge />
117
- < View >
118
- < Text > $IRON</ Text >
119
- < Text style = { styles . secondaryText } > 100.55</ Text >
118
+ < View style = { styles . assetInfo } >
119
+ < Text style = { styles . assetSymbol } > $IRON</ Text >
120
+ < Text style = { styles . assetAmount } > 100.55</ Text >
120
121
</ View >
121
- < Text > ›</ Text >
122
+ < Text style = { styles . chevron } > ›</ Text >
122
123
</ View >
123
- </ View >
124
+ </ TouchableOpacity >
124
125
) ;
125
126
}
126
127
127
128
function BottomSheetDemo ( ) {
128
- const [ isVisible , setIsVisible ] = useState ( false ) ;
129
+ const [ open , setOpen ] = useState ( false ) ;
129
130
130
131
return (
131
- < View style = { styles . bottomSheetDemo } >
132
+ < View >
132
133
< TouchableOpacity
133
- style = { styles . button }
134
- onPress = { ( ) => setIsVisible ( true ) }
134
+ style = { styles . sheetButton }
135
+ onPress = { ( ) => setOpen ( true ) }
135
136
>
136
- < Text style = { styles . buttonText } > Show Bottom Sheet</ Text >
137
+ < Text > Show Bottom Sheet</ Text >
137
138
</ TouchableOpacity >
138
139
139
- { isVisible && (
140
+ { open && (
140
141
< View style = { styles . bottomSheet } >
141
- < AccountSyncingDetails onClose = { ( ) => setIsVisible ( false ) } />
142
+ < AccountSyncingDetails onClose = { ( ) => setOpen ( false ) } />
142
143
</ View >
143
144
) }
144
145
</ View >
@@ -147,127 +148,149 @@ function BottomSheetDemo() {
147
148
148
149
function AccountSyncingDetails ( { onClose } : { onClose : ( ) => void } ) {
149
150
return (
150
- < View >
151
- < Text style = { styles . secondaryText } >
151
+ < View style = { styles . syncDetails } >
152
+ < Text style = { styles . syncText } >
152
153
The blockchain is currently syncing with your accounts. Your balance may
153
154
be inaccurate and sending transactions will be disabled until the sync
154
155
is done.
155
156
</ Text >
156
- < View style = { styles . syncDetails } >
157
- < View >
158
- < Text style = { styles . secondaryText } > Node Status:</ Text >
159
- < Text style = { styles . detailText } > Syncing Blocks</ Text >
157
+
158
+ < View style = { styles . syncStats } >
159
+ < View style = { styles . syncRow } >
160
+ < Text style = { styles . syncLabel } > Node Status:</ Text >
161
+ < Text style = { styles . syncValue } > Syncing Blocks</ Text >
160
162
</ View >
161
- < View >
162
- < Text style = { styles . secondaryText } > Progress:</ Text >
163
- < Text style = { styles . detailText } > 42.3%</ Text >
163
+ < View style = { styles . syncRow } >
164
+ < Text style = { styles . syncLabel } > Progress:</ Text >
165
+ < Text style = { styles . syncValue } > 42.3%</ Text >
164
166
</ View >
165
- < View >
166
- < Text style = { styles . secondaryText } > Blocks Scanned:</ Text >
167
- < Text style = { styles . detailText } > 33645/74346</ Text >
167
+ < View style = { styles . syncRow } >
168
+ < Text style = { styles . syncLabel } > Blocks Scanned:</ Text >
169
+ < Text style = { styles . syncValue } > 33645/74346</ Text >
168
170
</ View >
169
171
</ View >
170
- < TouchableOpacity style = { styles . button } onPress = { onClose } >
171
- < Text style = { styles . buttonText } > Close</ Text >
172
+
173
+ < TouchableOpacity style = { styles . closeButton } onPress = { onClose } >
174
+ < Text > Close</ Text >
172
175
</ TouchableOpacity >
173
176
</ View >
174
177
) ;
175
178
}
176
179
177
180
const styles = StyleSheet . create ( {
181
+ container : {
182
+ flex : 1 ,
183
+ } ,
178
184
contentContainer : {
185
+ flex : 1 ,
179
186
backgroundColor : "#fff" ,
180
- flexGrow : 1 ,
181
- borderTopLeftRadius : 20 ,
182
- borderTopRightRadius : 20 ,
187
+ borderTopLeftRadius : 16 ,
188
+ borderTopRightRadius : 16 ,
183
189
} ,
184
- tabList : {
190
+ tabContainer : {
185
191
flexDirection : "row" ,
186
192
borderBottomWidth : 1 ,
187
- borderBottomColor : "#eee " ,
193
+ borderBottomColor : "#E1E1E1 " ,
188
194
} ,
189
- tab : {
195
+ tabButton : {
190
196
flex : 1 ,
191
197
padding : 16 ,
192
198
alignItems : "center" ,
193
199
} ,
194
- activeTab : {
200
+ activeTabButton : {
195
201
borderBottomWidth : 2 ,
196
202
borderBottomColor : "#000" ,
197
203
} ,
198
- tabText : {
204
+ tabButtonText : {
199
205
fontSize : 16 ,
200
206
} ,
201
207
tabContent : {
202
208
padding : 16 ,
203
- paddingBottom : 64 ,
209
+ paddingBottom : 24 ,
204
210
gap : 16 ,
205
211
} ,
206
212
headerTop : {
207
213
flexDirection : "row" ,
208
- alignItems : "center" ,
209
214
padding : 16 ,
210
215
paddingVertical : 24 ,
216
+ alignItems : "center" ,
217
+ } ,
218
+ menuIcon : {
219
+ fontSize : 24 ,
211
220
} ,
212
221
headerTitle : {
213
222
flex : 1 ,
214
223
textAlign : "center" ,
215
- fontSize : 18 ,
224
+ fontSize : 20 ,
225
+ fontWeight : "600" ,
226
+ } ,
227
+ settingsIcon : {
228
+ fontSize : 24 ,
216
229
} ,
217
- headerContent : {
230
+ headerBalance : {
218
231
alignItems : "center" ,
232
+ gap : 8 ,
219
233
} ,
220
- balanceText : {
221
- fontSize : 32 ,
234
+ balanceAmount : {
235
+ fontSize : 24 ,
236
+ fontWeight : "600" ,
222
237
} ,
223
- currencyText : {
224
- fontSize : 18 ,
238
+ balanceCurrency : {
239
+ fontSize : 16 ,
225
240
} ,
226
241
actionButtons : {
227
242
flexDirection : "row" ,
228
243
padding : 24 ,
229
244
gap : 16 ,
230
245
} ,
231
- iconButton : {
246
+ actionButton : {
232
247
alignItems : "center" ,
233
- gap : 8 ,
234
248
} ,
235
- assetBadge : {
236
- backgroundColor : "pink" ,
237
- height : 48 ,
238
- width : 48 ,
239
- borderRadius : 24 ,
249
+ actionButtonText : {
250
+ fontSize : 16 ,
240
251
} ,
241
- card : {
242
- backgroundColor : "#fff" ,
243
- padding : 16 ,
244
- borderRadius : 8 ,
252
+ assetBadge : {
253
+ width : 40 ,
254
+ height : 40 ,
255
+ borderRadius : 20 ,
256
+ backgroundColor : "#E1E1E1" ,
257
+ elevation : 4 ,
245
258
shadowColor : "#000" ,
246
259
shadowOffset : { width : 0 , height : 2 } ,
247
- shadowOpacity : 0.1 ,
260
+ shadowOpacity : 0.25 ,
248
261
shadowRadius : 4 ,
249
- elevation : 2 ,
250
262
} ,
251
- assetRow : {
263
+ assetCard : {
264
+ borderWidth : 1 ,
265
+ borderColor : "#E1E1E1" ,
266
+ borderRadius : 8 ,
267
+ padding : 16 ,
268
+ backgroundColor : "#fff" ,
269
+ } ,
270
+ assetCardContent : {
252
271
flexDirection : "row" ,
253
272
alignItems : "center" ,
254
273
gap : 12 ,
255
274
} ,
256
- secondaryText : {
275
+ assetInfo : {
276
+ gap : 4 ,
277
+ } ,
278
+ assetSymbol : {
279
+ fontSize : 16 ,
280
+ fontWeight : "500" ,
281
+ } ,
282
+ assetAmount : {
283
+ fontSize : 14 ,
257
284
color : "#666" ,
258
285
} ,
259
- bottomSheetDemo : {
260
- gap : 8 ,
286
+ chevron : {
287
+ marginLeft : "auto" ,
288
+ fontSize : 20 ,
261
289
} ,
262
- button : {
263
- backgroundColor : "#000" ,
290
+ sheetButton : {
264
291
padding : 16 ,
265
- borderRadius : 8 ,
266
292
alignItems : "center" ,
267
293
} ,
268
- buttonText : {
269
- color : "#fff" ,
270
- } ,
271
294
bottomSheet : {
272
295
position : "absolute" ,
273
296
bottom : 0 ,
@@ -277,17 +300,34 @@ const styles = StyleSheet.create({
277
300
padding : 16 ,
278
301
borderTopLeftRadius : 16 ,
279
302
borderTopRightRadius : 16 ,
303
+ elevation : 8 ,
280
304
shadowColor : "#000" ,
281
305
shadowOffset : { width : 0 , height : - 2 } ,
282
- shadowOpacity : 0.1 ,
306
+ shadowOpacity : 0.25 ,
283
307
shadowRadius : 4 ,
284
308
} ,
285
309
syncDetails : {
286
- marginTop : 32 ,
287
- marginBottom : 80 ,
288
310
gap : 16 ,
289
311
} ,
290
- detailText : {
291
- fontSize : 18 ,
312
+ syncText : {
313
+ color : "#666" ,
314
+ } ,
315
+ syncStats : {
316
+ gap : 16 ,
317
+ marginVertical : 24 ,
318
+ } ,
319
+ syncRow : {
320
+ flexDirection : "row" ,
321
+ justifyContent : "space-between" ,
322
+ } ,
323
+ syncLabel : {
324
+ color : "#666" ,
325
+ } ,
326
+ syncValue : {
327
+ fontWeight : "500" ,
328
+ } ,
329
+ closeButton : {
330
+ padding : 16 ,
331
+ alignItems : "center" ,
292
332
} ,
293
333
} ) ;
0 commit comments