<commit_before>import React, { Component } from 'react';
import { connect } from 'react-redux';
// +++++ Imported Components
import { Link } from 'react-router-dom';
import { Col, Button, Modal } from 'react-bootstrap';
import GoogleMaps from './GoogleMaps';
import HotelList from '../components/HotelList';
import Weather from '../components/weather';
import BudgetBar from '../components/budgetBar';
import FrommersInfo from './FrommersInfo';
import ViatorEvents from './ViatorEvents';
import YelpEvents from './YelpEvents';
import Auth from './FacebookAuth';
import { pinArray } from '../../utils/storyPageHelpers';

// Charts
import DonutChart from 'react-donut-chart';

class destinationPage extends Component {
  constructor(props) {
    super(props)
    this.state = {
     showModal: false,
     title: `${this.props.current.destination.city}, ${this.props.current.destination.country}`,
     info: "",
    };
    this.open = this.open.bind(this);
    this.close = this.close.bind(this);
  }

  componentWillMount() {
    window.scrollTo(0, 0);
  }

  more(list) {
    if(list.city) {
      return (
        <div>
          <h4>Terminal: {list.originTerminal}</h4>
          <h4>Price: ${list.price}</h4>
          <h4>Arrival: {list.arrivalDate}</h4>
          <h4>Departure: {list.departureDate}</h4>
          <h4><a href={list.url}>More Info</a></h4>
        </div>
      )
    } else if (list.hotel) {
      return (
        <div>
          <h4>Hotel: {list.hotel}</h4>
          <h4>Pirce: ${list.price}</h4>
          <h4>Address: {list.address}</h4>
          <h4><a href={list.url}>More Info</a></h4>
        </div>
      )
    } else if (Array.isArray(list) && list[0].name) {
        return list.map((event, i) => (
          <div key={i}>
            <h6>{event.name}</h6>
            <h6>{event.categories[0].title}</h6>
            <h6>Price: {event.price}</h6>
            <h6>Rating: {event.rating}</h6>
            <h6><a href={event.url}>More Info</a></h6>
            < br/>
          </div>
        ))
    } else if (Array.isArray(list) && list[0].title) {
        return list.map((event, i) => (
          <div key={i}>
            <h6>{event.title}</h6>
            <h6>Price: ${event.price}</h6>
            <h6>Rating: {event.rating}</h6>
            <h6><a href={event.url}>More Info</a></h6>
            < br/>
          </div>
        ))
    }
  }

  open(obj) {
    this.setState({ showModal: true });
    this.setState({info: this.more(obj) });
  }<commit_msg>new page when clicking info<commit_after>import React, { Component } from 'react';
import { connect } from 'react-redux';
// +++++ Imported Components
import { Link } from 'react-router-dom';
import { Col, Button, Modal } from 'react-bootstrap';
import GoogleMaps from './GoogleMaps';
import HotelList from '../components/HotelList';
import Weather from '../components/weather';
import BudgetBar from '../components/budgetBar';
import FrommersInfo from './FrommersInfo';
import ViatorEvents from './ViatorEvents';
import YelpEvents from './YelpEvents';
import Auth from './FacebookAuth';
import { pinArray } from '../../utils/storyPageHelpers';

// Charts
import DonutChart from 'react-donut-chart';

class destinationPage extends Component {
  constructor(props) {
    super(props)
    this.state = {
     showModal: false,
     title: `${this.props.current.destination.city}, ${this.props.current.destination.country}`,
     info: "",
    };
    this.open = this.open.bind(this);
    this.close = this.close.bind(this);
  }

  componentWillMount() {
    window.scrollTo(0, 0);
  }

  more(list) {
    if(list.city) {
      return (
        <div>
          <h4>Terminal: {list.originTerminal}</h4>
          <h4>Price: ${list.price}</h4>
          <h4>Arrival: {list.arrivalDate}</h4>
          <h4>Departure: {list.departureDate}</h4>
          <h4><a href={list.url} target="_blank">More Info</a></h4>
        </div>
      )
    } else if (list.hotel) {
      return (
        <div>
          <h4>Hotel: {list.hotel}</h4>
          <h4>Pirce: ${list.price}</h4>
          <h4>Address: {list.address}</h4>
          <h4><a href={list.url} target="_blank">More Info</a></h4>
        </div>
      )
    } else if (Array.isArray(list) && list[0].name) {
        return list.map((event, i) => (
          <div key={i}>
            <h6>{event.name}</h6>
            <h6>{event.categories[0].title}</h6>
            <h6>Price: {event.price}</h6>
            <h6>Rating: {event.rating}</h6>
            <h6><a href={event.url} target="_blank">More Info</a></h6>
            < br/>
          </div>
        ))
    } else if (Array.isArray(list) && list[0].title) {
        return list.map((event, i) => (
          <div key={i}>
            <h6>{event.title}</h6>
            <h6>Price: ${event.price}</h6>
            <h6>Rating: {event.rating}</h6>
            <h6><a href={event.url } target="_blank">More Info</a></h6>
            < br/>
          </div>
        ))
    }
  }

  open(obj) {
    this.setState({ showModal: true });
    this.setState({info: this.more(obj) });
  }
{'fraction_non_alphanumeric': 0.18450620934358367, 'fraction_numerical': 0.01616400551941652, 'mean_word_length': 2.316339869281046, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 0, '>': 115, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3300518', 'n_tokens_mistral': 1723, 'n_tokens_neox': 1707, 'n_words': 324}