Page MenuHomePhabricator

[lib/native/web] lift globalThemeInfo redux state into lib
ClosedPublic

Authored by ginsu on Oct 20 2023, 12:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 3:48 AM
Unknown Object (File)
Fri, Nov 22, 3:29 AM
Unknown Object (File)
Thu, Nov 21, 8:29 PM
Unknown Object (File)
Thu, Nov 21, 1:11 AM
Unknown Object (File)
Thu, Nov 14, 11:25 AM
Unknown Object (File)
Thu, Nov 14, 11:25 AM
Unknown Object (File)
Thu, Nov 14, 11:25 AM
Unknown Object (File)
Thu, Nov 14, 11:23 AM
Subscribers

Details

Summary

Now that we want to bring updateThemeInfo redux actions/state into web as well there are several things we should lift from native into lib so that we can share them across both platforms. This diff lifts globalThemeInfo into the master reducer in lib. We also need to add globalThemeInfo to the web redux setup. (Had to do this in one diff to appease flow)

Part of https://linear.app/comm/issue/ENG-4956/lift-any-necessary-shared-types-selectors-functions-for-storing-the

Test Plan

flow and confirmed that updating the app theme on native still works as expected. Also followed the test plan outlined in D7891 to make sure I didn't cause any regressions with reseting the theme on log out

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu added reviewers: atul, inka, rohan.
This revision is now accepted and ready to land.Oct 20 2023, 9:03 AM

Does the native concept of a theme translate cleanly into the web concept? Does web have access to the "system theme" selected by the user? Does the API for accessing it mirror the native ones?

Does the native concept of a theme translate cleanly into the web concept? Does web have access to the "system theme" selected by the user? Does the API for accessing it mirror the native ones?

Yes I won't actually be doing the implementation for the system theme this month; however, based off my investigation so far the Appearance React Native API is inspired from the prefers-color-scheme CSS media feature which we will use to to determine the os/system theme.

https://reactnative.dev/docs/appearance?guide=web#:~:text=The%20Appearance%20API%20is%20inspired%20by%20the%20Media%20Queries%20draft%20from%20the%20W3C.%20The%20color%20scheme%20preference%20is%20modeled%20after%20the%20prefers%2Dcolor%2Dscheme%20CSS%20media%20feature.

https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme

This revision was landed with ongoing or failed builds.Oct 23 2023, 11:14 AM
This revision was automatically updated to reflect the committed changes.