<commit_before>import React, { Component } from 'react';
import axios from 'axios';
import { View, Text, Navigator, Button, Icon, Alert} from 'react-native';
import { connect } from 'react-redux';
import {bindActionCreators} from 'redux';

class UserPage extends Component {
  constructor(props) {
    super(props);

    this.state = {
      data: false,
      newuser: false
    }
  }

  componentDidMount() {
    var local = 'http://localhost:8000/'
    var FacebookUserID = ''
    var testingID = '189372'
    // hopeing to be '10210392928233310'
    // axio will query with FacebookUserID
    // find user from DB
    axios.get(`${local}database`, {
      params: {
        ID: testingID
      },
    }).then((response) => {
      console.log('this is the payload', this.props.state)
      console.log('i got the data', response.data)
      this.setState({
        data: response.data[0].FavoriteRecipe
      });
    }).catch((error) => {
      console.log('no data')
      Alert.alert("do you want to make a account")
    });
    }

    // create NewUser if not find in DB
    createNewUserIfNotAccount(useridforfb) {
      var local = 'http://localhost:8000/'
      var userid = useridforfb
      var reqBody = {
        "id": userid
      }
      axios.post(`${local}database`, reqBody)
      .then((reponese) => {
        console.log('new user created', reponese.data)
      }).catch((error) => {
        console.log('no user created')
      });
    }

  render() {
    return (
      <View>
        <Text style={{marginTop: 100}}>UserHomePage</Text>
        <Text style={{marginTop: 200}}>'FavoriteRecipe', {this.state.data}</Text>
      </View>
    )
  }
}

export default connect(state => ({
    state: state.facebook
  }), null
)(UserPage);
<commit_msg>userpage were rendering favorite recipe<commit_after>import React, { Component } from 'react';
import axios from 'axios';
import {
        View,
        Text,
        Image,
        Navigator,
        Button,
        ListView,
        Icon,
        TouchableHighlight,
        Alert
      } from 'react-native';
import styles from '../styles.ios.js';
import { connect } from 'react-redux';
import {bindActionCreators} from 'redux';

class UserPage extends Component {
  constructor(props) {
    super(props);
    this.state = {
      dataSource: []
    };
  }

  goBack() {
    this.props.navigator.pop();
  }

  componentWillMount() {
    this.gettt();
  }

  // create NewUser if not find in DB
  createNewUserIfNotAccount(useridforfb) {
    var local = 'http://localhost:8000/'
    var userid = useridforfb
    var reqBody = {
      "id": userid
    }
    axios.post(`${local}database`, reqBody)
    .then((reponese) => {
      console.log('new user created', reponese.data)
    }).catch((error) => {
      console.log('no user created')
    });
  }

  gettt() {
    var local = 'http://localhost:8000/'
    var FacebookUserID = this.props.state.payload.userID
    axios.get(`${local}database`, {
      params: {
        ID: FacebookUserID
      }
    })
    .then((response) => {
      console.log('this is coming back from db', response.data[0].FavoriteRecipe)
      var userrecipedata = response.data[0].FavoriteRecipe
        this.setState({
          dataSource: userrecipedata
        })
    })
    .catch((error) => {
      console.log('no data')
    });
  }

  render() {
    console.log(this.state.dataSource)
    return (
      <View>
        <Text style={{marginTop: 100}}>UserHomePage</Text>
        <TouchableHighlight style={styles.backButtonCamera} onPress={this.goBack.bind(this)}>
          <Image style={styles.backButtonImage} source={{uri: 'https://cdn0.iconfinder.com/data/icons/vector-basic-tab-bar-icons/48/back_button-128.png'}} />
        </TouchableHighlight>
        {this.state.dataSource.map((data, index) => (
          <Text key={index} style={{marginTop: 100}}>{data.name}</Text>
        ))}
      </View>
    )
  }
}

export default connect(state => ({
    state: state.facebook
  }), null
)(UserPage);

{'fraction_non_alphanumeric': 0.14960039960039961, 'fraction_numerical': 0.014985014985014986, 'mean_word_length': 2.5162423178226514, 'pattern_counts': {'":': 2, '<': 18, '<?xml version=': 0, '>': 29, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5185883', 'n_tokens_mistral': 1314, 'n_tokens_neox': 1261, 'n_words': 269}