Skip to content

Commit

Permalink
Merge pull request #17 from rosinni/solution
Browse files Browse the repository at this point in the history
solution
  • Loading branch information
alesanchezr authored Nov 5, 2024
2 parents 1657afe + a4a52bd commit 0d6270c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";
import {useState} from "react";

const TrafficLight = () => {
const [ color, setColor] = useState("red");

return (
<div>
<div className="palito"></div>
<div className = "trafic-light">
<div onClick={() => setColor("red")} className={"light red" + (color === "red" ? " brillo" : "" )}></div>
<div onClick={() => setColor("yellow")} className={"light yellow" + (color === "yellow" ? " brillo" : "" )}></div>
<div onClick={() => setColor("green")} className={"light green" + (color === "green" ? " brillo" : "" )}></div>
</div>
</div>
);
};

export default TrafficLight;

0 comments on commit 0d6270c

Please sign in to comment.