@@ -6,25 +6,26 @@ import {
6
6
Text ,
7
7
TextInput ,
8
8
View ,
9
+ Image ,
9
10
} from 'react-native' ;
10
11
import { SafeAreaView } from 'react-native-safe-area-context' ;
11
12
import { useRouter } from 'expo-router' ;
12
13
13
14
import { Recipient } from '@/models/Recipient' ;
14
15
15
16
const AllRecipientsScreen = ( ) => {
16
- const router = useRouter ( ) ;
17
-
17
+ const router = useRouter ( ) ;
18
+
18
19
const recipients : Recipient [ ] = [
19
- { id : '1' , name : 'Alex' , budget : 2000 , spent : 1500 } ,
20
- { id : '2' , name : 'Emily' , budget : 2200 , spent : 1600 } ,
21
- { id : '3' , name : 'Michael' , budget : 3000 , spent : 1500 } ,
22
- { id : '4' , name : 'Malow' , budget : 1800 , spent : 1200 } ,
20
+ { id : '1' , image : 'https://img.freepik.com/premium-vector/cute-boy-smiling-cartoon-kawaii-boy-illustration-boy-avatar-happy-kid_1001605-3445.jpg' , name : 'Alex' , budget : 2000 , spent : 1500 } ,
21
+ { id : '2' , image : 'https://static.vecteezy.com/system/resources/previews/004/899/833/non_2x/beautiful-girl-with-blue-hair-avatar-of-woman-for-social-network-vector.jpg' , name : 'Emily' , budget : 2200 , spent : 1600 } ,
22
+ { id : '3' , image : 'https://img.freepik.com/premium-vector/boy-with-blue-hoodie-blue-hoodie-with-hoodie-it_1230457-42660.jpg' , name : 'Michael' , budget : 3000 , spent : 1500 } ,
23
+ { id : '4' , image : 'https://img.freepik.com/premium-vector/boy-with-hoodie-that-says-hes-boy_1230457-43316.jpg' , name : 'Malow' , budget : 1800 , spent : 1200 } ,
23
24
] ;
24
25
25
26
const handleAddRecipient = ( ) => {
26
27
router . push ( '/recipients/add-recipient' ) ;
27
- }
28
+ } ;
28
29
29
30
return (
30
31
< SafeAreaView style = { styles . container } >
@@ -52,9 +53,15 @@ const AllRecipientsScreen = () => {
52
53
< ScrollView style = { styles . scrollView } >
53
54
{ recipients . map ( ( recipient ) => (
54
55
< Pressable key = { recipient . id } style = { styles . recipientCard } >
55
- < Text style = { styles . recipientName } > { recipient . name } </ Text >
56
- < Text style = { styles . budgetText } > Budget: ${ recipient . budget } </ Text >
57
- < Text style = { styles . spentText } > Spent: ${ recipient . spent } </ Text >
56
+ < Image
57
+ source = { { uri : recipient . image } }
58
+ style = { styles . recipientImage }
59
+ />
60
+ < View style = { styles . recipientContent } >
61
+ < Text style = { styles . recipientName } > { recipient . name } </ Text >
62
+ < Text style = { styles . budgetText } > Budget: ${ recipient . budget } </ Text >
63
+ < Text style = { styles . spentText } > Spent: ${ recipient . spent } </ Text >
64
+ </ View >
58
65
</ Pressable >
59
66
) ) }
60
67
</ ScrollView >
@@ -121,12 +128,22 @@ const styles = StyleSheet.create({
121
128
shadowOpacity : 0.1 ,
122
129
shadowRadius : 4 ,
123
130
elevation : 2 ,
131
+ flexDirection : 'row' ,
132
+ alignItems : 'center' ,
133
+ } ,
134
+ recipientImage : {
135
+ width : 60 ,
136
+ height : 60 ,
137
+ borderRadius : 8 ,
138
+ } ,
139
+ recipientContent : {
140
+ marginLeft : 12 ,
141
+ flex : 1 ,
124
142
} ,
125
143
recipientName : {
126
144
fontSize : 18 ,
127
145
fontWeight : '600' ,
128
146
color : '#333333' ,
129
- marginBottom : 8 ,
130
147
} ,
131
148
budgetText : {
132
149
fontSize : 14 ,
0 commit comments