Skip to content

Commit 7f86347

Browse files
committed
Add consent checkbox to submit-report screen
1 parent b0d1e31 commit 7f86347

2 files changed

Lines changed: 25 additions & 5 deletions

File tree

app/mobile/screens/steps/ReportSubmitStep.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import React, {useState} from 'react';
22

33
import PropTypes from 'prop-types';
44

5-
import {useTranslation} from 'react-i18next';
5+
import {useTranslation, Trans} from 'react-i18next';
66

7-
import {StyleSheet, View, ScrollView} from 'react-native';
7+
import {StyleSheet, View, ScrollView, Linking} from 'react-native';
88

9-
import {List, Avatar, Button, Card, Title, Paragraph} from 'react-native-paper';
9+
import {Checkbox, List, Avatar, Button, Card, Title, Paragraph, Text} from 'react-native-paper';
1010

1111
import StepContainer from './StepContainer';
1212

@@ -19,11 +19,18 @@ import InfectionRiskCard from '../../components/InfectionRiskCard';
1919
const styles = StyleSheet.create({
2020
actionButton: ACTION_BUTTON,
2121
actionButtonLabel: ACTION_BUTTON_LABEL,
22+
consentContainer: {
23+
flexDirection: "row",
24+
marginTop: 8,
25+
marginBottom: 8,
26+
width: "90%"
27+
}
2228
});
2329

2430
export default function ReportSubmitStep(props) {
2531
const {t} = useTranslation();
2632
const [isSubmitting, setIsSubmitting] = useState(false);
33+
const [isConsentGiven, setConsentGiven] = useState(false);
2734

2835
const getStateToBeSaved = () => {
2936
const caseReport = {...props.caseReport};
@@ -59,9 +66,21 @@ export default function ReportSubmitStep(props) {
5966
<ReportSummaryCard caseReport={props.caseReport} />
6067
</ScrollView>
6168
</View>
69+
<View style={styles.consentContainer}>
70+
<Checkbox.Android
71+
status={isConsentGiven ? 'checked' : 'unchecked'}
72+
onPress={() => setConsentGiven(!isConsentGiven)}
73+
/>
74+
<Text>
75+
<Trans i18nKey="report.submitReport.consent">
76+
By submitting the report, you accept that your provided information are sent to the Cotect servers for further processing. You can read more in our <Text style={{color: 'blue'}} onPress={() => Linking.openURL('http://google.com')}>privacy policy</Text>.
77+
</Trans>
78+
</Text>
79+
</View>
80+
6281
<Button
6382
mode="outlined"
64-
disabled={isSubmitting}
83+
disabled={!isConsentGiven || isSubmitting}
6584
loading={isSubmitting}
6685
style={styles.actionButton}
6786
labelStyle={styles.actionButtonLabel}

app/mobile/translations/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@
174174
"exitAction": "Exit",
175175
"successText": "We submitted the report! Thanks for your help fighting CoVid!",
176176
"text": "We are submitting the report…",
177-
"title": "Report Submission"
177+
"title": "Report Submission",
178+
"consent": "By submitting the report, you accept that your provided information are sent to the Cotect servers for further processing. You can read more in our <1>privacy policy</1>."
178179
},
179180
"symptoms": {
180181
"title": "Do you have any symptoms?",

0 commit comments

Comments
 (0)