Files
react-native/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestInstructions.js
T
Vincent Riemer b2aa41578e Add basic platform testing framework for RNTester
Summary: Changelog: [RNTester][Internal] - Add experimental platform testing framework for RNTester

Reviewed By: lunaleaps, kacieb

Differential Revision: D36633708

fbshipit-source-id: 0f2f7642bc6db31e148a2a214c17fe39656612fd
2022-05-24 19:14:11 -07:00

45 lines
993 B
JavaScript

/**
* 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
*/
import * as React from 'react';
import {View, Text, StyleSheet} from 'react-native';
import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet';
type Props = $ReadOnly<{|
instructions?: $ReadOnlyArray<string>,
style?: ?ViewStyleProp,
|}>;
export default function RNTesterPlatformTestInstructions({
instructions,
style,
}: Props): React.MixedElement | null {
if (instructions == null) {
return null;
}
return (
<View style={style}>
{instructions.map((instruction, idx) => {
return (
<Text key={idx} style={styles.instructionText}>
{idx + 1}. {instruction}
</Text>
);
})}
</View>
);
}
const styles = StyleSheet.create({
instructionText: {
fontSize: 16,
},
});