forked from AsphaltWorld/Fnaf-Web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCameraButton.js
More file actions
33 lines (30 loc) · 927 Bytes
/
CameraButton.js
File metadata and controls
33 lines (30 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import React from "react";
import Media from "./Media";
function CameraButton(props) {
const { handleCameraButton } = props;
const handleCamera = ({ target }) => {
if (target.dataset.disabled == "true") {
target.dataset.disabled = "false";
Media.Sounds.OpenCamera.play();
handleCameraButton();
setTimeout(() => {
target.dataset.disabled = "true";
}, 700);
}
};
return (
<div>
<img
draggable="false"
className="camera-button"
alt="Botão da camera"
data-disabled="true"
src={Media.Images.CameraButton}
style={{ position: "absolute", zIndex: 1 }}
onMouseOver={handleCamera}
onTouchStart={handleCamera}
/>
</div>
);
}
export default CameraButton;