Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/ui/preact/sensor/soil/analog_sensor_component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function getStatusClass(status: string): string {
type analogSensorState = {
data: SensorData | null;
expanded: boolean;
enableCalibration: boolean;
enableConfiguration: boolean;
};

// Sensor settings used during the rendering process.
Expand Down Expand Up @@ -70,7 +70,7 @@ export class AnalogSensorComponent extends Component<
this.state = {
data: null,
expanded: false,
enableCalibration: false,
enableConfiguration: false,
};
}

Expand All @@ -94,7 +94,7 @@ export class AnalogSensorComponent extends Component<
this.setState({
data: null,
expanded: false,
enableCalibration: false,
enableConfiguration: false,
});
}

Expand Down Expand Up @@ -189,8 +189,8 @@ export class AnalogSensorComponent extends Component<
</div>
</div>

{/* Calibration mode */}
{this.state.enableCalibration && (
{/* Configuration mode */}
{this.state.enableConfiguration && (
<FormConfigComponent
config={this.props.config}
ignoreKeys={["bitwidth"]}
Expand All @@ -201,7 +201,7 @@ export class AnalogSensorComponent extends Component<
</div>
)}

{this.state.expanded && !this.state.enableCalibration && (
{this.state.expanded && !this.state.enableConfiguration && (
<div className="config-button-container">
<button onClick={this.handleConfigBegin} className="config-button">
Configure
Expand Down Expand Up @@ -234,7 +234,7 @@ export class AnalogSensorComponent extends Component<
this.setState({
...this.state,
expanded: false,
enableCalibration: false,
enableConfiguration: false,
});
};

Expand All @@ -243,7 +243,7 @@ export class AnalogSensorComponent extends Component<
this.setState({
...this.state,
expanded: true,
enableCalibration: true,
enableConfiguration: true,
});
};

Expand All @@ -254,7 +254,7 @@ export class AnalogSensorComponent extends Component<
this.setState({
...this.state,
expanded: !wasExpanded,
enableCalibration: false,
enableConfiguration: false,
});
};
}