react-native-macos/template
simek 2b56011f9c Add Dark Mode support to the App template and NewAppScreen components (#28711)
Summary:
This PR adds support for the dark mode and dynamic theme changing to the default App template and to the related `NewAppScreen` components. Using `useColorScheme` hook forced me to refactor a bit main `App.js` file, but I think those changes are step in the right direction according to way in which React Native is used in larger apps, so new `Section` component has been extracted to reduce code redundancy/repetition inside `App`.

Additional color `darker` has been added to the `Colors` statics from `NewAppScreen` because `dark` was too bright for the Dark Mode backgrounds.

Also main `StoryBoard` on iOS has been updated to use theme based colors instead of static or hardcoded ones. There was also an unused, empty `Label` which I have removed.

~~I'm not so much experienced with Android. If someone could also update Android splash screen (if Android requires such change) it will be nice. I want to look at this later using simulator.~~
> I have updated the Android splash screen and tested this change on the Android emulator.

If you have any comment or corrections feel free to post them out, I would like to put more work into this PR if it's needed. Dark Mode this days is a part of near every OS, so it could be considered as a standard feature. I hope those changes helps people which struggle with the basic theming implementation (+ there is now an example of hook and `children` prop usage in the template).

## Changelog

[Internal] [Added] - Add dark mode support to the default app template
Pull Request resolved: https://github.com/facebook/react-native/pull/28711

Test Plan:
I have tested the App from the template on the iOS device and in Android emulator with RN `0.63.0-rc`.

Screen recording on iOS (demonstarates both modes, both splash screens and transition):
![ezgif-6-e24ee8e839c9](https://user-images.githubusercontent.com/719641/80025923-a04b0300-84e1-11ea-824a-b4363db48892.gif)

Screenshot of iOS app in Dark Mode:
![IMG_6542](https://user-images.githubusercontent.com/719641/79885748-c98f6480-83f7-11ea-8c73-1351a721d5d6.PNG)

Screenshot of iOS app splash screen in Dark Mode:
![IMG_6544](https://user-images.githubusercontent.com/719641/79960431-add29f80-8485-11ea-985c-b39176024ffa.PNG)

Screenshot of Android app in the emulator:
![Screenshot_1587566100](https://user-images.githubusercontent.com/719641/79995454-88f72000-84b7-11ea-810b-dfb70de03c2a.png)

Differential Revision: D21236148

Pulled By: shergin

fbshipit-source-id: 0c8a9534d3a3f8f8099af939243a889ac4df6cda
2020-04-24 14:35:53 -07:00
..
__tests__ Exclude RN templates from internal linters 2019-02-11 15:42:17 -08:00
android Add Dark Mode support to the App template and NewAppScreen components (#28711) 2020-04-24 14:35:53 -07:00
ios Add Dark Mode support to the App template and NewAppScreen components (#28711) 2020-04-24 14:35:53 -07:00
App.js Add Dark Mode support to the App template and NewAppScreen components (#28711) 2020-04-24 14:35:53 -07:00
_buckconfig Move react-native template 2018-12-07 07:49:19 -08:00
_eslintrc.js Add .eslintrc to RN project template (#23901) 2019-03-21 07:14:23 -07:00
_flowconfig Flow 0.123.0 in xplat/js 2020-04-21 22:43:24 -07:00
_gitattributes Move react-native template 2018-12-07 07:49:19 -08:00
_gitignore remove `xcshareddata` from gitignore (#27563) 2019-12-18 14:17:20 -08:00
_prettierrc.js Fresh RN projects fails ESLint / Prettier by default (#25478) 2019-07-15 02:09:59 -07:00
_watchmanconfig Move react-native template 2018-12-07 07:49:19 -08:00
app.json Move react-native template 2018-12-07 07:49:19 -08:00
babel.config.js fix: change template to work with jest (#23150) 2019-01-24 17:33:50 -08:00
index.js Exclude RN templates from internal linters 2019-02-11 15:42:17 -08:00
metro.config.js Exclude RN templates from internal linters 2019-02-11 15:42:17 -08:00
package.json chore: update lint config in template (#28443) 2020-03-31 13:51:18 -07:00