devs-coffee / frontend-collab-chat-project

frontend for the collaborative project of a chat app
MIT License
3 stars 0 forks source link

Feature darkmode managment #62

Closed Jerome-Marichez closed 1 year ago

Jerome-Marichez commented 1 year ago

The Feature


Our app supports toggling between dark and light themes, and it takes into account the user's browser/OS preferences to determine which theme to display when local storage is not available. The custom hook is designed to run only once when the 'Header' component is loaded or when the setDarkMode function is called. It does not re-run with every render, ensuring optimal performance.

About useDarkMode.ts

Created a Hook so it return the darkMode value as a boolean.

The hook return too a setDarkMode to directly enable darkMode.

About Header.tsx/DarkModeSwitch.tsx

julienb86 commented 1 year ago

Il faudrait prendre en compte le dev fait côté back sur les prefs, il faut voir avec Whitedog pour qu'il te donne les éléments.. aussi attention tu allais faire ta pr sur main . Les devs donc les pr se font sur la branche dev. J ai redirigé ta pr

Jerome-Marichez commented 1 year ago

Normalement c'est fix avec ce qui à était demandée :)