@@ -13,7 +13,6 @@ import {
13
13
Modal ,
14
14
} from "@ui-kitten/components" ;
15
15
import { StyleSheet , View } from "react-native" ;
16
- import { Image } from "expo-image" ;
17
16
import { setStringAsync } from "expo-clipboard" ;
18
17
import Animated , {
19
18
useAnimatedScrollHandler ,
@@ -27,6 +26,8 @@ import { router, Stack } from "expo-router";
27
26
import { SafeAreaView } from "react-native-safe-area-context" ;
28
27
import { CurrencyUtils } from "@ironfish/sdk" ;
29
28
import { CONFIRMATIONS } from "@/data/constants" ;
29
+ import { AssetRow } from "@/components/account/AssetRow" ;
30
+ import { TransactionRow } from "@/components/account/TransactionRow" ;
30
31
31
32
const ReceiveIcon = ( props : IconProps ) => (
32
33
< Icon { ...props } name = "download-outline" />
@@ -309,26 +310,10 @@ export default function Balances() {
309
310
{ selectedIndex === 1 && (
310
311
< >
311
312
{ getTransactionsResult . data ?. map ( ( transaction ) => (
312
- < Card
313
+ < TransactionRow
313
314
key = { transaction . hash }
314
- style = { styles . transactionCard }
315
- onPress = { ( ) =>
316
- router . push (
317
- `/(drawer)/account/transaction/${ transaction . hash } ` ,
318
- )
319
- }
320
- >
321
- < Text category = "s1" > { transaction . type . toString ( ) } </ Text >
322
- < Text category = "p2" appearance = "hint" >
323
- Block: { transaction . block ?. sequence ?? "Pending" }
324
- </ Text >
325
- < Text category = "p2" appearance = "hint" >
326
- { new Date ( transaction . timestamp ) . toLocaleString ( ) }
327
- </ Text >
328
- < Text category = "p2" appearance = "hint" >
329
- Status: { transaction . status . toString ( ) }
330
- </ Text >
331
- </ Card >
315
+ transaction = { transaction }
316
+ />
332
317
) ) }
333
318
</ >
334
319
) }
@@ -342,36 +327,6 @@ export default function Balances() {
342
327
) ;
343
328
}
344
329
345
- function AssetRow ( {
346
- name,
347
- amount,
348
- verified,
349
- image,
350
- } : {
351
- name : string ;
352
- amount : string ;
353
- verified : boolean ;
354
- image ?: string ;
355
- } ) {
356
- return (
357
- < Card style = { styles . assetCard } >
358
- < Layout style = { styles . assetCardContent } >
359
- < Layout style = { styles . assetBadge } >
360
- < Image source = { image } style = { styles . assetBadge } />
361
- </ Layout >
362
- < Layout style = { styles . assetInfo } >
363
- < Text category = "s1" >
364
- { name } { verified ? "(Verified)" : "" }
365
- </ Text >
366
- < Text category = "p2" appearance = "hint" >
367
- { amount }
368
- </ Text >
369
- </ Layout >
370
- </ Layout >
371
- </ Card >
372
- ) ;
373
- }
374
-
375
330
const styles = StyleSheet . create ( {
376
331
container : {
377
332
flex : 1 ,
@@ -412,29 +367,6 @@ const styles = StyleSheet.create({
412
367
actionButton : {
413
368
flexDirection : "column" ,
414
369
} ,
415
- assetBadge : {
416
- width : 40 ,
417
- height : 40 ,
418
- borderRadius : 20 ,
419
- backgroundColor : "#E1E1E1" ,
420
- elevation : 4 ,
421
- shadowColor : "#000" ,
422
- shadowOffset : { width : 0 , height : 2 } ,
423
- shadowOpacity : 0.25 ,
424
- shadowRadius : 4 ,
425
- } ,
426
- assetCard : {
427
- marginVertical : 4 ,
428
- } ,
429
- assetCardContent : {
430
- flexDirection : "row" ,
431
- alignItems : "center" ,
432
- gap : 12 ,
433
- } ,
434
- assetInfo : {
435
- gap : 4 ,
436
- flex : 1 ,
437
- } ,
438
370
syncCard : {
439
371
margin : 16 ,
440
372
marginTop : 0 ,
@@ -450,9 +382,6 @@ const styles = StyleSheet.create({
450
382
flexDirection : "row" ,
451
383
justifyContent : "space-between" ,
452
384
} ,
453
- transactionCard : {
454
- marginVertical : 4 ,
455
- } ,
456
385
backdrop : {
457
386
backgroundColor : "rgba(0, 0, 0, 0.5)" ,
458
387
} ,
0 commit comments