From af95e950437bbd79831dabe4bca770ee8b4ed1c0 Mon Sep 17 00:00:00 2001 From: Spencer Ahrens Date: Tue, 24 Mar 2015 19:35:12 -0700 Subject: [PATCH] [ReactNative] cleanup view example --- Examples/UIExplorer/ViewExample.js | 210 +++++++++++++++-------------- 1 file changed, 109 insertions(+), 101 deletions(-) diff --git a/Examples/UIExplorer/ViewExample.js b/Examples/UIExplorer/ViewExample.js index 6061a8ff2..25e3d3d16 100644 --- a/Examples/UIExplorer/ViewExample.js +++ b/Examples/UIExplorer/ViewExample.js @@ -17,106 +17,6 @@ var { View, } = React; -var UIExplorerBlock = require('./UIExplorerBlock'); -var UIExplorerPage = require('./UIExplorerPage'); - -var ViewExample = React.createClass({ - statics: { - title: '', - description: 'Basic building block of all UI.' - }, - getInitialState: function() { - return { - textBorderExampleHeight: 20, - }; - }, - - render: function() { - return ( - '}> - - - - Blue background - - - - - - 5px blue border - - - - - - 5px padding - - - 5px margin - - - - 5px margin and padding, - - - widthAutonomous=true - - - - - - - - Too much use of `borderRadius` (especially large radii) on - anything which is scrolling may result in dropped frames. - Use sparingly. - - - - - - - - - - - Overflow hidden - - - - - Overflow visible - - - - - - Opacity 0 - Opacity 0.1 - Opacity 0.3 - Opacity 0.5 - Opacity 0.7 - Opacity 0.9 - Opacity 1 - - - ); - }, - - updateHeight: function() { - var height = this.state.textBorderExampleHeight === 50 ? 20 : 50; - this.setState({textBorderExampleHeight: height}); - }, -}); - var styles = StyleSheet.create({ box: { backgroundColor: '#527FE4', @@ -125,4 +25,112 @@ var styles = StyleSheet.create({ } }); -module.exports = ViewExample; +exports.title = ''; +exports.description = 'Basic building block of all UI.'; +exports.displayName = 'ViewExample'; +exports.examples = [ + { + title: 'Background Color', + render: function() { + return ( + + + Blue background + + + ); + }, + }, { + title: 'Border', + render: function() { + return ( + + 5px blue border + + ); + }, + }, { + title: 'Padding/Margin', + render: function() { + return ( + + + 5px padding + + + 5px margin + + + + 5px margin and padding, + + + widthAutonomous=true + + + + ); + }, + }, { + title: 'Border Radius', + render: function() { + return ( + + + Too much use of `borderRadius` (especially large radii) on + anything which is scrolling may result in dropped frames. + Use sparingly. + + + ); + }, + }, { + title: 'Circle with Border Radius', + render: function() { + return ( + + ); + }, + }, { + title: 'Overflow', + render: function() { + return ( + + + + Overflow hidden + + + + + Overflow visible + + + + ); + }, + }, { + title: 'Opacity', + render: function() { + return ( + + Opacity 0 + Opacity 0.1 + Opacity 0.3 + Opacity 0.5 + Opacity 0.7 + Opacity 0.9 + Opacity 1 + + ); + }, + }, +];