|
1 |
| -import { Text, View } from 'react-native'; |
| 1 | +import { Ionicons } from '@expo/vector-icons'; |
| 2 | +import { useNavigation } from 'expo-router'; |
| 3 | +import { useState } from 'react'; |
| 4 | +import { |
| 5 | + Pressable, |
| 6 | + ScrollView, |
| 7 | + StyleSheet, |
| 8 | + Text, |
| 9 | + TextInput, |
| 10 | + View, |
| 11 | +} from 'react-native'; |
2 | 12 |
|
3 | 13 | const AddGiftScreen = () => {
|
| 14 | + const navigation = useNavigation(); |
| 15 | + const [title, setTitle] = useState(''); |
| 16 | + const [description, setDescription] = useState(''); |
| 17 | + const [recipient, setRecipient] = useState(''); |
| 18 | + const [selectedDate, setSelectedDate] = useState(new Date()); |
| 19 | + |
| 20 | + const handleAddGift = () => { |
| 21 | + console.log({ title, description, recipient, selectedDate }); |
| 22 | + navigation.goBack(); |
| 23 | + }; |
| 24 | + |
4 | 25 | return (
|
5 |
| - <View> |
6 |
| - <Text>Add Recipient Screen</Text> |
| 26 | + <View style={styles.container}> |
| 27 | + <ScrollView style={styles.scrollView}> |
| 28 | + <View style={styles.inputGroup}> |
| 29 | + <Text style={styles.label}>Title</Text> |
| 30 | + <TextInput |
| 31 | + style={styles.input} |
| 32 | + placeholder="Enter title" |
| 33 | + value={title} |
| 34 | + onChangeText={setTitle} |
| 35 | + /> |
| 36 | + </View> |
| 37 | + |
| 38 | + <View style={styles.inputGroup}> |
| 39 | + <Text style={styles.label}>Description</Text> |
| 40 | + <TextInput |
| 41 | + style={[styles.input, styles.textArea]} |
| 42 | + placeholder="Enter description" |
| 43 | + value={description} |
| 44 | + onChangeText={setDescription} |
| 45 | + multiline |
| 46 | + numberOfLines={4} |
| 47 | + /> |
| 48 | + </View> |
| 49 | + |
| 50 | + <View style={styles.inputGroup}> |
| 51 | + <Text style={styles.label}>Image</Text> |
| 52 | + <Pressable style={styles.uploadButton}> |
| 53 | + <Ionicons name="cloud-upload-outline" size={24} color="#666" /> |
| 54 | + <Text style={styles.uploadText}>Upload Image</Text> |
| 55 | + </Pressable> |
| 56 | + </View> |
| 57 | + |
| 58 | + <View style={styles.inputGroup}> |
| 59 | + <Text style={styles.label}>Choose Recipient</Text> |
| 60 | + <Pressable style={styles.select}> |
| 61 | + <Text style={styles.selectText}>Choose Recipient</Text> |
| 62 | + <Ionicons name="chevron-down" size={24} color="#666" /> |
| 63 | + </Pressable> |
| 64 | + </View> |
| 65 | + |
| 66 | + <View style={styles.inputGroup}> |
| 67 | + <Text style={styles.label}>Choose Time Event</Text> |
| 68 | + <Pressable style={styles.select}> |
| 69 | + <Text style={styles.selectText}>Choose time</Text> |
| 70 | + <Ionicons name="chevron-down" size={24} color="#666" /> |
| 71 | + </Pressable> |
| 72 | + </View> |
| 73 | + |
| 74 | + <Pressable style={styles.addButton} onPress={handleAddGift}> |
| 75 | + <Text style={styles.addButtonText}>Add Gift Idea</Text> |
| 76 | + </Pressable> |
| 77 | + |
| 78 | + <Pressable |
| 79 | + style={styles.cancelButton} |
| 80 | + onPress={() => navigation.goBack()} |
| 81 | + > |
| 82 | + <Text style={styles.cancelButtonText}>Cancel</Text> |
| 83 | + </Pressable> |
| 84 | + </ScrollView> |
7 | 85 | </View>
|
8 | 86 | );
|
9 | 87 | };
|
10 | 88 |
|
| 89 | +const styles = StyleSheet.create({ |
| 90 | + container: { |
| 91 | + flex: 1, |
| 92 | + backgroundColor: '#F8F9FA', |
| 93 | + paddingVertical: 16, |
| 94 | + }, |
| 95 | + scrollView: { |
| 96 | + flex: 1, |
| 97 | + padding: 16, |
| 98 | + }, |
| 99 | + header: { |
| 100 | + fontSize: 24, |
| 101 | + fontWeight: '600', |
| 102 | + marginBottom: 24, |
| 103 | + color: '#333333', |
| 104 | + }, |
| 105 | + inputGroup: { |
| 106 | + marginBottom: 20, |
| 107 | + }, |
| 108 | + label: { |
| 109 | + fontSize: 16, |
| 110 | + color: '#666666', |
| 111 | + marginBottom: 8, |
| 112 | + }, |
| 113 | + input: { |
| 114 | + backgroundColor: 'white', |
| 115 | + borderRadius: 8, |
| 116 | + padding: 12, |
| 117 | + fontSize: 16, |
| 118 | + borderWidth: 1, |
| 119 | + borderColor: '#DDDDDD', |
| 120 | + }, |
| 121 | + textArea: { |
| 122 | + height: 100, |
| 123 | + textAlignVertical: 'top', |
| 124 | + }, |
| 125 | + uploadButton: { |
| 126 | + backgroundColor: 'white', |
| 127 | + borderRadius: 8, |
| 128 | + padding: 12, |
| 129 | + flexDirection: 'row', |
| 130 | + alignItems: 'center', |
| 131 | + justifyContent: 'center', |
| 132 | + borderWidth: 1, |
| 133 | + borderColor: '#DDDDDD', |
| 134 | + }, |
| 135 | + uploadText: { |
| 136 | + marginLeft: 8, |
| 137 | + fontSize: 16, |
| 138 | + color: '#666666', |
| 139 | + }, |
| 140 | + select: { |
| 141 | + backgroundColor: 'white', |
| 142 | + borderRadius: 8, |
| 143 | + padding: 12, |
| 144 | + flexDirection: 'row', |
| 145 | + alignItems: 'center', |
| 146 | + justifyContent: 'space-between', |
| 147 | + borderWidth: 1, |
| 148 | + borderColor: '#DDDDDD', |
| 149 | + }, |
| 150 | + selectText: { |
| 151 | + fontSize: 16, |
| 152 | + color: '#666666', |
| 153 | + }, |
| 154 | + addButton: { |
| 155 | + backgroundColor: '#4B6BFB', |
| 156 | + borderRadius: 8, |
| 157 | + padding: 16, |
| 158 | + alignItems: 'center', |
| 159 | + marginTop: 24, |
| 160 | + }, |
| 161 | + addButtonText: { |
| 162 | + color: 'white', |
| 163 | + fontSize: 16, |
| 164 | + fontWeight: '600', |
| 165 | + }, |
| 166 | + cancelButton: { |
| 167 | + backgroundColor: '#F8F9FA', |
| 168 | + borderRadius: 8, |
| 169 | + padding: 16, |
| 170 | + alignItems: 'center', |
| 171 | + marginTop: 12, |
| 172 | + }, |
| 173 | + cancelButtonText: { |
| 174 | + color: '#666666', |
| 175 | + fontSize: 16, |
| 176 | + }, |
| 177 | +}); |
| 178 | + |
11 | 179 | export default AddGiftScreen;
|
0 commit comments