Latest solutions
Rock, Paper and Scissors Page - React, Redux TK and Sass
#react#redux-toolkit#sass/scssSubmitted over 2 years ago
Latest comments
- @LV27VELASCO@Mathitarazonad
Buenas!! Primero que nada felicitarte por haber completado este desafío, yo también lo acabo de completar y debo admitir que es un buen desafío para desafiarte en cuanto a lógica y demás.
En cuanto a sugerencias te podría decir que consideres dividir tu código en más partes, se hace más fácil luego buscar la solución a un bug, accesible y limpio de leer cuando lo divides en más archivos, en especial cuando se trabaja con proyectos muy grandes. Por ejemplo, podrías separar el código de la lógica del buscador o del filtro en distintos archivos.
Por otra parte, para el modo oscuro, yo lo que hice es poner al contenedor principal que contiene a todos los demás, una clase llamada "dark" cuando este activada, entonces puse estilos normales a todo, y para el modo oscuro, solo cambie pequeñas cosas a partir de si el principal contenedor contenía la clase "dark" y ahí seleccionar a las demás clases, puedes echar un vistazo a mi solución si quieres para entenderlo mejor. Te dejo un ejemplo para que me entiendas un poco mejor: .Principal .contenedor-pais { color: white }
.Principal.oscuro .contenedor-pais{ color: black }
Espero haberte ayudado!!
Marked as helpful - @Fansters@Mathitarazonad
First of all, congrats to have completed this challenge, your solution looks amazing! Talking about your problem, I think that you could have like a global state or a state that you could pass to all childrens where you will have the selected product img selected like a number and pass that like props to the other components. So you can have functions that manage that and pass as props to the childrens to use that functions, and if you change the state it should render with the changes to all components, I would do that If I have that problem, wish this can help you!