crn-cli
Version:
The Ctrip React Native CLI Tools
1 lines • 2.32 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]),s=r(d[3]),l=r(d[4]),p=r(d[5]),c=r(d[6]),h=r(d[7]),u=h.Animated,f=h.PanResponder,y=h.StyleSheet,R=h.Text,w=h.View,v=r(d[8]),C=r(d[9]),E=r(d[10]),b=r(d[11]),x=(function(h){function y(t){var o;function p(){return'rgb('+[0,1,2].map(function(){return Math.floor(150*Math.random()+100)}).join(',')+')'}return n(this,y),(o=s(this,l(y).call(this,t))).state={closeColor:p(),openColor:p()},o}return p(y,h),o(y,[{key:"render",value:function(){var n=this.props.openVal?this.props.openVal.interpolate({inputRange:[0,1],outputRange:[this.state.closeColor,this.state.openColor]}):this.state.closeColor,o=this.props.containerLayout&&this.props.containerLayout.width||320;return c.createElement(w,{style:V.container},c.createElement(u.View,t({style:[V.header,{backgroundColor:n}]},this.state.dismissResponder.panHandlers),c.createElement(R,{style:[V.text,V.headerText]},this.props.id)),this.props.isActive&&c.createElement(w,{style:V.stream},c.createElement(w,{style:V.card},c.createElement(R,{style:V.text},"July 2nd"),c.createElement(b,{isActive:this.props.isActive}),c.createElement(v,null)),c.createElement(E,{panelWidth:o}),c.createElement(C,null)))}},{key:"UNSAFE_componentWillMount",value:function(){var t=this;this.state.dismissY=new u.Value(0),this.state.dismissResponder=f.create({onStartShouldSetPanResponder:function(){return t.props.isActive},onPanResponderGrant:function(){u.spring(t.props.openVal,{toValue:t.state.dismissY.interpolate({inputRange:[0,300],outputRange:[1,0]})}).start()},onPanResponderMove:u.event([null,{dy:this.state.dismissY}]),onPanResponderRelease:function(n,o){o.dy>100?t.props.onDismiss(o.vy):u.spring(t.props.openVal,{toValue:1}).start()}})}}]),y})(c.Component),V=y.create({container:{flex:1},header:{alignItems:'center',paddingTop:18,height:90},stream:{flex:1,backgroundColor:'rgb(230, 230, 230)'},card:{margin:8,padding:8,borderRadius:6,backgroundColor:'white',shadowRadius:2,shadowColor:'black',shadowOpacity:.2,shadowOffset:{height:.5}},text:{padding:4,paddingBottom:10,fontWeight:'bold',fontSize:18,backgroundColor:'transparent'},headerText:{fontSize:25,color:'white',shadowRadius:3,shadowColor:'black',shadowOpacity:1,shadowOffset:{height:1}}});m.exports=x},666755,[14,3,4,5,8,9,11,15,666756,666757,666760,666761]);