11import { 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' ;
44import { GiftIdea } from '@/models/GiftIdea' ;
55
66const DetailGiftScreen = ( ) => {
77 const router = useRouter ( ) ;
8- const { id, image, title, description, recipient, selectedDate } =
8+ const { id, image, title, description, price , recipient, selectedDate } =
99 useLocalSearchParams ( ) as unknown as GiftIdea ;
1010
1111 const handleEdit = ( ) => {
@@ -16,6 +16,7 @@ const DetailGiftScreen = () => {
1616 image,
1717 title,
1818 description,
19+ price,
1920 recipient,
2021 selectedDate,
2122 } ,
@@ -39,20 +40,27 @@ const DetailGiftScreen = () => {
3940
4041 return (
4142 < 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+ />
4349 < Text style = { styles . title } > { title } </ Text >
4450 < Text style = { styles . description } > { description } </ Text >
45- < Text style = { styles . recipient } > For: { recipient } </ Text >
51+ < Text style = { styles . price } > $ { price } </ Text >
4652 < Text style = { styles . date } >
47- Event Date: { new Date ( selectedDate ) . toLocaleDateString ( ) }
53+ Happening on { new Date ( selectedDate ) . toLocaleDateString ( ) }
4854 </ Text >
55+ < Text style = { styles . recipient } > for { recipient } </ Text >
56+
4957 < View style = { styles . actions } >
50- < Pressable style = { styles . editButton } onPress = { handleEdit } >
51- < Text style = { styles . buttonText } > Edit</ Text >
52- </ Pressable >
5358 < Pressable style = { styles . deleteButton } onPress = { handleDelete } >
5459 < Text style = { styles . buttonText } > Delete</ Text >
5560 </ Pressable >
61+ < Pressable style = { styles . editButton } onPress = { handleEdit } >
62+ < Text style = { styles . buttonText } > Edit</ Text >
63+ </ Pressable >
5664 </ View >
5765 </ View >
5866 ) ;
@@ -64,28 +72,30 @@ const styles = StyleSheet.create({
6472 backgroundColor : '#FFFFFF' ,
6573 padding : 16 ,
6674 } ,
67- header : {
68- fontSize : 20 ,
69- fontWeight : 'bold' ,
70- color : '#333333' ,
71- marginBottom : 16 ,
72- textAlign : 'center' ,
73- } ,
7475 image : {
7576 width : '100%' ,
76- height : 200 ,
77- borderRadius : 12 ,
77+ height : 250 ,
78+ borderRadius : 16 ,
7879 marginBottom : 16 ,
80+ borderWidth : 1 ,
81+ borderColor : '#f0f0f0' ,
7982 } ,
8083 title : {
81- fontSize : 24 ,
84+ fontSize : 25 ,
8285 fontWeight : 'bold' ,
8386 color : '#333333' ,
8487 marginBottom : 8 ,
8588 } ,
8689 description : {
8790 fontSize : 16 ,
8891 color : '#666666' ,
92+ lineHeight : 24 ,
93+ marginBottom : 8 ,
94+ } ,
95+ price : {
96+ fontSize : 18 ,
97+ fontWeight : 'bold' ,
98+ color : '#28a745' ,
8999 marginBottom : 8 ,
90100 } ,
91101 recipient : {
@@ -95,7 +105,7 @@ const styles = StyleSheet.create({
95105 } ,
96106 date : {
97107 fontSize : 16 ,
98- color : '#666666 ' ,
108+ color : '#888888 ' ,
99109 marginBottom : 16 ,
100110 } ,
101111 actions : {
@@ -105,19 +115,29 @@ const styles = StyleSheet.create({
105115 } ,
106116 editButton : {
107117 flex : 1 ,
108- backgroundColor : '#007BFF ' ,
109- padding : 12 ,
118+ backgroundColor : '#ffa200 ' ,
119+ paddingVertical : 14 ,
110120 borderRadius : 8 ,
111121 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 ,
113128 } ,
114129 deleteButton : {
115130 flex : 1 ,
116131 backgroundColor : '#FF4D4F' ,
117- padding : 12 ,
132+ paddingVertical : 14 ,
118133 borderRadius : 8 ,
119134 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 ,
121141 } ,
122142 buttonText : {
123143 color : '#FFFFFF' ,
0 commit comments