<commit_before>import React from 'react';
import ActionButton from 'react-native-action-button';
import Icon from 'react-native-vector-icons/FontAwesome';
import {styles} from './GlobalStyles.js'
import CountDownTimer from 'react_native_countdowntimer' 

var dateFormat = require('dateformat');

import {
  StackNavigator,
  TabNavigator,
} from 'react-navigation';

import {
  RefreshControl,
  StyleSheet,
  Text,
  View,
  FlatList,
  Dimensions,
  Image,
  ActivityIndicator,
  TouchableHighlight,
} from 'react-native';

const api = 'https://f1portal.herokuapp.com';
const today = new Date();
var seasonRound;

export default class CalendarScreen extends React.Component {

  static navigationOptions = {
    tabBarLabel: 'Calendar',
    tabBarIcon: ({ tintColor }) => (
      <Image
        source={require('../images/icons/calendar.png')}
        style={[styles.icon, {tintColor: tintColor}]}
      />
    ),
    tabBarPosition: 'bottom',
  };


  constructor(props) {
    super(props);
    this.state = {
      dataSource: [],
      calendarJson: [],
      isLoading: true,
      refreshing: false,
    };

  }

  componentDidMount() {

    return fetch(api + '/get_schedule')
      .then((response) => response.json())
      .then((responseJson) => {
        this.setState({
          isLoading: false,
          calendarJson: responseJson,
          dataSource: responseJson.MRData.RaceTable.Races,
        });
      })
      .catch((error) => {
        console.error(error);
      });

  }

  raceInfoClick(raceInfo){
    console.log("Clicked on " + raceInfo.raceName);
  }

  scrollToLatest(){
    console.log("Scrolled to latest race");
    this.refs.flatlist.scrollToIndex({index: seasonRound, animated: true});
  }

  renderRow(data) {

    var standingCell = data.item;
    var imageURL = standingCell.Circuit.imageURL;
    var raceDate = new Date(standingCell.date + "T" + standingCell.time)
    var imgStyle;
    if (data.index < seasonRound) {
      imgStyle = local_styles.elapsedRaceImageView;
      raceNameTextStyle = local_styles.elapsedRaceNameText;
      raceCircuitTextStyle = local_styles.elapsedRaceCircuitText;
      raceDateTextStyle = local_styles.elapsedRaceDateText;
    } else {
      imgStyle = local_styles.raceImageView;
      raceNameTextStyle = local_styles.raceNameText;
      raceCircuitTextStyle = local_styles.raceCircuitText;
      raceDateTextStyle = local_styles.raceDateText;
    }

    var date = raceDate.toISOString();


    return(
      <TouchableHighlight onPress={() => this.raceInfoClick(standingCell)}>
        <Image
          style={local_styles.raceImage} 
          source={
            {uri: imageURL}
          }>

            <View style={imgStyle}>

              <View style={local_styles.raceNameTextView}>
                <Text style={raceNameTextStyle}>
                  {standingCell.raceName}
                </Text>
                <Text style={raceCircuitTextStyle}>
                  {standingCell.Circuit.circuitName}
                </Text>
              </View>
              <View style={local_styles.raceDateTextView}>

                <Text style={raceDateTextStyle}>
                  {dateFormat(raceDate, "mmmm dS")}
                </Text>


                {(data.index === seasonRound) && 

                  <CountDownTimer
                    date={date}
                    days={{plural: 'Days ',singular: 'day '}}
                    hours=':'
                    mins=':'
                    segs=''

                    daysStyle={styles.time}
                    hoursStyle={styles.time}
                    minsStyle={styles.time}
                    secsStyle={styles.time}
                    firstColonStyle={styles.colon}
                    secondColonStyle={styles.colon}
                  />

                }

              </View>
            </View>
        </Image>
      </TouchableHighlight>
    )
 
  }<commit_msg>Solved countdown styles issues and made it clearer with white text<commit_after>import React from 'react';
import ActionButton from 'react-native-action-button';
import Icon from 'react-native-vector-icons/FontAwesome';
import {styles} from './GlobalStyles.js'
import CountDownTimer from 'react_native_countdowntimer' 

var dateFormat = require('dateformat');

import {
  StackNavigator,
  TabNavigator,
} from 'react-navigation';

import {
  RefreshControl,
  StyleSheet,
  Text,
  View,
  FlatList,
  Dimensions,
  Image,
  ActivityIndicator,
  TouchableHighlight,
} from 'react-native';

const api = 'https://f1portal.herokuapp.com';
const today = new Date();
var seasonRound;

export default class CalendarScreen extends React.Component {

  static navigationOptions = {
    tabBarLabel: 'Calendar',
    tabBarIcon: ({ tintColor }) => (
      <Image
        source={require('../images/icons/calendar.png')}
        style={[styles.icon, {tintColor: tintColor}]}
      />
    ),
    tabBarPosition: 'bottom',
  };


  constructor(props) {
    super(props);
    this.state = {
      dataSource: [],
      calendarJson: [],
      isLoading: true,
      refreshing: false,
    };

  }

  componentDidMount() {

    return fetch(api + '/get_schedule')
      .then((response) => response.json())
      .then((responseJson) => {
        this.setState({
          isLoading: false,
          calendarJson: responseJson,
          dataSource: responseJson.MRData.RaceTable.Races,
        });
      })
      .catch((error) => {
        console.error(error);
      });

  }

  raceInfoClick(raceInfo){
    console.log("Clicked on " + raceInfo.raceName);
  }

  scrollToLatest(){
    console.log("Scrolled to latest race");
    this.refs.flatlist.scrollToIndex({index: seasonRound, animated: true});
  }

  renderRow(data) {

    var standingCell = data.item;
    var imageURL = standingCell.Circuit.imageURL;
    var raceDate = new Date(standingCell.date + "T" + standingCell.time)
    var imgStyle;
    if (data.index < seasonRound) {
      imgStyle = local_styles.elapsedRaceImageView;
      raceNameTextStyle = local_styles.elapsedRaceNameText;
      raceCircuitTextStyle = local_styles.elapsedRaceCircuitText;
      raceDateTextStyle = local_styles.elapsedRaceDateText;
    } else {
      imgStyle = local_styles.raceImageView;
      raceNameTextStyle = local_styles.raceNameText;
      raceCircuitTextStyle = local_styles.raceCircuitText;
      raceDateTextStyle = local_styles.raceDateText;
    }

    var date = raceDate.toISOString();


    return(
      <TouchableHighlight onPress={() => this.raceInfoClick(standingCell)}>
        <Image
          style={local_styles.raceImage} 
          source={
            {uri: imageURL}
          }>

            <View style={imgStyle}>

              <View style={local_styles.raceNameTextView}>
                <Text style={raceNameTextStyle}>
                  {standingCell.raceName}
                </Text>
                <Text style={raceCircuitTextStyle}>
                  {standingCell.Circuit.circuitName}
                </Text>
              </View>
              <View style={local_styles.raceDateTextView}>

                <Text style={raceDateTextStyle}>
                  {dateFormat(raceDate, "mmmm dS")}
                </Text>


                {(data.index === seasonRound) && 

                  <CountDownTimer
                    date={date}
                    // days={{plural: 'D ',singular: 'D'}}
                    days={{plural: 'Days ',singular: 'day '}}
                    hours=':'
                    mins=':'
                    segs=''

                    daysStyle={styles.time}
                    hoursStyle={styles.time}
                    minsStyle={styles.time}
                    secsStyle={styles.time}
                    firstColonStyle={styles.colon}
                    secondColonStyle={styles.colon}
                  />

                }

              </View>
            </View>
        </Image>
      </TouchableHighlight>
    )
 
  }
{'fraction_non_alphanumeric': 0.11554885707108767, 'fraction_numerical': 0.00025119316754584274, 'mean_word_length': 2.072145061728395, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 49, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1276957', 'n_tokens_mistral': 2379, 'n_tokens_neox': 2205, 'n_words': 404}