Curtains style fix

This commit is contained in:
Claudio Maggioni (maggicl) 2020-04-27 14:14:11 +02:00
parent a54df637cd
commit 29d2815a77
2 changed files with 106 additions and 99 deletions

View File

@ -6,7 +6,10 @@ import { connect } from "react-redux";
class Curtain extends Component {
constructor(props) {
super(props);
this.state = { intensity: this.props.stateOrDevice.intensity, timeout: null };
this.state = {
intensity: this.props.stateOrDevice.intensity,
timeout: null,
};
this.setIntensity = this.setIntensity.bind(this);
}
@ -27,7 +30,10 @@ class Curtain extends Component {
.saveDevice({ ...this.props.stateOrDevice, on })
.catch((err) => console.error("curtains update error", err));
} else {
this.props.updateState({ id: this.props.sceneState.id, on: on },this.props.sceneState.kind);
this.props.updateState(
{ id: this.props.sceneState.id, on: on },
this.props.sceneState.kind
);
}
};
@ -57,7 +63,10 @@ class Curtain extends Component {
.saveDevice({ ...this.props.stateOrDevice, intensity })
.catch((err) => console.error("curtain update error", err));
} else {
this.props.updateState({ id: this.props.sceneState.id, intensity: intensity },this.props.sceneState.kind);
this.props.updateState(
{ id: this.props.sceneState.id, intensity: intensity },
this.props.sceneState.kind
);
}
};
@ -71,7 +80,6 @@ class Curtain extends Component {
}
};
///*this took me way too much more time than it should have*/
handleChange = (a) => {
@ -81,7 +89,7 @@ class Curtain extends Component {
render() {
return (
<div className="container">
<div className="container curtain-container">
<div
className="open-container"
style={{
@ -100,7 +108,6 @@ class Curtain extends Component {
max="100"
/>
</div>
);
}
}

View File

@ -4,7 +4,7 @@
box-sizing: border-box;
}
.container {
.container.curtain-container {
position: relative;
margin-top: 10%;
width: 18rem;