I am learning react and styled-components. I am stack trying to change color on every icon seperatly. Is there any solution for this?
Here is what I want to get:
https://i.stack.imgur.com/tsANO.jpg
Here is sample of my code:
import React, { useState } from "react";
import styled from "styled-components";
import {
GiSteak,
GiCheeseWedge,
GiFlatfish,
GiChickenOven,
GiBroccoli,
} from "react-icons/gi";
const StyledDiv = styled.div`
width: 300px;
div {
font-size: 30px;
color: #828282;
color: ${({ color }) => (color ? "green" : "lightGrey")};
}
`;
const Selections = () => {
const [color, setColor] = useState(false);
return (
<StyledDiv color={color} onClick={() => setColor(!color)}>
<p>Select your options</p>
<div>
<GiBroccoli />
<GiCheeseWedge />
<GiSteak />
<GiFlatfish />
<GiChickenOven />
</div>
</StyledDiv>
);
};