|
|
@ -1,34 +0,0 @@ |
|
|
|
import React, {useState} from "react"; |
|
|
|
import {Button, CustomInput, FormGroup, Modal, ModalBody, ModalFooter, ModalHeader} from "reactstrap"; |
|
|
|
import BrightnessSlider from "../Misc/BrightnessSlider"; |
|
|
|
|
|
|
|
function BrightnessModal({bValue, pValue, onConfirm, onCancel}) { |
|
|
|
const [brightness, setBrightness] = useState(bValue); |
|
|
|
const [power, setPower] = useState(pValue); |
|
|
|
|
|
|
|
return ( |
|
|
|
<Modal isOpen={true}> |
|
|
|
<ModalHeader>Lysstyrke</ModalHeader> |
|
|
|
<ModalBody style={{margin: "0 auto"}}> |
|
|
|
<FormGroup> |
|
|
|
<BrightnessSlider brightness={brightness} onChange={setBrightness}/> |
|
|
|
</FormGroup> |
|
|
|
<FormGroup> |
|
|
|
<CustomInput type="switch" |
|
|
|
id="switch-power" |
|
|
|
name="power" |
|
|
|
label={power ? "På" : "Av"} |
|
|
|
checked={power} |
|
|
|
onChange={e => setPower(e.target.checked)}/> |
|
|
|
</FormGroup> |
|
|
|
</ModalBody> |
|
|
|
<ModalFooter> |
|
|
|
<Button color="primary" onClick={() => onConfirm(brightness, power)}>Lagre</Button> |
|
|
|
{" "} |
|
|
|
<Button color="secondary" onClick={onCancel}>Avbryt</Button> |
|
|
|
</ModalFooter> |
|
|
|
</Modal> |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
export default BrightnessModal; |