Skip to content

Commit

Permalink
🚸 Temperature adjuster -/+ increment icons
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreMiras committed Dec 8, 2024
1 parent 32737a2 commit 0e89743
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/TemperatureAdjuster.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { FormControl, InputGroup } from "react-bootstrap";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Button, FormControl, InputGroup } from "react-bootstrap";

const TemperatureAdjuster = ({
currentTemperature,
Expand All @@ -10,12 +11,18 @@ const TemperatureAdjuster = ({
loading: boolean;
}) => (
<InputGroup className="mb-3">
<Button onClick={() => onTemperatureChange(currentTemperature - 0.5)}>
<FontAwesomeIcon icon={"minus"} />
</Button>
<FormControl
type="number"
value={currentTemperature}
onChange={(e) => onTemperatureChange(Number(e.target.value))}
disabled={loading}
/>
<Button onClick={() => onTemperatureChange(currentTemperature + 0.5)}>
<FontAwesomeIcon icon={"plus"} />
</Button>
</InputGroup>
);

Expand Down

0 comments on commit 0e89743

Please sign in to comment.