UNPKG

crn-cli

Version:

The Ctrip React Native CLI Tools

1 lines 1.89 kB
__d(function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]),n=r(d[1]),o=n.Alert,l=n.Button,s=n.View,c=n.StyleSheet;function u(t){o.alert(t+" has been pressed!")}e.displayName='ButtonExample',e.framework='React',e.title='<Button>',e.description='Simple React Native button component.',e.examples=[{title:'Simple Button',description:"The title and onPress handler are required. It is recommended to set accessibilityLabel to help make your app usable by everyone.",render:function(){return t.createElement(l,{onPress:function(){return u('Simple')},testID:"simple_button",title:"Press Me",accessibilityLabel:"See an informative alert"})}},{title:'Adjusted color',description:"Adjusts the color in a way that looks standard on each platform. On iOS, the color prop controls the color of the text. On Android, the color adjusts the background color of the button.",render:function(){return t.createElement(l,{onPress:function(){return u('Purple')},testID:"purple_button",title:"Press Purple",color:"#841584",accessibilityLabel:"Learn more about purple"})}},{title:'Fit to text layout',description:"This layout strategy lets the title define the width of the button",render:function(){return t.createElement(s,{style:b.container},t.createElement(l,{onPress:function(){return u('Left')},testID:"left_button",title:"This looks great!",accessibilityLabel:"This sounds great!"}),t.createElement(l,{onPress:function(){return u('Right')},testID:"right_button",title:"Ok!",color:"#841584",accessibilityLabel:"Ok, Great!"}))}},{title:'Disabled Button',description:'All interactions for the component are disabled.',render:function(){return t.createElement(l,{disabled:!0,onPress:function(){return u('Disabled')},testID:"disabled_button",title:"I Am Disabled",accessibilityLabel:"See an informative alert"})}}];var b=c.create({container:{flexDirection:'row',justifyContent:'space-between'}})},666687,[11,15]);