react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

feat: adjust theme types to match internal and regular usage

Open Drakeoon opened this issue 3 years ago • 3 comments
trafficstars

During the development we came to the conclusion that useTheme right now has to serve too many roles - support two themes at the same time for internal components and later on support just one theme when used by developers including react-native-paper into their applications

Summary

  • [x] Added useInternalTheme hook for internal usage
  • [x] Added withInternalTheme HOC for internal usage
  • [x] Renamed global type definition
  • [x] Change usage inside internal components
  • [x] Raised a PR in @callstack/react-theme-provider to allow typing hooks

Test plan

Due to the usage of global index.d.ts files I had troubles with testing the implementation inside example folder. My idea now is to create a separate app, include react-native-paper from this branch and see if global theme overrides work properly

Drakeoon avatar Jul 26 '22 07:07 Drakeoon

@lukewalczak CircleCI tests fail due to missing implementation in @callstack/react-theme-provider - I'll raise the PR today

Drakeoon avatar Jul 26 '22 07:07 Drakeoon

Hey @Drakeoon, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

callstack-bot avatar Sep 05 '22 10:09 callstack-bot

The mobile version of example app from this branch is ready! You can see it here

.

github-actions[bot] avatar Sep 05 '22 11:09 github-actions[bot]

The mobile version of example app from this branch is ready! You can see it here

.

github-actions[bot] avatar Oct 05 '22 13:10 github-actions[bot]

The mobile version of example app from this branch is ready! You can see it here

.

github-actions[bot] avatar Oct 17 '22 08:10 github-actions[bot]

The mobile version of example app from this branch is ready! You can see it here

.

github-actions[bot] avatar Oct 17 '22 08:10 github-actions[bot]

The mobile version of example app from this branch is ready! You can see it here

.

github-actions[bot] avatar Oct 17 '22 10:10 github-actions[bot]

The mobile version of example app from this branch is ready! You can see it here

.

github-actions[bot] avatar Oct 18 '22 20:10 github-actions[bot]