@lexzeeSubmitted over 1 year ago
Hello Seniors
So I used React Js in solving this challenge and although it works perfectly, I can't seem to get how to change the background color of the current rating value when it is clicked on.
Click here to check out the code.
The code for the rating section looks like below
const Rating = ({ handleClick, rate}) => {
return (
<div className="rating-state">
<div className="icon">
<img src={starIcon} alt="#" className='starIcon'/>
</div>
<h1 className="header">
How did we do?
</h1>
<p className="description">
Please let us know how we did with your support request. All feedback is appreciated to help us improve our offering!
</p>
<div className="rating">
<button
className="rate"
id='1'
onClick={handleClick}
onMouseOver={handleHover}
>1</button>
<button
className="rate"
id='2'
onClick={handleClick}
onMouseOver={handleHover}
>2</button>