From 77236aa387393a073d234606f390521b26e041a3 Mon Sep 17 00:00:00 2001 From: Connor Kirkpatrick Date: Wed, 22 Feb 2023 18:07:19 +0000 Subject: [PATCH 1/2] Add consent modal --- src/web-ui/src/App.js | 2 ++ src/web-ui/src/components/ConsentModal.js | 40 +++++++++++++++++++++++ src/web-ui/src/hooks/useLocalStorage.js | 14 ++++++++ 3 files changed, 56 insertions(+) create mode 100644 src/web-ui/src/components/ConsentModal.js create mode 100644 src/web-ui/src/hooks/useLocalStorage.js diff --git a/src/web-ui/src/App.js b/src/web-ui/src/App.js index e156364..61cf09b 100644 --- a/src/web-ui/src/App.js +++ b/src/web-ui/src/App.js @@ -10,6 +10,7 @@ import CameraHelp from "./components/CameraHelp"; import EngagementSummary from "./components/EngagementsSummary"; import Header from "./components/Header"; import SettingsHelp from "./components/SettingsHelp"; +import ConsentModal from "./components/ConsentModal"; const App = () => { const [authState, setAuthState] = useState(undefined); @@ -69,6 +70,7 @@ const App = () => { signedIn={signedIn} toggleRekognition={toggleRekognition} /> + {signedIn ? ( <> diff --git a/src/web-ui/src/components/ConsentModal.js b/src/web-ui/src/components/ConsentModal.js new file mode 100644 index 0000000..2502f24 --- /dev/null +++ b/src/web-ui/src/components/ConsentModal.js @@ -0,0 +1,40 @@ +import React from "react"; +import { Button, Modal } from "react-bootstrap"; +import useLocalStorage from "../hooks/useLocalStorage"; + +const ConsentModal = () => { + const [hasConsent, setHasConsent] = useLocalStorage( + "rekognitionVirtualProctorConsent", + false + ); + + const onClick = () => { + setHasConsent(true); + }; + + return ( + + + Notice + + + This feature uses Amazon Web Services. Biometric identifiers and + biometric information (“biometric data”) may be collected, stored, and + used by Amazon Web Services for the purpose of comparing the image of an + individual with a stored image for analysis, verification, fraud, and + security purposes. Biometric information that is generated as part of + this process will be retained in line with Amazon Web Services privacy + policy. You hereby provide your express, informed, written release and + consent for Amazon Web Services to collect, use, and store your + biometric data as described herein. + + + + + + ); +}; + +export default ConsentModal; diff --git a/src/web-ui/src/hooks/useLocalStorage.js b/src/web-ui/src/hooks/useLocalStorage.js new file mode 100644 index 0000000..e3903bb --- /dev/null +++ b/src/web-ui/src/hooks/useLocalStorage.js @@ -0,0 +1,14 @@ +import { useEffect, useState } from "react"; + +const useLocalStorage = (key, fallback) => { + const [value, setValue] = useState( + JSON.parse(window.localStorage.getItem(key)) ?? fallback + ); + + useEffect(() => { + window.localStorage.setItem(key, value); + }, [key, value]); + + return [value, setValue]; +}; +export default useLocalStorage; From 9d16374d412f677d42dc4cd91eb1740d997de242 Mon Sep 17 00:00:00 2001 From: Connor Kirkpatrick Date: Fri, 24 Feb 2023 12:26:40 +0000 Subject: [PATCH 2/2] Bump version --- src/cfn/template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cfn/template.yaml b/src/cfn/template.yaml index 0d3d2d8..4dee4c1 100644 --- a/src/cfn/template.yaml +++ b/src/cfn/template.yaml @@ -14,7 +14,7 @@ Globals: MIN_CONFIDENCE: !Ref MinConfidence OBJECTS_OF_INTEREST_LABELS: !Join [",", !Ref ObjectsOfInterestLabels] REGION: !Ref AWS::Region - VERSION: '2.1' + VERSION: '2.2' Api: EndpointConfiguration: REGIONAL Cors: