Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move Hermes badge from template to NewAppScreen library (#28783)
Summary: Refs #28711 This PR moves Hermes badge component from the template to the `NewAppScreen` library. The main motivation behind this change was to simplify a bit template code. I assumed that it is not important to expose `global.HermesInternal` to the template users: * If this assumption is true, I think that there are no other reason to leave this component inside `App` in comparison to other `NewAppScreen` components, * If this assumption is false, I can adjust this PR and move `HermesInternal` check from the badge component to the `App`. I was trying to avoid calling `useColorScheme` when Hermes is disabled, but placing hook inside the conditional branch causes ESLint warning (react-hooks/rules-of-hooks). This PR includes also small style tweaks for the badge - since there are no background padding can be omitted and spacing can be added adjusted tweaking `top` and `left` properties and `fontSize` has been adjusted just for the readability. In the last commit, I have gone a bit further and moved `HermesBadge` to the `Header` component and I have also changed slightly the `Header` title (React -> React Native) and it's styling. > I'm not sure if after this change `HermesBadge` export in `NewAppScreen` components list is still required, but maybe this badge will be useful for someone. If it's a mistake I can update the PR and remove this export. ## Changelog [Internal][Changed] move Hermes badge from the template to the NewAppScreen library Pull Request resolved: #28783 Test Plan: Template app do not redbox on Android emulator with and without Hermes enabled. ## Preview Android with Hermes enabled and adjusted header: ![Screenshot_1588164908](https://user-images.githubusercontent.com/719641/80599357-16dc8900-8a2b-11ea-8b3e-9a2cb26d3470.png) iOS with adjusted header: ![IMG_6551](https://user-images.githubusercontent.com/719641/80599445-3bd0fc00-8a2b-11ea-8215-318625ddad13.PNG) Reviewed By: GijsWeterings Differential Revision: D22493822 Pulled By: cpojer fbshipit-source-id: 3440e10f2d59f268ca8851a6e002f0ff23fa839c
- Loading branch information