File tree 1 file changed +40
-1
lines changed
1 file changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import * as Clipboard from "expo-clipboard";
5
5
import {
6
6
onSnapshot ,
7
7
doc ,
8
+ updateDoc ,
8
9
collection ,
9
10
query ,
10
11
orderBy ,
@@ -174,9 +175,27 @@ const Partner = () => {
174
175
< ImageView
175
176
images = { images }
176
177
imageIndex = { imageIndex }
177
- onImageIndexChange = { setImageIndex }
178
178
visible = { visible }
179
179
onRequestClose = { ( ) => setIsVisible ( false ) }
180
+ // footer has verify proof button
181
+ FooterComponent = { ( { imageIndex } ) => (
182
+ < View style = { styles . footerContainer } >
183
+ < TouchableOpacity
184
+ style = { styles . footerButton }
185
+ onPress = { ( ) => {
186
+ updateDoc (
187
+ doc ( db , `users/${ partner } /todos/${ images [ imageIndex ] . id } ` ) ,
188
+ {
189
+ status : "verified" ,
190
+ }
191
+ ) ;
192
+ setIsVisible ( false ) ;
193
+ } }
194
+ >
195
+ < Text style = { styles . footerText } > Verify proof</ Text >
196
+ </ TouchableOpacity >
197
+ </ View >
198
+ ) }
180
199
/>
181
200
</ >
182
201
) ;
@@ -259,4 +278,24 @@ const styles = StyleSheet.create({
259
278
fontSize : 20 ,
260
279
marginLeft : 14 ,
261
280
} ,
281
+ footerContainer : {
282
+ flexDirection : "row" ,
283
+ justifyContent : "center" ,
284
+ alignItems : "center" ,
285
+ height : 50 ,
286
+ backgroundColor : "white" ,
287
+ } ,
288
+ footerButton : {
289
+ height : 40 ,
290
+ borderRadius : 5 ,
291
+ backgroundColor : "#788eec" ,
292
+ width : 150 ,
293
+ alignItems : "center" ,
294
+ justifyContent : "center" ,
295
+ } ,
296
+ footerText : {
297
+ color : "white" ,
298
+ fontSize : 20 ,
299
+ textAlign : "center" ,
300
+ } ,
262
301
} ) ;
You can’t perform that action at this time.
0 commit comments