This was my first time building anything with React and Styled Components, I hope you guys like it. If you have any tips or suggestions please do tell me, I'd love to hear them. If there are any issues please do point them out.
Gabriele
@GabborioneAll comments
- @atharvpoteSubmitted over 2 years ago@GabborionePosted over 2 years ago
Hey well done! I don't have much to say because i think you have structured it in a good way. I learned a lot watching your code beacuse i think your Utils folder is pretty usefull and i'll probably do it in my future projects ;). Maybe the only thing that you can improve is the dropdown menu, because if you open one you can't close it by clicking again but you have to click the other one, so you can't have all the dropdowns open at the same time. Thanks again for the help, good coding :)
Marked as helpful1 - @Maacaa0Submitted over 2 years ago
Hi Guys. Well... this is my first JS challenge. It was very difficult for me. It works as it should, but i feel like the code is a mess. I had a problem when I selected rating-button 1 and clicked somewhere else (rating button was no longer selected) and hit submit, I still had selected rating 1. That is why I added the color changes to each rating button.
I think that this solution is not even close to a good one.
I would really really appreciate your feedback.
@GabborionePosted over 2 years agoWell done! Your design is really close to the original end you code isn't a mess like you think, it was really easy to read. One thing you can improve is the management of the numbers, it's not a really good thing to repeat the code for every button since they are the same component. You can try to give them the same class name end get all with the QuerySelectorAll and then use a foreach to add an event listener to each one of them. Now you can create a single function with a parameter that can store the target of the "click" and you can take the number of the button with target.textContent. For the change of the color on click you can create a css class .active and assign that to the target button with target.classList.add("active"). Hope this can help you, good coding :)
Marked as helpful1