1
1
import { useLocalSearchParams , useRouter } from 'expo-router' ;
2
- import { Alert , Image , Pressable , StyleSheet , Text , View } from 'react-native' ;
3
-
2
+ import { Alert , Pressable , StyleSheet , Text , View } from 'react-native' ;
3
+ import FastImage from 'expo-fast-image' ;
4
4
import { GiftIdea } from '@/models/GiftIdea' ;
5
5
6
6
const DetailGiftScreen = ( ) => {
7
7
const router = useRouter ( ) ;
8
- const { id, image, title, description, recipient, selectedDate } =
8
+ const { id, image, title, description, price , recipient, selectedDate } =
9
9
useLocalSearchParams ( ) as unknown as GiftIdea ;
10
10
11
11
const handleEdit = ( ) => {
@@ -16,6 +16,7 @@ const DetailGiftScreen = () => {
16
16
image,
17
17
title,
18
18
description,
19
+ price,
19
20
recipient,
20
21
selectedDate,
21
22
} ,
@@ -39,20 +40,27 @@ const DetailGiftScreen = () => {
39
40
40
41
return (
41
42
< View style = { styles . container } >
42
- < Image source = { { uri : image } } style = { styles . image } />
43
+ < FastImage
44
+ source = { { uri : image } }
45
+ style = { styles . image }
46
+ cacheKey = { id }
47
+ contentFit = "cover"
48
+ />
43
49
< Text style = { styles . title } > { title } </ Text >
44
50
< Text style = { styles . description } > { description } </ Text >
45
- < Text style = { styles . recipient } > For: { recipient } </ Text >
51
+ < Text style = { styles . price } > $ { price } </ Text >
46
52
< Text style = { styles . date } >
47
- Event Date: { new Date ( selectedDate ) . toLocaleDateString ( ) }
53
+ Happening on { new Date ( selectedDate ) . toLocaleDateString ( ) }
48
54
</ Text >
55
+ < Text style = { styles . recipient } > for { recipient } </ Text >
56
+
49
57
< View style = { styles . actions } >
50
- < Pressable style = { styles . editButton } onPress = { handleEdit } >
51
- < Text style = { styles . buttonText } > Edit</ Text >
52
- </ Pressable >
53
58
< Pressable style = { styles . deleteButton } onPress = { handleDelete } >
54
59
< Text style = { styles . buttonText } > Delete</ Text >
55
60
</ Pressable >
61
+ < Pressable style = { styles . editButton } onPress = { handleEdit } >
62
+ < Text style = { styles . buttonText } > Edit</ Text >
63
+ </ Pressable >
56
64
</ View >
57
65
</ View >
58
66
) ;
@@ -64,28 +72,30 @@ const styles = StyleSheet.create({
64
72
backgroundColor : '#FFFFFF' ,
65
73
padding : 16 ,
66
74
} ,
67
- header : {
68
- fontSize : 20 ,
69
- fontWeight : 'bold' ,
70
- color : '#333333' ,
71
- marginBottom : 16 ,
72
- textAlign : 'center' ,
73
- } ,
74
75
image : {
75
76
width : '100%' ,
76
- height : 200 ,
77
- borderRadius : 12 ,
77
+ height : 250 ,
78
+ borderRadius : 16 ,
78
79
marginBottom : 16 ,
80
+ borderWidth : 1 ,
81
+ borderColor : '#f0f0f0' ,
79
82
} ,
80
83
title : {
81
- fontSize : 24 ,
84
+ fontSize : 25 ,
82
85
fontWeight : 'bold' ,
83
86
color : '#333333' ,
84
87
marginBottom : 8 ,
85
88
} ,
86
89
description : {
87
90
fontSize : 16 ,
88
91
color : '#666666' ,
92
+ lineHeight : 24 ,
93
+ marginBottom : 8 ,
94
+ } ,
95
+ price : {
96
+ fontSize : 18 ,
97
+ fontWeight : 'bold' ,
98
+ color : '#28a745' ,
89
99
marginBottom : 8 ,
90
100
} ,
91
101
recipient : {
@@ -95,7 +105,7 @@ const styles = StyleSheet.create({
95
105
} ,
96
106
date : {
97
107
fontSize : 16 ,
98
- color : '#666666 ' ,
108
+ color : '#888888 ' ,
99
109
marginBottom : 16 ,
100
110
} ,
101
111
actions : {
@@ -105,19 +115,29 @@ const styles = StyleSheet.create({
105
115
} ,
106
116
editButton : {
107
117
flex : 1 ,
108
- backgroundColor : '#007BFF ' ,
109
- padding : 12 ,
118
+ backgroundColor : '#ffa200 ' ,
119
+ paddingVertical : 14 ,
110
120
borderRadius : 8 ,
111
121
alignItems : 'center' ,
112
- marginRight : 8 ,
122
+ marginLeft : 8 ,
123
+ shadowColor : '#000' ,
124
+ shadowOffset : { width : 0 , height : 4 } ,
125
+ shadowOpacity : 0.2 ,
126
+ shadowRadius : 6 ,
127
+ elevation : 5 ,
113
128
} ,
114
129
deleteButton : {
115
130
flex : 1 ,
116
131
backgroundColor : '#FF4D4F' ,
117
- padding : 12 ,
132
+ paddingVertical : 14 ,
118
133
borderRadius : 8 ,
119
134
alignItems : 'center' ,
120
- marginLeft : 8 ,
135
+ marginRight : 8 ,
136
+ shadowColor : '#000' ,
137
+ shadowOffset : { width : 0 , height : 4 } ,
138
+ shadowOpacity : 0.2 ,
139
+ shadowRadius : 6 ,
140
+ elevation : 5 ,
121
141
} ,
122
142
buttonText : {
123
143
color : '#FFFFFF' ,
0 commit comments