This repository is forked from react-coding-challege (only dark-mode part remained)
- Please check demo website directly.
- Or run
yarnand then runyarn startto start app locally.
node.js v16.16.0
題目要求主要於 [feat] Add dark mode 這個 commit 完成,並且只有更動 App.js 檔案。做法為維護一個 boolean state (isDarkMode),按下按鈕後依據當下狀態切換 light/dark 模式, isDarkMode 更新完成後會觸發 side effect(在 html DOM element 增加或刪除 "dark-mode" 這個 class),而按鈕本身的 icon 圖示及顏色也依據 isDarkMode 進行改變(JSX部分)。 
如果專案發展的較大,在大量頁面或元件都需要依賴 isDarkMode 做改變的情況下,使用 useState Hook 加上 props 傳遞會相當難以開發,可以改成使用 Context API 或 Redux 來維護 isDarkMode,並且由用到 isDarkMode 的元件訂閱 store 即可。
- Add a class to the Body element in React
- How to fix SSL error when running app locally If you run this app with node.js 18, you may encounter some ssl error, try downgrading to node.js 16 by nvm or check link above for more information.
- (unsolved) bulma and dart sass conflict This might be the reason why p tag could not display successfully in production environment(gh-pages).
Feel free to contact me! :email: xyc.hsieh@gmail.com