TAMUSHPE / MobileApp

TAMUSHPE Mobile App
MIT License
9 stars 0 forks source link

Dark/Light Mode sync with phone setting #382

Closed JasonIsAzn closed 2 weeks ago

JasonIsAzn commented 2 weeks ago

Overview

Implement dark and light mode to sync with phone settings

LucientZ commented 2 weeks ago

This should probably be implemented by taking the phone setting on user creation and then keep that info in privateUserInfo. That way, if for whatever reason a user wants to change it to the other display mode, they can.

Bonus: less code to write!

JasonIsAzn commented 2 weeks ago

ended up doing this: 6f8704a

But does require this which is a bit messy: const userContext = useContext(UserContext); const { userInfo } = userContext!; const fixDarkMode = userInfo?.private?.privateInfo?.settings?.darkMode; const useSystemDefault = userInfo?.private?.privateInfo?.settings?.useSystemDefault; const colorScheme = useColorScheme(); const darkMode = useSystemDefault ? colorScheme === 'dark' : fixDarkMode;