<commit_before>import React, { Component } from 'react';
import {
  Text,
  View,
  Image,
  TouchableHighlight,
  TouchableOpacity,
  Switch
} from 'react-native';
import styles from '../styles.ios.js';
import Nav from './Navbar.ios.js';
import SearchBar from './Searchbar.ios.js';
import { connect } from "react-redux";
import {bindActionCreators} from 'redux';
import * as app from '../actions/appActions.ios.js';
import getApp from '../reducers/appReducers.ios.js';
import camera from './Camera.ios.js';
import FacebookLogin from './FacebookLogin.ios.js';

class App extends Component {
  constructor(props) {
    super(props);
  }

  border(color) {
    return {
      borderColor: color,
      borderWidth: 5,
    }
  }

  changeNavigationHome() {
    this.props.navigator.push({
      id: 'Home'
    })
  }

  changeNavigationCamera() {
    this.props.navigator.push({
      component: camera
    })
  }

  rendering() {
    actions.rendering();
    this.forceUpdate()
  }
  render() {
    console.log('props', this.props.actions.default)
    const {state, actions} = this.props;
    console.log('ACITONS', state)
    if (state.rendering) {
      return (
        <Image source= {{uri: 'https://media.blueapron.com/assets/loader/pot-loader-6047abec2ec57c18d848f623c036f7fe80236dce689bb48279036c4f914d0c9e.gif'}} style = {styles.loadingGif} />
      )
    }
    if (state.showSearchBar) {
      return (
        <View style={[styles.container]}>
          <View style={[styles.navigation]} >
            <Nav
              changeNavigationCamera={this.changeNavigationCamera.bind(this)}
            />
          </View>
          <View style={[styles.app, this.border('#079604')]} >
            <FacebookLogin />
            <Text style={styles.welcome}>
              Welcome to Snack Time!
            </Text>
          </View>
          <View style={[styles.searchBarPictureFrame]} >
            <SearchBar navigator={this.props.navigator} rendering={actions.rendering}/>
          </View>
          <View style={{flexDirection: 'row'}}> 
            <Switch 
              onValueChange={actions.showSearchBar}
              style={styles.switch}
              value={state.showSearchBar} />
          </View>
        </View>
      );
    } else {
      return (
        <View style={[styles.container]}>
          <View style={[styles.navigation]} ><commit_msg>updated a new action for when there is an invalid ingredient<commit_after>import React, { Component } from 'react';
import {
  Text,
  View,
  Image,
  TouchableHighlight,
  TouchableOpacity,
  Switch
} from 'react-native';
import styles from '../styles.ios.js';
import Nav from './Navbar.ios.js';
import SearchBar from './Searchbar.ios.js';
import { connect } from "react-redux";
import {bindActionCreators} from 'redux';
import * as app from '../actions/appActions.ios.js';
import getApp from '../reducers/appReducers.ios.js';
import camera from './Camera.ios.js';
import FacebookLogin from './FacebookLogin.ios.js';

class App extends Component {
  constructor(props) {
    super(props);
  }

  border(color) {
    return {
      borderColor: color,
      borderWidth: 5,
    }
  }

  changeNavigationHome() {
    this.props.navigator.push({
      id: 'Home'
    })
  }

  changeNavigationCamera() {
    this.props.navigator.push({
      component: camera
    })
  }

  rendering() {
    actions.rendering();
    this.forceUpdate()
  }
  render() {
    console.log('props', this.props.actions.default)
    const {state, actions} = this.props;
    console.log('ACITONS', state)
    if (state.rendering) {
      return (
        <Image source= {{uri: 'https://media.blueapron.com/assets/loader/pot-loader-6047abec2ec57c18d848f623c036f7fe80236dce689bb48279036c4f914d0c9e.gif'}} style = {styles.loadingGif} />
      )
    }
    if (state.showSearchBar) {
      return (
        <View style={[styles.container]}>
          <View style={[styles.navigation]} >
            <Nav
              changeNavigationCamera={this.changeNavigationCamera.bind(this)}
            />
          </View>
          <View style={[styles.app, this.border('#079604')]} >
            <FacebookLogin />
            <Text style={styles.welcome}>
              Welcome to Snack Time!
            </Text>
          </View>
          <View style={[styles.searchBarPictureFrame]} >
            <SearchBar navigator={this.props.navigator} rendering={actions.rendering} lagOut={actions.laggedOut} isRendering={state.rendering}/>
          </View>
          <View style={{flexDirection: 'row'}}> 
            <Switch 
              onValueChange={actions.showSearchBar}
              style={styles.switch}
              value={state.showSearchBar} />
          </View>
        </View>
      );
    } else {
      return (
        <View style={[styles.container]}>
          <View style={[styles.navigation]} >
{'fraction_non_alphanumeric': 0.14108910891089108, 'fraction_numerical': 0.019801980198019802, 'mean_word_length': 2.4220183486238533, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7110370', 'n_tokens_mistral': 1539, 'n_tokens_neox': 1472, 'n_words': 282}