<commit_before>import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  ScrollView,
  TextInput,
  TouchableNativeFeedback,
  Image,
  TouchableOpacity,
} from 'react-native';


//import TabNavigator from 'react-native-tab-navigator';
//import Communications from 'react-native-communications';


class ClubInfo extends Component {
    constructor(props){
        super(props);
        this.state = {
            hasData: false,
            data: []

        };

    }
    render() {
        var TouchableElement = TouchableNativeFeedback;
        var officer = true; // figure this out later
        var vals = ['Secondary Advisor Department','Meeting Location','Vice President Email','President Email','Parent Organization','Meeting Times','Advisor Email','Vice President Name','Advisor Phone','Organization Email','Secretary Name','Advisor Department','Seceretary Email','Primary Contact','Meeting Day','Secondary Advisor Name and Title','url','image url','Advisor Name and Title','Secondary Advisor Phone','Summary','Treasurer Email','Secondary Advisor Email','Main Summary','About Summary','Name', 'President Name'];
        var data = this.state.data;

        function clubValue(){

           var returnValue = [];



           data.map(club=> {
               var i = 0;
               for (let prop in club){

                    if (prop==="id" || prop === "events" || prop==="posts" || prop==="img"){
                        continue;
                    }

                    returnValue.push(<View><Text style={styles.welcome}>{prop}:</Text><Text style={styles.instructions}>{club[prop]}</Text></View>);
                    i++;
               }





            })

          return returnValue;

        }



        return (
        <ScrollView style = {{marginTop: 30, paddingBottom: 30}}>

            {clubValue()}

            <TouchableElement style = {styles.button} onPress = {()=>{alert("yo")}}>
                <View><Text>Submit</Text></View>
            </TouchableElement>
            <TouchableElement style = {styles.button} onPress = {()=>this._onGoClub(this.props.route.clubName)}>
                <View><Text>Back</Text></View>
            </TouchableElement>

        </ScrollView>


        );
        }

        _onGoClub(name) {
            this.props.navigator.push({
                type: "club",
                index: this.props.route.index+1,
                state: Object.assign({}, this.props.route.state, {clubName: name})
            });
        }


        // Jonathan's component code
        // hard coded to acm
        componentDidMount() {
            const url = "http://skeleton20161103012840.azurewebsites.net/api/organizations/name?name="+
                this.props.route.clubName.replace(" ","+");
            fetch(url)
                .then(res=>res.json())
                .then(json => {
                    this.setState({
                        hasData: true,
                        data: json
                    })
                })
                .catch(e => {
                    console.error(e);
                    //TODO: figure out how to navigate back out if something went wrong
                })
        }<commit_msg>Minor fix to unbreak clubinfo<commit_after>import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  ScrollView,
  TextInput,
  TouchableNativeFeedback,
  Image,
  TouchableOpacity,
} from 'react-native';


//import TabNavigator from 'react-native-tab-navigator';
//import Communications from 'react-native-communications';


class ClubInfo extends Component {
    constructor(props){
        super(props);
        this.state = {
            hasData: false,
            data: []

        };

    }
    render() {
        var TouchableElement = TouchableNativeFeedback;
        var officer = true; // figure this out later
        var vals = ['Secondary Advisor Department','Meeting Location','Vice President Email','President Email','Parent Organization','Meeting Times','Advisor Email','Vice President Name','Advisor Phone','Organization Email','Secretary Name','Advisor Department','Seceretary Email','Primary Contact','Meeting Day','Secondary Advisor Name and Title','url','image url','Advisor Name and Title','Secondary Advisor Phone','Summary','Treasurer Email','Secondary Advisor Email','Main Summary','About Summary','Name', 'President Name'];
        var data = this.state.data;

        function clubValue(){

           var returnValue = [];



           data.map(club=> {
               var i = 0;
               for (let prop in club){

                    if (prop==="id" || prop === "events" || prop==="posts" || prop==="img"){
                        continue;
                    }

                    returnValue.push(<View><Text style={styles.welcome}>{prop}:</Text><Text style={styles.instructions}>{club[prop]}</Text></View>);
                    i++;
               }





            })

          return returnValue;

        }



        return (
        <ScrollView style = {{marginTop: 30, paddingBottom: 30}}>

            {clubValue()}

            <TouchableElement style = {styles.button} onPress = {()=>{alert("yo")}}>
                <View><Text>Submit</Text></View>
            </TouchableElement>
            <TouchableElement style = {styles.button} onPress = {()=>this._onGoClub(this.props.route.clubName)}>
                <View><Text>Back</Text></View>
            </TouchableElement>

        </ScrollView>


        );
        }

        _onGoClub(name) {
            this.props.navigator.push({
                type: "club",
                index: this.props.route.index+1,
                state: Object.assign({}, this.props.route.state, {clubName: name})
            });
        }


        // Jonathan's component code
        // hard coded to acm
        componentDidMount() {
            const url = "http://skeleton20161103012840.azurewebsites.net/api/organizations/name?name="+
                this.props.route.state.clubName.replace(" ","+");
            fetch(url)
                .then(res=>res.json())
                .then(json => {
                    this.setState({
                        hasData: true,
                        data: json
                    })
                })
                .catch(e => {
                    console.error(e);
                    //TODO: figure out how to navigate back out if something went wrong
                })
        }
{'fraction_non_alphanumeric': 0.13541346449431294, 'fraction_numerical': 0.006148170919151552, 'mean_word_length': 1.8217692974848223, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 55, 'https://': 0, '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': '3937087', 'n_tokens_mistral': 1792, 'n_tokens_neox': 1640, 'n_words': 366}