From 7630a614e4bd56c1a3ac728e1dfafd114340f2b7 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Thu, 15 Feb 2018 17:40:10 -0800 Subject: [PATCH] Demo illustrated `base-line` metric exposure Summary: A demo illustrated `base-line` metric exposure to layout system was added to RNTester. And currently it shows that we don't support it at all. https://cl.ly/1F0B0D430U3e Reviewed By: sahrens Differential Revision: D6957056 fbshipit-source-id: 28776300fc8e11950ac5ba1a5416f68d31d4e9fb --- RNTester/js/TextExample.ios.js | 72 +++++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/RNTester/js/TextExample.ios.js b/RNTester/js/TextExample.ios.js index 5caf0089286623..5064a63dc8fc89 100644 --- a/RNTester/js/TextExample.ios.js +++ b/RNTester/js/TextExample.ios.js @@ -15,7 +15,7 @@ const Platform = require('Platform'); var React = require('react'); var createReactClass = require('create-react-class'); var ReactNative = require('react-native'); -var {Image, Text, View, LayoutAnimation, Button} = ReactNative; +var {Image, Text, TextInput, View, LayoutAnimation, Button} = ReactNative; type TextAlignExampleRTLState = {| isRTL: boolean, @@ -224,6 +224,70 @@ var AdjustingFontSize = createReactClass({ }, }); +class TextBaseLineLayoutExample extends React.Component<*, *> { + render() { + var texts = []; + for (var i = 9; i >= 0; i--) { + texts.push({i}); + } + + const marker = ; + const subtitleStyle = {fontSize: 16, marginTop: 8, fontWeight: 'bold'}; + + return ( + + {'Nested s:'} + + {marker} + + {texts} + + {marker} + + + {'Array of s in :'} + + {marker} + {texts} + {marker} + + + {'Interleaving and :'} + + {marker} + + Some text. + + {marker} + Text inside View. + {marker} + + + {marker} + + + {':'} + + {marker} + + {texts} + + {marker} + + + {':'} + + {marker} + + {texts} + + {marker} + + + ); + } +} + exports.title = ''; exports.description = 'Base component for rendering styled text.'; exports.displayName = 'TextExample'; @@ -780,4 +844,10 @@ exports.examples = [ return ; }, }, + { + title: 'Text `alignItems: \'baseline\'` style', + render: function() { + return ; + }, + }, ];