{"action":"created","comment":{"url":"https://api.github.com/repos/redspanner/go-for-eat-client/pulls/comments/165818553","pull_request_review_id":93819405,"id":165818553,"diff_hunk":"@@ -0,0 +1,138 @@\n+import React, { Component } from 'react';\n+import { connect } from 'react-redux';\n+import { Platform, View, Text } from 'react-native';\n+import { Button } from 'react-native-elements'\n+import { Constants, Location, Permissions } from 'expo';\n+import DatePicker from 'react-native-datepicker'\n+import { GooglePlacesAutocomplete } from '../../components/GooglePlacesAutocomplete';\n+import { createEvent } from '../../actions';\n+\n+const moment = require('moment');\n+\n+import s from './styles';\n+import cs from './customStyles';\n+\n+class CreateEvent extends Component {\n+  constructor (props) {\n+    super(props);\n+    this.newEvent = {};\n+  }\n+\n+  state = {\n+    location: null,\n+    errorMessage: null,\n+    date: '',\n+    time: '',\n+  }\n+\n+  componentWillMount() {\n+    if (Platform.OS === 'android' && !Constants.isDevice) {\n+      this.setState({\n+        errorMessage: 'Oops, this will not work on Sketch in an Android emulator. Try it on your device!',\n+      });\n+    } else {\n+      this._getLocationAsync();\n+    }\n+  }\n+\n+  _getLocationAsync = async () => {\n+    // console.log('GET LOCATION ASYNC');\n+\n+    let { status } = await Permissions.askAsync(Permissions.LOCATION);\n+    if (status !== 'granted') {\n+      this.setState({\n+        errorMessage: 'Permission to access location was denied',\n+      });\n+    }\n+\n+    let location = await Location.getCurrentPositionAsync({});\n+    this.setState({ location });\n+    // console.log('this.setState', location);\n+  };\n+\n+  handleGo = () => {\n+    console.log('-----------------------handleGo---------------------');\n+    if ( this.newEvent.place_id && this.state.date !== '' && this.state.time !== '') {\n+      var date = this.state.date.split(\" / \");\n+      var dateTime = date[2]+\"-\"+date[1]+\"-\"+date[0]+'T'+this.state.time.replace(/\\s/g, '')+':00';\n+      this.newEvent.when = (new Date(dateTime).getTime())/1000\n+      console.log('newEvent', this.newEvent);\n+      this.props.createEvent(this.newEvent);\n+    } else {\n+      console.log('Please fill all the information');\n+    }\n+  }\n+\n+  handleSelectPlace = (data, details) => {\n+    console.log('-----------------------handleSelectPlace---------------------');\n+    this.newEvent = {\n+      \"place_id\": details.id,\n+      \"place_name\": details.name,\n+      \"place_address\": details.formatted_address,\n+      \"location\": {\n+          \"type\": \"Point\",\n+          \"coordinates\": [details.geometry.location.lat, details.geometry.location.lng]\n+      }\n+    };\n+    console.log(this.newEvent);\n+  }\n+\n+  render() {\n+    let text = 'Waiting..';\n+    let location = '';\n+    if (this.state.location) {\n+      location = this.state.location.coords.latitude +','+ this.state.location.coords.longitude;\n+    }\n+    return  (\n+      <View style={s.container}>\n+        <Text style={s.title}>Restaurant:</Text>\n+        <View style={s.GooglePlacesAutocompleteContainer}>\n+          <GooglePlacesAutocomplete />\n+        </View>\n+        <Text style={s.title}>Date:</Text>\n+        <DatePicker\n+          style={s.datePicker}\n+          date={this.state.date}\n+          mode=\"date\"\n+          placeholder={''}\n+          format=\"DD / MM / YYYY\"\n+          minDate={moment().format('DD / MM / YYYY')}\n+          confirmBtnText=\"Confirm\"\n+          cancelBtnText=\"Cancel\"\n+          customStyles={cs.datePicker}\n+          onDateChange={(date) => {this.setState({date: date}), console.log(this.state)}}\n+        />\n+        <Text style={s.title}>Hours:</Text>\n+        <DatePicker\n+          style={s.timePicker}\n+          date={this.state.time}\n+          mode=\"time\"\n+          placeholder={''}\n+          format='HH : mm'\n+          confirmBtnText=\"Confirm\"\n+          cancelBtnText=\"Cancel\"\n+          customStyles={cs.timePicker}\n+          onDateChange={(time) => {this.setState({time: time}), console.log(this.state)}}\n+        />\n+        <Text style={s.warningText}>Warning text</Text>\n+        <View style={s.bottomContainer}>\n+          <Button\n+            buttonStyle={s.goButton}\n+            textStyle={s.goButtonText}\n+            title=\"GO FOR IT\"\n+            onPress={this.handleGo}\n+          />\n+        </View>\n+      </View>\n+    );\n+  }\n+}\n+\n+const mapStateToProps = (state) => ({","path":"go-for-eat/screens/CreateEvent/CreateEvent.js","position":131,"original_position":131,"commit_id":"dbe893e4c98b40c5f46c55bb4d2929c1f3a54466","original_commit_id":"dbe893e4c98b40c5f46c55bb4d2929c1f3a54466","user":{"login":"vidocco","id":30317944,"avatar_url":"https://avatars0.githubusercontent.com/u/30317944?v=4","gravatar_id":"","url":"https://api.github.com/users/vidocco","html_url":"https://github.com/vidocco","followers_url":"https://api.github.com/users/vidocco/followers","following_url":"https://api.github.com/users/vidocco/following{/other_user}","gists_url":"https://api.github.com/users/vidocco/gists{/gist_id}","starred_url":"https://api.github.com/users/vidocco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vidocco/subscriptions","organizations_url":"https://api.github.com/users/vidocco/orgs","repos_url":"https://api.github.com/users/vidocco/repos","events_url":"https://api.github.com/users/vidocco/events{/privacy}","received_events_url":"https://api.github.com/users/vidocco/received_events","type":"User","site_admin":false},"body":"not needed.","created_at":"2018-02-03T16:25:02Z","updated_at":"2018-02-03T16:31:50Z","html_url":"https://github.com/redspanner/go-for-eat-client/pull/17#discussion_r165818553","pull_request_url":"https://api.github.com/repos/redspanner/go-for-eat-client/pulls/17","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/redspanner/go-for-eat-client/pulls/comments/165818553"},"html":{"href":"https://github.com/redspanner/go-for-eat-client/pull/17#discussion_r165818553"},"pull_request":{"href":"https://api.github.com/repos/redspanner/go-for-eat-client/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/redspanner/go-for-eat-client/pulls/17","id":166918296,"html_url":"https://github.com/redspanner/go-for-eat-client/pull/17","diff_url":"https://github.com/redspanner/go-for-eat-client/pull/17.diff","patch_url":"https://github.com/redspanner/go-for-eat-client/pull/17.patch","issue_url":"https://api.github.com/repos/redspanner/go-for-eat-client/issues/17","number":17,"state":"open","locked":false,"title":"For Jack with love","user":{"login":"sergipt","id":12625986,"avatar_url":"https://avatars1.githubusercontent.com/u/12625986?v=4","gravatar_id":"","url":"https://api.github.com/users/sergipt","html_url":"https://github.com/sergipt","followers_url":"https://api.github.com/users/sergipt/followers","following_url":"https://api.github.com/users/sergipt/following{/other_user}","gists_url":"https://api.github.com/users/sergipt/gists{/gist_id}","starred_url":"https://api.github.com/users/sergipt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergipt/subscriptions","organizations_url":"https://api.github.com/users/sergipt/orgs","repos_url":"https://api.github.com/users/sergipt/repos","events_url":"https://api.github.com/users/sergipt/events{/privacy}","received_events_url":"https://api.github.com/users/sergipt/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-02T22:28:02Z","updated_at":"2018-02-03T16:31:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"abd17b8320b44d2915462623c41e55d3a590352a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/redspanner/go-for-eat-client/pulls/17/commits","review_comments_url":"https://api.github.com/repos/redspanner/go-for-eat-client/pulls/17/comments","review_comment_url":"https://api.github.com/repos/redspanner/go-for-eat-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/redspanner/go-for-eat-client/issues/17/comments","statuses_url":"https://api.github.com/repos/redspanner/go-for-eat-client/statuses/dbe893e4c98b40c5f46c55bb4d2929c1f3a54466","head":{"label":"redspanner:develop","ref":"develop","sha":"dbe893e4c98b40c5f46c55bb4d2929c1f3a54466","user":{"login":"redspanner","id":29866145,"avatar_url":"https://avatars1.githubusercontent.com/u/29866145?v=4","gravatar_id":"","url":"https://api.github.com/users/redspanner","html_url":"https://github.com/redspanner","followers_url":"https://api.github.com/users/redspanner/followers","following_url":"https://api.github.com/users/redspanner/following{/other_user}","gists_url":"https://api.github.com/users/redspanner/gists{/gist_id}","starred_url":"https://api.github.com/users/redspanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redspanner/subscriptions","organizations_url":"https://api.github.com/users/redspanner/orgs","repos_url":"https://api.github.com/users/redspanner/repos","events_url":"https://api.github.com/users/redspanner/events{/privacy}","received_events_url":"https://api.github.com/users/redspanner/received_events","type":"User","site_admin":false},"repo":{"id":118919261,"name":"go-for-eat-client","full_name":"redspanner/go-for-eat-client","owner":{"login":"redspanner","id":29866145,"avatar_url":"https://avatars1.githubusercontent.com/u/29866145?v=4","gravatar_id":"","url":"https://api.github.com/users/redspanner","html_url":"https://github.com/redspanner","followers_url":"https://api.github.com/users/redspanner/followers","following_url":"https://api.github.com/users/redspanner/following{/other_user}","gists_url":"https://api.github.com/users/redspanner/gists{/gist_id}","starred_url":"https://api.github.com/users/redspanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redspanner/subscriptions","organizations_url":"https://api.github.com/users/redspanner/orgs","repos_url":"https://api.github.com/users/redspanner/repos","events_url":"https://api.github.com/users/redspanner/events{/privacy}","received_events_url":"https://api.github.com/users/redspanner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/redspanner/go-for-eat-client","description":null,"fork":false,"url":"https://api.github.com/repos/redspanner/go-for-eat-client","forks_url":"https://api.github.com/repos/redspanner/go-for-eat-client/forks","keys_url":"https://api.github.com/repos/redspanner/go-for-eat-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/redspanner/go-for-eat-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/redspanner/go-for-eat-client/teams","hooks_url":"https://api.github.com/repos/redspanner/go-for-eat-client/hooks","issue_events_url":"https://api.github.com/repos/redspanner/go-for-eat-client/issues/events{/number}","events_url":"https://api.github.com/repos/redspanner/go-for-eat-client/events","assignees_url":"https://api.github.com/repos/redspanner/go-for-eat-client/assignees{/user}","branches_url":"https://api.github.com/repos/redspanner/go-for-eat-client/branches{/branch}","tags_url":"https://api.github.com/repos/redspanner/go-for-eat-client/tags","blobs_url":"https://api.github.com/repos/redspanner/go-for-eat-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/redspanner/go-for-eat-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/redspanner/go-for-eat-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/redspanner/go-for-eat-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/redspanner/go-for-eat-client/statuses/{sha}","languages_url":"https://api.github.com/repos/redspanner/go-for-eat-client/languages","stargazers_url":"https://api.github.com/repos/redspanner/go-for-eat-client/stargazers","contributors_url":"https://api.github.com/repos/redspanner/go-for-eat-client/contributors","subscribers_url":"https://api.github.com/repos/redspanner/go-for-eat-client/subscribers","subscription_url":"https://api.github.com/repos/redspanner/go-for-eat-client/subscription","commits_url":"https://api.github.com/repos/redspanner/go-for-eat-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/redspanner/go-for-eat-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/redspanner/go-for-eat-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/redspanner/go-for-eat-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/redspanner/go-for-eat-client/contents/{+path}","compare_url":"https://api.github.com/repos/redspanner/go-for-eat-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/redspanner/go-for-eat-client/merges","archive_url":"https://api.github.com/repos/redspanner/go-for-eat-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/redspanner/go-for-eat-client/downloads","issues_url":"https://api.github.com/repos/redspanner/go-for-eat-client/issues{/number}","pulls_url":"https://api.github.com/repos/redspanner/go-for-eat-client/pulls{/number}","milestones_url":"https://api.github.com/repos/redspanner/go-for-eat-client/milestones{/number}","notifications_url":"https://api.github.com/repos/redspanner/go-for-eat-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/redspanner/go-for-eat-client/labels{/name}","releases_url":"https://api.github.com/repos/redspanner/go-for-eat-client/releases{/id}","deployments_url":"https://api.github.com/repos/redspanner/go-for-eat-client/deployments","created_at":"2018-01-25T13:57:12Z","updated_at":"2018-01-26T13:36:26Z","pushed_at":"2018-02-02T22:28:02Z","git_url":"git://github.com/redspanner/go-for-eat-client.git","ssh_url":"git@github.com:redspanner/go-for-eat-client.git","clone_url":"https://github.com/redspanner/go-for-eat-client.git","svn_url":"https://github.com/redspanner/go-for-eat-client","homepage":null,"size":1891,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"redspanner:master","ref":"master","sha":"7d33ac2367819ab9eeb0b29b36022b4ddb3eaed5","user":{"login":"redspanner","id":29866145,"avatar_url":"https://avatars1.githubusercontent.com/u/29866145?v=4","gravatar_id":"","url":"https://api.github.com/users/redspanner","html_url":"https://github.com/redspanner","followers_url":"https://api.github.com/users/redspanner/followers","following_url":"https://api.github.com/users/redspanner/following{/other_user}","gists_url":"https://api.github.com/users/redspanner/gists{/gist_id}","starred_url":"https://api.github.com/users/redspanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redspanner/subscriptions","organizations_url":"https://api.github.com/users/redspanner/orgs","repos_url":"https://api.github.com/users/redspanner/repos","events_url":"https://api.github.com/users/redspanner/events{/privacy}","received_events_url":"https://api.github.com/users/redspanner/received_events","type":"User","site_admin":false},"repo":{"id":118919261,"name":"go-for-eat-client","full_name":"redspanner/go-for-eat-client","owner":{"login":"redspanner","id":29866145,"avatar_url":"https://avatars1.githubusercontent.com/u/29866145?v=4","gravatar_id":"","url":"https://api.github.com/users/redspanner","html_url":"https://github.com/redspanner","followers_url":"https://api.github.com/users/redspanner/followers","following_url":"https://api.github.com/users/redspanner/following{/other_user}","gists_url":"https://api.github.com/users/redspanner/gists{/gist_id}","starred_url":"https://api.github.com/users/redspanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redspanner/subscriptions","organizations_url":"https://api.github.com/users/redspanner/orgs","repos_url":"https://api.github.com/users/redspanner/repos","events_url":"https://api.github.com/users/redspanner/events{/privacy}","received_events_url":"https://api.github.com/users/redspanner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/redspanner/go-for-eat-client","description":null,"fork":false,"url":"https://api.github.com/repos/redspanner/go-for-eat-client","forks_url":"https://api.github.com/repos/redspanner/go-for-eat-client/forks","keys_url":"https://api.github.com/repos/redspanner/go-for-eat-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/redspanner/go-for-eat-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/redspanner/go-for-eat-client/teams","hooks_url":"https://api.github.com/repos/redspanner/go-for-eat-client/hooks","issue_events_url":"https://api.github.com/repos/redspanner/go-for-eat-client/issues/events{/number}","events_url":"https://api.github.com/repos/redspanner/go-for-eat-client/events","assignees_url":"https://api.github.com/repos/redspanner/go-for-eat-client/assignees{/user}","branches_url":"https://api.github.com/repos/redspanner/go-for-eat-client/branches{/branch}","tags_url":"https://api.github.com/repos/redspanner/go-for-eat-client/tags","blobs_url":"https://api.github.com/repos/redspanner/go-for-eat-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/redspanner/go-for-eat-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/redspanner/go-for-eat-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/redspanner/go-for-eat-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/redspanner/go-for-eat-client/statuses/{sha}","languages_url":"https://api.github.com/repos/redspanner/go-for-eat-client/languages","stargazers_url":"https://api.github.com/repos/redspanner/go-for-eat-client/stargazers","contributors_url":"https://api.github.com/repos/redspanner/go-for-eat-client/contributors","subscribers_url":"https://api.github.com/repos/redspanner/go-for-eat-client/subscribers","subscription_url":"https://api.github.com/repos/redspanner/go-for-eat-client/subscription","commits_url":"https://api.github.com/repos/redspanner/go-for-eat-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/redspanner/go-for-eat-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/redspanner/go-for-eat-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/redspanner/go-for-eat-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/redspanner/go-for-eat-client/contents/{+path}","compare_url":"https://api.github.com/repos/redspanner/go-for-eat-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/redspanner/go-for-eat-client/merges","archive_url":"https://api.github.com/repos/redspanner/go-for-eat-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/redspanner/go-for-eat-client/downloads","issues_url":"https://api.github.com/repos/redspanner/go-for-eat-client/issues{/number}","pulls_url":"https://api.github.com/repos/redspanner/go-for-eat-client/pulls{/number}","milestones_url":"https://api.github.com/repos/redspanner/go-for-eat-client/milestones{/number}","notifications_url":"https://api.github.com/repos/redspanner/go-for-eat-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/redspanner/go-for-eat-client/labels{/name}","releases_url":"https://api.github.com/repos/redspanner/go-for-eat-client/releases{/id}","deployments_url":"https://api.github.com/repos/redspanner/go-for-eat-client/deployments","created_at":"2018-01-25T13:57:12Z","updated_at":"2018-01-26T13:36:26Z","pushed_at":"2018-02-02T22:28:02Z","git_url":"git://github.com/redspanner/go-for-eat-client.git","ssh_url":"git@github.com:redspanner/go-for-eat-client.git","clone_url":"https://github.com/redspanner/go-for-eat-client.git","svn_url":"https://github.com/redspanner/go-for-eat-client","homepage":null,"size":1891,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/redspanner/go-for-eat-client/pulls/17"},"html":{"href":"https://github.com/redspanner/go-for-eat-client/pull/17"},"issue":{"href":"https://api.github.com/repos/redspanner/go-for-eat-client/issues/17"},"comments":{"href":"https://api.github.com/repos/redspanner/go-for-eat-client/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/redspanner/go-for-eat-client/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/redspanner/go-for-eat-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/redspanner/go-for-eat-client/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/redspanner/go-for-eat-client/statuses/dbe893e4c98b40c5f46c55bb4d2929c1f3a54466"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"vidocco"}}