Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 6385fa2

Browse files
committed
feat: add recipient addition functionality and update Recipient model
1 parent c8ae8b4 commit 6385fa2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/app/recipients/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,24 @@ import {
88
View,
99
} from 'react-native';
1010
import { SafeAreaView } from 'react-native-safe-area-context';
11+
import { useRouter } from 'expo-router';
1112

1213
import { Recipient } from '@/models/Recipient';
1314

1415
const AllRecipientsScreen = () => {
16+
const router = useRouter();
17+
1518
const recipients: Recipient[] = [
1619
{ id: '1', name: 'Alex', budget: 2000, spent: 1500 },
1720
{ id: '2', name: 'Emily', budget: 2200, spent: 1600 },
1821
{ id: '3', name: 'Michael', budget: 3000, spent: 1500 },
1922
{ id: '4', name: 'Malow', budget: 1800, spent: 1200 },
2023
];
2124

25+
const handleAddRecipient = () => {
26+
router.push('/recipients/add-recipient');
27+
}
28+
2229
return (
2330
<SafeAreaView style={styles.container}>
2431
<View style={styles.header}>
@@ -35,7 +42,7 @@ const AllRecipientsScreen = () => {
3542
placeholderTextColor="#666"
3643
/>
3744
</View>
38-
<Pressable style={styles.addButton}>
45+
<Pressable style={styles.addButton} onPress={handleAddRecipient}>
3946
<Text style={styles.addButtonText}>Add</Text>
4047
</Pressable>
4148
</View>

src/models/Recipient.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export interface Recipient {
22
id: string;
3+
// image: string;
34
name: string;
45
budget: number;
56
spent: number;

0 commit comments

Comments
 (0)