{"action":"created","comment":{"url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/pulls/comments/242325070","pull_request_review_id":185809731,"id":242325070,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MjMyNTA3MA==","diff_hunk":"@@ -1,71 +1,80 @@\n+// @flow\n+\n import React, { Component } from 'react';\n-import { StyleSheet, View, Text } from 'react-native';\n+import { StyleSheet, View, Text, Button } from 'react-native';\n import { ListItem } from 'react-native-elements';\n-import { getQuestions } from '../../utils/api';\n-import { Ionicons } from '@expo/vector-icons';\n import { connect } from 'react-redux';\n-import { handleGetQuestions } from '../../actions/questions';\n+import Swipeout from 'react-native-swipeout';\n+import { WHITE, RED } from '../../utils/colors';\n+import { getQuestions, activateQuestion, deleteQuestion } from '../../services/questions.service';\n+import type { Questions } from '../../types/question.type';\n+\n+/* TODO: Question titles longer than X character should be abbreviated */\n+/* TODO: Rip the error reporting out into a HOC */\n+/* TODO: Create a loading component instead of using the message */\n \n class QuestionList extends Component {\n-  state = {\n-    selectedQuestions: []\n-  }\n   componentDidMount() {\n-    this.props.dispatch(handleGetQuestions());\n+    this.props.handleGetQuestions();\n   }\n-  handlePressQuestion(questionId) {\n-\n-    const { selectedQuestions } = this.state;\n-\n-    if (selectedQuestions.find(sq => sq === questionId)) {\n-      this.setState({\n-        selectedQuestions: selectedQuestions.filter(sq => sq !== questionId)\n-      });\n-    } else {\n-      this.setState({\n-        selectedQuestions: [\n-          ...selectedQuestions,\n-          questionId\n-        ]\n-      });\n-    }\n-  }\n-\n   render() {\n     const { questions } = this.props;\n-    const { selectedQuestions } = this.state\n+    const { error } = this.props;\n \n     return (\n       <View style={styles.container}>\n         {\n-          questions\n+          error\n           ? <View>\n-            {\n-              Object.keys(questions).map((key, index) => (\n-                <ListItem\n-                  checkmark={selectedQuestions.includes(questions[key].id)}\n-                  key={questions[key].id}\n-                  title={questions[key].text}\n-                  onPress={this.handlePressQuestion.bind(this, questions[key].id)}\n-                  rightIcon={questions[key].active && <View style={styles.greenCircle}/>}\n-                  rightTitle={questions[key].active ? \"Active\" : \"\"}\n-                />\n-              ))\n-            }\n-          </View>\n-          : <View><Text>Loading...</Text></View>\n+              <Text>Something went wrong!</Text>\n+              <Text>{error.message}</Text>\n+            </View>\n+          : questions\n+            ? <View>\n+                {\n+                  questions.map((question) => (\n+                    <Swipeout \n+                      key={question.id}\n+                      right={[{\n+                        text: 'Delete',\n+                        color: WHITE,\n+                        backgroundColor: RED,\n+                        onPress: () => this.props.handleDeleteQuestion(question.id)\n+                      }]}\n+                    >\n+                      <ListItem\n+                        title={question.text}\n+                        onPress={() => this.props.handleActivateQuestion(question)}","path":"components/question-list/question-list.component.js","position":null,"original_position":89,"commit_id":"6ae7db26a2ed2619b3617713458138368c52de01","original_commit_id":"ff6946f9eb8f8b648475e1742c6a550354408f82","user":{"login":"chalb500","id":20652367,"node_id":"MDQ6VXNlcjIwNjUyMzY3","avatar_url":"https://avatars2.githubusercontent.com/u/20652367?v=4","gravatar_id":"","url":"https://api.github.com/users/chalb500","html_url":"https://github.com/chalb500","followers_url":"https://api.github.com/users/chalb500/followers","following_url":"https://api.github.com/users/chalb500/following{/other_user}","gists_url":"https://api.github.com/users/chalb500/gists{/gist_id}","starred_url":"https://api.github.com/users/chalb500/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chalb500/subscriptions","organizations_url":"https://api.github.com/users/chalb500/orgs","repos_url":"https://api.github.com/users/chalb500/repos","events_url":"https://api.github.com/users/chalb500/events{/privacy}","received_events_url":"https://api.github.com/users/chalb500/received_events","type":"User","site_admin":false},"body":"Resolved in [6ae7db2](url)","created_at":"2018-12-17T21:37:11Z","updated_at":"2018-12-17T21:37:11Z","html_url":"https://github.com/UDigStudio/uMeet_Front_End/pull/22#discussion_r242325070","pull_request_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/pulls/22","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/pulls/comments/242325070"},"html":{"href":"https://github.com/UDigStudio/uMeet_Front_End/pull/22#discussion_r242325070"},"pull_request":{"href":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/pulls/22"}},"in_reply_to_id":236088488},"pull_request":{"url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/pulls/22","id":229241702,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5MjQxNzAy","html_url":"https://github.com/UDigStudio/uMeet_Front_End/pull/22","diff_url":"https://github.com/UDigStudio/uMeet_Front_End/pull/22.diff","patch_url":"https://github.com/UDigStudio/uMeet_Front_End/pull/22.patch","issue_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/issues/22","number":22,"state":"open","locked":false,"title":"bottom navigator; slide to delete question; wired question activate to redux","user":{"login":"chalb500","id":20652367,"node_id":"MDQ6VXNlcjIwNjUyMzY3","avatar_url":"https://avatars2.githubusercontent.com/u/20652367?v=4","gravatar_id":"","url":"https://api.github.com/users/chalb500","html_url":"https://github.com/chalb500","followers_url":"https://api.github.com/users/chalb500/followers","following_url":"https://api.github.com/users/chalb500/following{/other_user}","gists_url":"https://api.github.com/users/chalb500/gists{/gist_id}","starred_url":"https://api.github.com/users/chalb500/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chalb500/subscriptions","organizations_url":"https://api.github.com/users/chalb500/orgs","repos_url":"https://api.github.com/users/chalb500/repos","events_url":"https://api.github.com/users/chalb500/events{/privacy}","received_events_url":"https://api.github.com/users/chalb500/received_events","type":"User","site_admin":false},"body":"bottom navigator; slide to delete question; wired question activate to redux","created_at":"2018-11-08T03:45:51Z","updated_at":"2018-12-17T21:37:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3b11c6be625ea1e9f65ae781a4af996920211ef","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/pulls/22/commits","review_comments_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/pulls/22/comments","review_comment_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/issues/22/comments","statuses_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/statuses/6ae7db26a2ed2619b3617713458138368c52de01","head":{"label":"chalb500:master","ref":"master","sha":"6ae7db26a2ed2619b3617713458138368c52de01","user":{"login":"chalb500","id":20652367,"node_id":"MDQ6VXNlcjIwNjUyMzY3","avatar_url":"https://avatars2.githubusercontent.com/u/20652367?v=4","gravatar_id":"","url":"https://api.github.com/users/chalb500","html_url":"https://github.com/chalb500","followers_url":"https://api.github.com/users/chalb500/followers","following_url":"https://api.github.com/users/chalb500/following{/other_user}","gists_url":"https://api.github.com/users/chalb500/gists{/gist_id}","starred_url":"https://api.github.com/users/chalb500/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chalb500/subscriptions","organizations_url":"https://api.github.com/users/chalb500/orgs","repos_url":"https://api.github.com/users/chalb500/repos","events_url":"https://api.github.com/users/chalb500/events{/privacy}","received_events_url":"https://api.github.com/users/chalb500/received_events","type":"User","site_admin":false},"repo":{"id":151325133,"node_id":"MDEwOlJlcG9zaXRvcnkxNTEzMjUxMzM=","name":"uMeet_Front_End","full_name":"chalb500/uMeet_Front_End","private":false,"owner":{"login":"chalb500","id":20652367,"node_id":"MDQ6VXNlcjIwNjUyMzY3","avatar_url":"https://avatars2.githubusercontent.com/u/20652367?v=4","gravatar_id":"","url":"https://api.github.com/users/chalb500","html_url":"https://github.com/chalb500","followers_url":"https://api.github.com/users/chalb500/followers","following_url":"https://api.github.com/users/chalb500/following{/other_user}","gists_url":"https://api.github.com/users/chalb500/gists{/gist_id}","starred_url":"https://api.github.com/users/chalb500/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chalb500/subscriptions","organizations_url":"https://api.github.com/users/chalb500/orgs","repos_url":"https://api.github.com/users/chalb500/repos","events_url":"https://api.github.com/users/chalb500/events{/privacy}","received_events_url":"https://api.github.com/users/chalb500/received_events","type":"User","site_admin":false},"html_url":"https://github.com/chalb500/uMeet_Front_End","description":"Front end React Native app of uMeet application.","fork":true,"url":"https://api.github.com/repos/chalb500/uMeet_Front_End","forks_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/forks","keys_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/teams","hooks_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/hooks","issue_events_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/issues/events{/number}","events_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/events","assignees_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/assignees{/user}","branches_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/branches{/branch}","tags_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/tags","blobs_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/git/refs{/sha}","trees_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/statuses/{sha}","languages_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/languages","stargazers_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/stargazers","contributors_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/contributors","subscribers_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/subscribers","subscription_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/subscription","commits_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/commits{/sha}","git_commits_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/git/commits{/sha}","comments_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/comments{/number}","issue_comment_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/issues/comments{/number}","contents_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/contents/{+path}","compare_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/merges","archive_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/downloads","issues_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/issues{/number}","pulls_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/pulls{/number}","milestones_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/milestones{/number}","notifications_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/labels{/name}","releases_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/releases{/id}","deployments_url":"https://api.github.com/repos/chalb500/uMeet_Front_End/deployments","created_at":"2018-10-02T21:21:41Z","updated_at":"2018-12-17T21:36:48Z","pushed_at":"2018-12-17T21:36:46Z","git_url":"git://github.com/chalb500/uMeet_Front_End.git","ssh_url":"git@github.com:chalb500/uMeet_Front_End.git","clone_url":"https://github.com/chalb500/uMeet_Front_End.git","svn_url":"https://github.com/chalb500/uMeet_Front_End","homepage":null,"size":602,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"UDigStudio:master","ref":"master","sha":"9be2d555ab54b31fc3669bd183efac4cd9693781","user":{"login":"UDigStudio","id":17730359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NzMwMzU5","avatar_url":"https://avatars3.githubusercontent.com/u/17730359?v=4","gravatar_id":"","url":"https://api.github.com/users/UDigStudio","html_url":"https://github.com/UDigStudio","followers_url":"https://api.github.com/users/UDigStudio/followers","following_url":"https://api.github.com/users/UDigStudio/following{/other_user}","gists_url":"https://api.github.com/users/UDigStudio/gists{/gist_id}","starred_url":"https://api.github.com/users/UDigStudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UDigStudio/subscriptions","organizations_url":"https://api.github.com/users/UDigStudio/orgs","repos_url":"https://api.github.com/users/UDigStudio/repos","events_url":"https://api.github.com/users/UDigStudio/events{/privacy}","received_events_url":"https://api.github.com/users/UDigStudio/received_events","type":"Organization","site_admin":false},"repo":{"id":151317551,"node_id":"MDEwOlJlcG9zaXRvcnkxNTEzMTc1NTE=","name":"uMeet_Front_End","full_name":"UDigStudio/uMeet_Front_End","private":false,"owner":{"login":"UDigStudio","id":17730359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NzMwMzU5","avatar_url":"https://avatars3.githubusercontent.com/u/17730359?v=4","gravatar_id":"","url":"https://api.github.com/users/UDigStudio","html_url":"https://github.com/UDigStudio","followers_url":"https://api.github.com/users/UDigStudio/followers","following_url":"https://api.github.com/users/UDigStudio/following{/other_user}","gists_url":"https://api.github.com/users/UDigStudio/gists{/gist_id}","starred_url":"https://api.github.com/users/UDigStudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UDigStudio/subscriptions","organizations_url":"https://api.github.com/users/UDigStudio/orgs","repos_url":"https://api.github.com/users/UDigStudio/repos","events_url":"https://api.github.com/users/UDigStudio/events{/privacy}","received_events_url":"https://api.github.com/users/UDigStudio/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/UDigStudio/uMeet_Front_End","description":"Front end React Native app of uMeet application.","fork":false,"url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End","forks_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/forks","keys_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/teams","hooks_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/hooks","issue_events_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/issues/events{/number}","events_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/events","assignees_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/assignees{/user}","branches_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/branches{/branch}","tags_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/tags","blobs_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/git/refs{/sha}","trees_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/statuses/{sha}","languages_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/languages","stargazers_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/stargazers","contributors_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/contributors","subscribers_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/subscribers","subscription_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/subscription","commits_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/commits{/sha}","git_commits_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/git/commits{/sha}","comments_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/comments{/number}","issue_comment_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/issues/comments{/number}","contents_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/contents/{+path}","compare_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/merges","archive_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/downloads","issues_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/issues{/number}","pulls_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/pulls{/number}","milestones_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/milestones{/number}","notifications_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/labels{/name}","releases_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/releases{/id}","deployments_url":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/deployments","created_at":"2018-10-02T20:18:02Z","updated_at":"2018-11-01T12:34:57Z","pushed_at":"2018-12-17T21:36:48Z","git_url":"git://github.com/UDigStudio/uMeet_Front_End.git","ssh_url":"git@github.com:UDigStudio/uMeet_Front_End.git","clone_url":"https://github.com/UDigStudio/uMeet_Front_End.git","svn_url":"https://github.com/UDigStudio/uMeet_Front_End","homepage":null,"size":394,"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":6,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":6,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/pulls/22"},"html":{"href":"https://github.com/UDigStudio/uMeet_Front_End/pull/22"},"issue":{"href":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/issues/22"},"comments":{"href":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/UDigStudio/uMeet_Front_End/statuses/6ae7db26a2ed2619b3617713458138368c52de01"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"chalb500"}}