Skip to content

Commit f8fd751

Browse files
committed
Allow for proof verification
Former-commit-id: 95ac2ef Former-commit-id: 7a28a70
1 parent 740bb37 commit f8fd751

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

screens/Partner.js

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as Clipboard from "expo-clipboard";
55
import {
66
onSnapshot,
77
doc,
8+
updateDoc,
89
collection,
910
query,
1011
orderBy,
@@ -174,9 +175,27 @@ const Partner = () => {
174175
<ImageView
175176
images={images}
176177
imageIndex={imageIndex}
177-
onImageIndexChange={setImageIndex}
178178
visible={visible}
179179
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+
)}
180199
/>
181200
</>
182201
);
@@ -259,4 +278,24 @@ const styles = StyleSheet.create({
259278
fontSize: 20,
260279
marginLeft: 14,
261280
},
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+
},
262301
});

0 commit comments

Comments
 (0)