Skip to content

Commit

Permalink
minor css fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielburnworth committed Dec 10, 2019
1 parent c08b9f4 commit 0625a20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions frontend/controls/sensors/sensor_list.tsx
Expand Up @@ -30,7 +30,7 @@ const calcIndicatorStyle = ({ value, mode }: CalcStyleProps) => ({
const calcValueStyle = ({ value, mode }: CalcStyleProps) => ({
marginLeft: `${mode
? `${value > 500 ? -3.5 : 1.5}rem` // analog
: "7rem"}`, // digital
: "0"}`, // digital
color: `${mode ? "" : "white"}`
});

Expand All @@ -43,8 +43,12 @@ const SensorReadingDisplay =
const valueLabel = toolSensor
? `${value} (${value ? t("NO TOOL") : t("TOOL ON")})`
: value;
return <div
className={`sensor-reading-display ${moistureSensor} ${toolSensor}`}>
const classNames = [
"sensor-reading-display",
moistureSensor, toolSensor,
mode ? "analog" : "digital"
];
return <div className={classNames.join(" ")}>
{isNumber(value) && value >= 0 &&
<div className="indicator" style={calcIndicatorStyle({ value, mode })}>
<span style={calcValueStyle({ value, mode })}>
Expand Down
6 changes: 3 additions & 3 deletions frontend/css/global.scss
Expand Up @@ -1195,9 +1195,9 @@ ul {
&.moisture-sensor {
background: linear-gradient(to right, rgba($blue, 0) 20%, $blue 80%, rgba($blue, 0) 85%);
}
&.tool-verification-sensor {
span {
margin-left: 3.5rem !important;
&.digital {
.indicator {
text-align: center;
}
}
border-style: solid;
Expand Down

0 comments on commit 0625a20

Please sign in to comment.