UNPKG

crn-cli

Version:

The Ctrip React Native CLI Tools

1 lines 1.43 kB
__d(function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]),n=r(d[1]),l=r(d[2]),s=r(d[3]),o=r(d[4]),u=r(d[5]),c=r(d[6]),v=c.Platform,E=c.View,h=c.Text,T=c.TouchableOpacity,p=c.TVEventHandler,f=(function(c){function f(n){var o;return t(this,f),(o=l(this,s(f).call(this,n))).state={lastEventType:''},o}return o(f,c),n(f,[{key:"_enableTVEventHandler",value:function(){this._tvEventHandler=new p,this._tvEventHandler.enable(this,function(t,n){t.setState({lastEventType:n.eventType})})}},{key:"_disableTVEventHandler",value:function(){this._tvEventHandler&&(this._tvEventHandler.disable(),delete this._tvEventHandler)}},{key:"componentDidMount",value:function(){this._enableTVEventHandler()}},{key:"componentWillUnmount",value:function(){this._disableTVEventHandler()}},{key:"render",value:function(){return v.isTV?u.createElement(E,null,u.createElement(T,{onPress:function(){}},u.createElement(h,null,"This example enables an instance of TVEventHandler to show the last event detected from the Apple TV Siri remote or from a keyboard.")),u.createElement(h,{style:{color:'blue'}},this.state.lastEventType)):u.createElement(E,null,u.createElement(h,null,"This example is intended to be run on Apple TV."))}}]),f})(u.Component);e.framework='React',e.title='TVEventHandler example',e.description='iOS alerts and action sheets',e.examples=[{title:'TVEventHandler',render:function(){return u.createElement(f,null)}}]},666793,[3,4,5,8,9,11,15]);