crn-cli
Version:
The Ctrip React Native CLI Tools
1 lines • 2.19 kB
JavaScript
__d(function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]),n=r(d[1]),o=r(d[2]),c=r(d[3]),l=r(d[4]),s=r(d[5]),u=r(d[6]),h=u.Image,w=u.SwipeableFlatList,y=u.TouchableHighlight,p=u.StyleSheet,f=u.Text,k=u.View,x=u.Alert,b=r(d[7]),E=[{key:'like',icon:r(d[8]),data:'Like!'},{key:'heart',icon:r(d[9]),data:'Heart!'},{key:'party',icon:r(d[10]),data:'Party!'}],v=(function(u){function p(){return t(this,p),o(this,c(p).apply(this,arguments))}return l(p,u),n(p,[{key:"render",value:function(){return s.createElement(b,{title:this.props.navigator?null:'<SwipeableListView>',noSpacer:!0,noScroll:!0},s.createElement(w,{data:E,bounceFirstRowOnMount:!0,maxSwipeDistance:160,renderItem:this._renderItem.bind(this),renderQuickActions:this._renderQuickActions.bind(this)}))}},{key:"_renderItem",value:function(t){var n=t.item;return s.createElement(k,{style:S.row},s.createElement(h,{style:S.rowIcon,source:n.icon}),s.createElement(k,{style:S.rowData},s.createElement(f,{style:S.rowDataText},n.data)))}},{key:"_renderQuickActions",value:function(t){t.item;return s.createElement(k,{style:S.actionsContainer},s.createElement(y,{style:S.actionButton,onPress:function(){x.alert('Tips','You could do something with this edit action!')}},s.createElement(f,{style:S.actionButtonText},"Edit")),s.createElement(y,{style:[S.actionButton,S.actionButtonDestructive],onPress:function(){x.alert('Tips','You could do something with this remove action!')}},s.createElement(f,{style:S.actionButtonText},"Remove")))}}]),p})(s.Component),S=p.create({row:{flexDirection:'row',justifyContent:'center',alignItems:'center',padding:10,backgroundColor:'#F6F6F6'},rowIcon:{width:64,height:64,marginRight:20},rowData:{flex:1},rowDataText:{fontSize:24},actionsContainer:{flex:1,flexDirection:'row',justifyContent:'flex-end',alignItems:'center'},actionButton:{padding:10,width:80,backgroundColor:'#999999'},actionButtonDestructive:{backgroundColor:'#FF0000'},actionButtonText:{textAlign:'center'}});e.title='<SwipeableFlatList>',e.description='Performant, scrollable, swipeable list of data.',e.examples=[{title:'Simple swipable list',render:function(){return s.createElement(v,null)}}]},666736,[3,4,5,8,9,11,15,666681,666691,666697,666699]);