Skip to content

Commit b9e98c3

Browse files
authored
Merge pull request #54 from aws-samples/feature/add-consent-modal
Add consent modal
2 parents 9f82312 + 9d16374 commit b9e98c3

File tree

4 files changed

+57
-1
lines changed

4 files changed

+57
-1
lines changed

src/cfn/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Globals:
1414
MIN_CONFIDENCE: !Ref MinConfidence
1515
OBJECTS_OF_INTEREST_LABELS: !Join [",", !Ref ObjectsOfInterestLabels]
1616
REGION: !Ref AWS::Region
17-
VERSION: '2.1'
17+
VERSION: '2.2'
1818
Api:
1919
EndpointConfiguration: REGIONAL
2020
Cors:

src/web-ui/src/App.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import CameraHelp from "./components/CameraHelp";
1010
import EngagementSummary from "./components/EngagementsSummary";
1111
import Header from "./components/Header";
1212
import SettingsHelp from "./components/SettingsHelp";
13+
import ConsentModal from "./components/ConsentModal";
1314

1415
const App = () => {
1516
const [authState, setAuthState] = useState(undefined);
@@ -69,6 +70,7 @@ const App = () => {
6970
signedIn={signedIn}
7071
toggleRekognition={toggleRekognition}
7172
/>
73+
<ConsentModal></ConsentModal>
7274
{signedIn ? (
7375
<>
7476
<SettingsHelp show={!window.rekognitionSettings} />
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React from "react";
2+
import { Button, Modal } from "react-bootstrap";
3+
import useLocalStorage from "../hooks/useLocalStorage";
4+
5+
const ConsentModal = () => {
6+
const [hasConsent, setHasConsent] = useLocalStorage(
7+
"rekognitionVirtualProctorConsent",
8+
false
9+
);
10+
11+
const onClick = () => {
12+
setHasConsent(true);
13+
};
14+
15+
return (
16+
<Modal show={!hasConsent} backdrop="static" centered>
17+
<Modal.Header>
18+
<Modal.Title>Notice</Modal.Title>
19+
</Modal.Header>
20+
<Modal.Body>
21+
This feature uses Amazon Web Services. Biometric identifiers and
22+
biometric information (“biometric data”) may be collected, stored, and
23+
used by Amazon Web Services for the purpose of comparing the image of an
24+
individual with a stored image for analysis, verification, fraud, and
25+
security purposes. Biometric information that is generated as part of
26+
this process will be retained in line with Amazon Web Services privacy
27+
policy. You hereby provide your express, informed, written release and
28+
consent for Amazon Web Services to collect, use, and store your
29+
biometric data as described herein.
30+
</Modal.Body>
31+
<Modal.Footer>
32+
<Button variant="primary" onClick={onClick}>
33+
Accept
34+
</Button>
35+
</Modal.Footer>
36+
</Modal>
37+
);
38+
};
39+
40+
export default ConsentModal;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { useEffect, useState } from "react";
2+
3+
const useLocalStorage = (key, fallback) => {
4+
const [value, setValue] = useState(
5+
JSON.parse(window.localStorage.getItem(key)) ?? fallback
6+
);
7+
8+
useEffect(() => {
9+
window.localStorage.setItem(key, value);
10+
}, [key, value]);
11+
12+
return [value, setValue];
13+
};
14+
export default useLocalStorage;

0 commit comments

Comments
 (0)