Skip to content

Commit

Permalink
Made some changes tothe UI
Browse files Browse the repository at this point in the history
  • Loading branch information
vrushang1234 committed May 31, 2024
1 parent 673e576 commit c758ee8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions control-station/src/components/ControlPanel/ControlPanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
display: flex;
justify-content: space-evenly;
align-items: center;
position: fixed;
bottom: 0;
}

.button {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useContext } from "react";
import SensorBox from "./SensorBox";
import PodContext from "@/services/PodContext";

import StatusIndicator from "@/components/StatusIndicator/StatusIndicator";
function SensorContainer() {
const { podData } = useContext(PodContext);
return (
Expand All @@ -10,6 +10,8 @@ function SensorContainer() {
<SensorBox title="Distance" value={podData.wheel_encoder} />
<SensorBox title="PT1" value={podData.downstream_pressure_transducer} />
<SensorBox title="PT2" value={podData.upstream_pressure_transducer} />
<SensorBox title="Lim Current" value={podData.upstream_pressure_transducer} />
<StatusIndicator />
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
.status-indicator {
background-color: lightgray;
border-radius: 10px;
padding: 1rem;
margin: 2rem;
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}

.group {
margin-bottom: 1rem;
margin-bottom: 0.1rem;
margin-left: 1rem;
width: 40%;
}

.state-text {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ function StatusIndicator() {
const { state } = podData;

return (
<div className="status-indicator">
<div className="sensorbox status-indicator" style={{ fontSize: "1rem" }}>
{Object.values(State).map((s) => {
return (
<div key={s} className={`group ${s.toLowerCase()}-state`}>
<span className={`circle` + (s === state ? " active" : "")}></span>
<br />
<div className="state-text">{s}</div>
</div>
);
Expand Down
3 changes: 1 addition & 2 deletions control-station/src/views/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { SensorData, StatusIndicator } from "@/components";
import { SensorData } from "@/components";

function Dashboard() {
return (
<div>
<SensorData />
<StatusIndicator />
</div>
);
}
Expand Down

0 comments on commit c758ee8

Please sign in to comment.