-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from aws-samples/feature/add-consent-modal
Add consent modal
- Loading branch information
Showing
4 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<Modal show={!hasConsent} backdrop="static" centered> | ||
<Modal.Header> | ||
<Modal.Title>Notice</Modal.Title> | ||
</Modal.Header> | ||
<Modal.Body> | ||
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. | ||
</Modal.Body> | ||
<Modal.Footer> | ||
<Button variant="primary" onClick={onClick}> | ||
Accept | ||
</Button> | ||
</Modal.Footer> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default ConsentModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |