Skip to content

Commit

Permalink
Merge pull request #400 from BIDMCDigitalPsychiatry/gyroscope-game
Browse files Browse the repository at this point in the history
Gyroscope updates
  • Loading branch information
sarithapillai8 authored Sep 30, 2024
2 parents 2238445 + ef8a0a6 commit 30dfee5
Show file tree
Hide file tree
Showing 5 changed files with 286 additions and 69 deletions.
55 changes: 55 additions & 0 deletions Gyroscope/src/components/Images/basketball.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Gyroscope/src/components/Images/bb-hoop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions Gyroscope/src/components/InstructionModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React, { useEffect } from "react"
import Modal from "react-bootstrap/Modal"
import { Row, Col, Button } from "react-bootstrap"
import "../containers/layout.css"
import i18n from "../i18n"

const InstructionModal = ({...props}) => {

useEffect(() => {
const listener = (event: any) => {
if (event.code === "Enter" || event.code === "NumpadEnter") {
event.preventDefault();
props.onHide()
}
};
document.addEventListener("keydown", listener);
return () => {
document.removeEventListener("keydown", listener);
};
}, [props.message]);

return (
<Modal className="modal"{...props} size="xl" aria-labelledby="contained-modal-title-vcenter" centered={true}>
<Modal.Header closeButton={true} onClick={props.onHide} >
<Modal.Title>mindLamp</Modal.Title>
</Modal.Header>
<Modal.Body>
<Row>
<Col md={12}>
<p>{props.message}</p>
</Col>
</Row>
</Modal.Body>
<Modal.Footer>
<div className="m-0">
<Button variant="primary" className="btn-small-size w-87 me-4 btn pe-0 ps-0" onClick={props.onHide}>
{i18n.t("OK")}
</Button>
</div>
</Modal.Footer>
</Modal>
)
}

export default InstructionModal
Loading

0 comments on commit 30dfee5

Please sign in to comment.