-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Android/iOS/C++ TurboModule examples in RNTester/Catalyst
Summary: ## Changelog: [Internal] - Refactor Android/iOS/C++ TurboModule examples ~~This makes sure that both native and pure C++ (NativeCxx) TurboModule examples could be run from the Catalyst app.~~ EDIT: See the discussion - this removes the `Playground (NativeModules)` app from Catalyst, as it's already available from the `RNTester Browser` and doesn't provide the C++ counterpart. Also, there are some tweaks and code factoring in styles, to make it all fit on the screen nicely. Reviewed By: javache Differential Revision: D43605250 fbshipit-source-id: 44ee694660f3ad524b8362149ebe617ee495225e
- Loading branch information
1 parent
c18566f
commit 95e20ed
Showing
3 changed files
with
65 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
packages/rn-tester/js/examples/TurboModule/TurboModuleExampleCommon.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
* @flow strict-local | ||
*/ | ||
|
||
import {Platform, StyleSheet} from 'react-native'; | ||
|
||
// $FlowFixMe[value-as-type] | ||
const styles: StyleSheet = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
}, | ||
item: { | ||
flexDirection: 'row', | ||
margin: 2, | ||
}, | ||
column: { | ||
flex: 2, | ||
justifyContent: 'center', | ||
paddingLeft: 5, | ||
paddingRight: 5, | ||
}, | ||
result: { | ||
alignItems: 'stretch', | ||
justifyContent: 'space-between', | ||
}, | ||
value: { | ||
fontFamily: Platform.OS === 'ios' ? 'Menlo' : 'monospace', | ||
fontSize: 10, | ||
}, | ||
type: { | ||
color: '#333', | ||
fontSize: 8, | ||
}, | ||
button: { | ||
borderColor: '#444', | ||
padding: 3, | ||
flex: 1, | ||
}, | ||
buttonTextLarge: { | ||
textAlign: 'center', | ||
color: 'rgb(0,122,255)', | ||
fontSize: 16, | ||
padding: 6, | ||
}, | ||
buttonText: { | ||
color: 'rgb(0,122,255)', | ||
textAlign: 'center', | ||
fontSize: 12, | ||
}, | ||
}); | ||
|
||
export default styles; |