<commit_before>import React, {
  Component,
  PropTypes,
} from 'react';

import {
  MapView,
  StyleSheet,
  Text,
  ToolbarAndroid,
  View
} from 'react-native';

import ActionsBar from '../components/detail/actions_bar';
import AddressField from '../components/detail/address_field';
import Icon from 'react-native-vector-icons/MaterialIcons';
import ImagesRow from '../components/detail/images_row';

import { STYLES } from '../base_styles';
import LoadingView from './loading_view';


const SELF_STYLES = StyleSheet.create({
  map: {
    flex: 1,
    flexDirection: 'row',
    alignSelf: 'stretch',
    borderWidth: 1,
    borderColor: '#000000',
  }
});

class PlaceDetail extends Component {
  constructor(props, context) {
    super(props, context)
    this.state = {
      loaded: false,
      place: {},
    }
  }

  componentDidMount() {
    this.fetchPlace();
  }

  fetchPlace() {
    console.log('fetching');
    const REQUEST_URL = 'https://private-f0df95-kicknow.apiary-mock.com/place';

    fetch(REQUEST_URL, {
      headers: new Headers({
        "Content-Type": "application/json",
      }),
      method: 'POST',
      mode: 'cors'
    })
      .then(response => response.json())
      .then(place => this.setState({ place: place, loaded: true }))
      .catch(error => {
        console.log('There has been a problem with your fetch operation: ' + error.message);
      })
      .done();
  }

  render() {
    if(!this.state.loaded) {
      return (
        <LoadingView />
      );
    }

    return (
      <View style={{
        flex: 1,
      }} >
        <ToolbarAndroid
          logo={{uri: this.state.place.logo.contentUrl}}
          style={{
            backgroundColor: '#e9eaed',
            height: 56,
          }}
          title={this.state.place.name}
        />

        <View style={{
          flex: 1,
          flexDirection: 'column',
          backgroundColor: 'blue',
        }} >

          {/* Images row */}
          <View>
            <ImagesRow images={this.state.place.photos} />
          </View>

          {/* Actions row */}
          <View>
            <ActionsBar />
          </View>

          {/* Place details row */}
          <View style={{ flex: 1, flexDirection: 'row' }}>
            <AddressField place={this.state.place} />
          </View>
        </View>
      </View>
    );
  }
}

PlaceDetail.propTypes = {
  place: PropTypes.object.isRequired
}

export default PlaceDetail<commit_msg>Set correct detail layout.<commit_after>import React, {
  Component,
  PropTypes,
} from 'react';

import {
  MapView,
  StyleSheet,
  Text,
  ToolbarAndroid,
  View
} from 'react-native';

import ActionsBar from '../components/detail/actions_bar';
import AddressField from '../components/detail/address_field';
import Icon from 'react-native-vector-icons/MaterialIcons';
import ImagesRow from '../components/detail/images_row';

import { STYLES } from '../base_styles';
import LoadingView from './loading_view';


const SELF_STYLES = StyleSheet.create({
  map: {
    flex: 1,
    flexDirection: 'row',
    alignSelf: 'stretch',
    borderWidth: 1,
    borderColor: '#000000',
  }
});

class PlaceDetail extends Component {
  constructor(props, context) {
    super(props, context)
    this.state = {
      loaded: false,
      place: {},
    }
  }

  componentDidMount() {
    this.fetchPlace();
  }

  fetchPlace() {
    console.log('fetching');
    const REQUEST_URL = 'https://private-f0df95-kicknow.apiary-mock.com/place';

    fetch(REQUEST_URL, {
      headers: new Headers({
        "Content-Type": "application/json",
      }),
      method: 'POST',
      mode: 'cors'
    })
      .then(response => response.json())
      .then(place => this.setState({ place: place, loaded: true }))
      .catch(error => {
        console.log('There has been a problem with your fetch operation: ' + error.message);
      })
      .done();
  }

  render() {
    if(!this.state.loaded) {
      return (
        <LoadingView />
      );
    }

    return (
      <View style={{
        flex: 1,
      }} >
        <ToolbarAndroid
          logo={{uri: this.state.place.logo.contentUrl}}
          style={{
            backgroundColor: '#e9eaed',
            height: 56,
          }}
          title={this.state.place.name}
        />

        <View style={{
          flex: 1,
          flexDirection: 'column',
          backgroundColor: 'blue',
        }} >

          {/* Images row */}
          <View style={{
            flex: 1,
            backgroundColor: 'green' 
          }}>
            <ImagesRow images={this.state.place.photos} />
          </View>

          {/* Actions row */}
          <View style={{ flex: 1 }}>
            <ActionsBar />
          </View>

          {/* Place details row */}
          <View style={{ flex: 2 }}>
            <View style={{ flex: 1, flexDirection: 'row' }}>
              <AddressField place={this.state.place} />
            </View>
          </View>

        </View>
      </View>
    );
  }
}

PlaceDetail.propTypes = {
  place: PropTypes.object.isRequired
}

export default PlaceDetail
{'fraction_non_alphanumeric': 0.14790113770105923, 'fraction_numerical': 0.007257748136524127, 'mean_word_length': 1.9994117647058824, 'pattern_counts': {'":': 2, '<': 35, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '509875', 'n_tokens_mistral': 1580, 'n_tokens_neox': 1537, 'n_words': 331}