Merge branch '78-fix-light-problems-in-the-first-bach' of lab.si.usi.ch:sa4-2020/the-sanmarinoes/frontend into dev-copy

This commit is contained in:
Claudio Maggioni (maggicl) 2020-04-30 11:54:42 +02:00
commit 697a348058
10 changed files with 35 additions and 21 deletions

View file

@ -24,7 +24,12 @@ class DevicePanel extends Component {
render() {
return (
<Grid doubling columns={2} divided="vertically">
<Grid
doubling
columns={2}
divided="vertically"
style={{ paddingTop: "3rem" }}
>
{this.props.devices.map((e, i) => {
return (
<Grid.Column key={i}>

View file

@ -173,16 +173,7 @@ class Device extends React.Component {
}
}
}
/*
{this.props.stateOrDevice ?
<DeviceSettingsModal
ref={this.modalRef}
id={this.props.stateOrDevice.id}
/> :
""
}
*/
const mapStateToProps = (state, ownProps) => ({
get stateOrDevice() {
if (state.active.activeTab === "Devices") {

View file

@ -26,23 +26,26 @@ const DeleteModal = (props) => (
);
const SettingsForm = (props) => {
const handleInputChange = (e) => {
const { name, value } = e.target;
setValues({ ...values, [name]: value });
};
const [values, setValues] = useState({ name: "" });
const handleInputChange = (e) => {
const { name, value } = e.target.value;
setValues({ ...values, [name]: value });
console.log("EDDDDITING!!", e.target.value);
console.log(props);
};
return (
<Form>
<Form.Field>
<label>Edit Name: </label>
<Input
<label>Edit Name:</label>
<input
autoComplete="off"
name="name"
onChange={handleInputChange}
placeholder={props.name}
// {this.props.device.name}
value={props.name}
autoFocus="on"
placeholder="Device name"
/>
</Form.Field>

View file

@ -35,6 +35,7 @@ export const ValueStyle = {
fontSize: "1.3rem",
fontFamily: "Lato",
textAnchor: "middle",
userSelect: "none",
};
export const CircularThumbStyle = {
@ -52,6 +53,7 @@ export const textStyle = {
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
userSelect: "none",
};
export const knobIcon = {

View file

@ -164,8 +164,8 @@ class Light extends Component {
);
const normalLightView = (
<StyledDiv>
<div onClick={this.onClickDevice}>
<StyledDiv onClick={this.onClickDevice}>
<div>
<Image src={this.getIcon()} style={iconStyle} />
<BottomPanel style={{ backgroundColor: "#ffa41b" }}>
<h5 style={nameStyle}>Light</h5>

View file

@ -20,6 +20,7 @@ export const textStyle = {
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
userSelect: "none",
};
export const nameStyle = {
@ -29,6 +30,7 @@ export const nameStyle = {
left: "50%",
transform: "translateX(-50%)",
color: "white",
userSelect: "none",
};
export const LightDimmerStyle = {

View file

@ -21,12 +21,14 @@ export const sensorText = {
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
userSelect: "none",
};
export const valueStyle = {
fill: "#3e99ff",
fontSize: "2.4rem",
fontFamily: "Lato",
userSelect: "none",
};
export const errorStyle = {
@ -34,6 +36,7 @@ export const errorStyle = {
fontSize: "1.5rem",
fontFamily: "Lato",
textShadow: "1px 1px 0.5px rgba(0, 0, 0, .2)",
userSelect: "none",
};
export const motionSensorInnerCircle = {

View file

@ -5,6 +5,7 @@ export const energyConsumedStyle = {
top: "20%",
left: "50%",
transform: "translateX(-50%)",
userSelect: "none",
};
export const kwhStyle = {
@ -14,6 +15,7 @@ export const kwhStyle = {
top: "50%",
left: "50%",
transform: "translateX(-50%)",
userSelect: "none",
};
export const imageStyle = {
@ -24,6 +26,7 @@ export const imageStyle = {
left: "50%",
transform: "translateX(-35%)",
filter: "drop-shadow( 1px 1px 0.5px rgba(0, 0, 0, .25))",
userSelect: "none",
};
export const nameStyle = {
@ -35,4 +38,5 @@ export const nameStyle = {
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
userSelect: "none",
};

View file

@ -5,6 +5,7 @@ export const imageStyle = {
top: "5%",
left: "50%",
transform: "translateX(-50%)",
userSelect: "none",
};
export const nameStyle = {
@ -16,6 +17,7 @@ export const nameStyle = {
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
userSelect: "none",
};
export const turnedOnStyle = {
@ -25,4 +27,5 @@ export const turnedOnStyle = {
top: "20%",
left: "50%",
transform: "translateX(-50%)",
userSelect: "none",
};

View file

@ -75,6 +75,7 @@ export const iconStyle = {
top: "10%",
left: "50%",
transform: "translateX(-50%)",
userSelect: "none",
};
export const nameStyle = {
position: "absolute",