diff --git a/packages/rn-tester/js/components/RNTTestDetails.js b/packages/rn-tester/js/components/RNTTestDetails.js new file mode 100644 index 00000000000..7e901c57b15 --- /dev/null +++ b/packages/rn-tester/js/components/RNTTestDetails.js @@ -0,0 +1,103 @@ +/** + * Copyright (c) Facebook, Inc. and its 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, Button} from 'react-native'; +import {type RNTesterTheme} from './RNTesterTheme'; + +function RNTTestDetails({ + test, + description, + expect, + title, + theme, +}: { + test?: string, + description?: string, + expect?: string, + title: string, + theme: RNTesterTheme, +}): React.Node { + const [collapsed, setCollapsed] = React.useState(false); + + const content = + test != null ? ( + <> + + How to Test + {test} + + {expect != null && ( + + Expectation + {expect} + + )} + + ) : description != null ? ( + + Description + {description} + + ) : null; + + return ( + + + + {title} + + {content != null && ( +