content: import React, { Component } from 'react';
  import {
      View,
      ToastAndroid,
      Linking,
  } from 'react-native';
  import { connect } from 'react-redux';
  import Button from 'react-native-button';
  import Icon from 'react-native-vector-icons/FontAwesome';
  
  import Actions from '../../actions';
  
  
  let {
      CarregarJogos,
  } = Actions;
  
  class AtualizaPartidasButtonView extends Component {
  
      onPress() {
  
          try {
              this.props.CarregarJogos();
          } catch(e) {
              ToastAndroid.show("Erro ao atualizar jogos", 2000);
          }
      }
  
      onImprimirTabelaPress() {
          let callback = encodeURIComponent("http://www.picosdasorte.com/ImpressaoTabelaHtml.aspx/GetTabela?idCampeonato=-1&dataJogo=-1");
          let url = `imprimirep://www.picosdasorte.com/imprimir?idbilhete=${callback}`;
          Linking.canOpenURL(url).then(supported => {
              if (!supported) {
                  ToastAndroid.show('Sem aplicativo instalado', 2000);
              } else {
                  return Linking.openURL(url);
              }
          }).catch(err => console.error('An error occurred', err));
      }
  
      render() {
  
          return(
              <View style={[this.props.style, {
                  flex: 1,
                  flexDirection: 'row',
                  justifyContent: 'flex-end',
                  marginTop: 4,
                  height: 56,
              }]} >
                  <Button onPress={this.onPress.bind(this)} ><Icon name="refresh" size={36} color="#900" /></Button>
              </View>
          );
      }
  }
  
  
  export default connect(null, {
      CarregarJogos,
  })(AtualizaPartidasButtonView)