{"action":"created","comment":{"url":"https://api.github.com/repos/wolox-training/ia-react-native/pulls/comments/93239051","pull_request_review_id":13759690,"id":93239051,"diff_hunk":"@@ -1,66 +1,84 @@\n import React, { Component } from 'react';\n+import ReactDOM from 'react-dom'\n+import NotificationBar from './NotificationBar.js';\n import Libro from './Libro.js';\n import './estilos/Dashboard.css'\n import searchIcon from './assets/search.svg'\n-import wbooks_logo from './assets/wbooks_logo.svg'\n-import notifications_icon from './assets/notifications.svg'\n-import add_book_icon from './assets/add_book.svg'\n-import user_icon from './assets/user.png'\n+import data from './datos.json';\n+\n \n class App extends Component {\n   render() {\n     return(\n       <div>\n         <BooksArray />\n       </div>\n-\n     )\n   }\n }\n \n-\n class BooksArray extends Component{\n+  constructor(props){\n+    super(props);\n+    this.state = {value: 'titulo', text: ''};\n+    this.handleChange = this.handleChange.bind(this);\n+    this.update = this.update.bind(this);\n+  }\n+\n+  update(){\n+    let lista = [];\n+    let text = document.getElementById('searchText').value;\n+    text = text.toLowerCase();\n+    let category = ''\n+    if( this.state.value ==='titulo'){\n+      category = 'name';\n+    }else{\n+      category = 'author'\n+    }\n+    // i funciona como key para cada child\n+    let i=0;\n+    if(text===''){\n+      data.results.forEach((book) => {","path":"src/App.js","position":47,"original_position":47,"commit_id":"43de7060a7cf8982cacf5812c371a3e8c5cdce01","original_commit_id":"43de7060a7cf8982cacf5812c371a3e8c5cdce01","user":{"login":"sbalay","id":1928544,"avatar_url":"https://avatars.githubusercontent.com/u/1928544?v=3","gravatar_id":"","url":"https://api.github.com/users/sbalay","html_url":"https://github.com/sbalay","followers_url":"https://api.github.com/users/sbalay/followers","following_url":"https://api.github.com/users/sbalay/following{/other_user}","gists_url":"https://api.github.com/users/sbalay/gists{/gist_id}","starred_url":"https://api.github.com/users/sbalay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbalay/subscriptions","organizations_url":"https://api.github.com/users/sbalay/orgs","repos_url":"https://api.github.com/users/sbalay/repos","events_url":"https://api.github.com/users/sbalay/events{/privacy}","received_events_url":"https://api.github.com/users/sbalay/received_events","type":"User","site_admin":false},"body":"you can use array's `map` and `filter` methods to improve this code\r\n\r\n","created_at":"2016-12-20T13:45:14Z","updated_at":"2016-12-20T13:49:24Z","html_url":"https://github.com/wolox-training/ia-react-native/pull/5#discussion_r93239051","pull_request_url":"https://api.github.com/repos/wolox-training/ia-react-native/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/wolox-training/ia-react-native/pulls/comments/93239051"},"html":{"href":"https://github.com/wolox-training/ia-react-native/pull/5#discussion_r93239051"},"pull_request":{"href":"https://api.github.com/repos/wolox-training/ia-react-native/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/wolox-training/ia-react-native/pulls/5","id":98638715,"html_url":"https://github.com/wolox-training/ia-react-native/pull/5","diff_url":"https://github.com/wolox-training/ia-react-native/pull/5.diff","patch_url":"https://github.com/wolox-training/ia-react-native/pull/5.patch","issue_url":"https://api.github.com/repos/wolox-training/ia-react-native/issues/5","number":5,"state":"open","locked":false,"title":"Dashboard functions","user":{"login":"IgnacioAbadie","id":24418053,"avatar_url":"https://avatars.githubusercontent.com/u/24418053?v=3","gravatar_id":"","url":"https://api.github.com/users/IgnacioAbadie","html_url":"https://github.com/IgnacioAbadie","followers_url":"https://api.github.com/users/IgnacioAbadie/followers","following_url":"https://api.github.com/users/IgnacioAbadie/following{/other_user}","gists_url":"https://api.github.com/users/IgnacioAbadie/gists{/gist_id}","starred_url":"https://api.github.com/users/IgnacioAbadie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgnacioAbadie/subscriptions","organizations_url":"https://api.github.com/users/IgnacioAbadie/orgs","repos_url":"https://api.github.com/users/IgnacioAbadie/repos","events_url":"https://api.github.com/users/IgnacioAbadie/events{/privacy}","received_events_url":"https://api.github.com/users/IgnacioAbadie/received_events","type":"User","site_admin":false},"body":"Summary:\r\n\r\nTo implement the filter use de selector (TITULO-AUTOR) like a parameter and the input text.\r\nwhen user press on the search button, the method update is triggered.\r\n\r\n![captura de pantalla de 2016-12-19 17-46-20](https://cloud.githubusercontent.com/assets/24418053/21328529/2acb0110-c613-11e6-8157-de79672fae51.png)\r\n\r\nIn this method, check the json data using the parameters to select the corrects Books data, and storage <Libro> elements with their corresponding values on a array to render after in a DIV element. The logical allows to find books without using the complete name, eg: the word \"THE\" is converted to lowercase and is searched like part of each string data, returning all books having the word \"the\" in their titles or author name.\r\n\r\n![captura de pantalla de 2016-12-19 17-53-34](https://cloud.githubusercontent.com/assets/24418053/21328739/18cb1f6c-c614-11e6-82eb-bba21c35f210.png)\r\n\r\nALL BOOKs:\r\n![captura de pantalla de 2016-12-19 17-54-25](https://cloud.githubusercontent.com/assets/24418053/21328784/4ab1b676-c614-11e6-8581-93fe5ffe33d6.png)\r\n\r\nsearching \"THE\":\r\n![captura de pantalla de 2016-12-19 17-54-16](https://cloud.githubusercontent.com/assets/24418053/21328801/5c6a4aea-c614-11e6-8c02-3dfae8d58868.png)\r\n\r\nfinally, I added the image of each book .","created_at":"2016-12-19T20:59:31Z","updated_at":"2016-12-20T13:49:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55ee9cd4f53c43c5ff7ad405b4bc26fc3ff98c4d","assignee":{"login":"sbalay","id":1928544,"avatar_url":"https://avatars.githubusercontent.com/u/1928544?v=3","gravatar_id":"","url":"https://api.github.com/users/sbalay","html_url":"https://github.com/sbalay","followers_url":"https://api.github.com/users/sbalay/followers","following_url":"https://api.github.com/users/sbalay/following{/other_user}","gists_url":"https://api.github.com/users/sbalay/gists{/gist_id}","starred_url":"https://api.github.com/users/sbalay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbalay/subscriptions","organizations_url":"https://api.github.com/users/sbalay/orgs","repos_url":"https://api.github.com/users/sbalay/repos","events_url":"https://api.github.com/users/sbalay/events{/privacy}","received_events_url":"https://api.github.com/users/sbalay/received_events","type":"User","site_admin":false},"assignees":[{"login":"sbalay","id":1928544,"avatar_url":"https://avatars.githubusercontent.com/u/1928544?v=3","gravatar_id":"","url":"https://api.github.com/users/sbalay","html_url":"https://github.com/sbalay","followers_url":"https://api.github.com/users/sbalay/followers","following_url":"https://api.github.com/users/sbalay/following{/other_user}","gists_url":"https://api.github.com/users/sbalay/gists{/gist_id}","starred_url":"https://api.github.com/users/sbalay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbalay/subscriptions","organizations_url":"https://api.github.com/users/sbalay/orgs","repos_url":"https://api.github.com/users/sbalay/repos","events_url":"https://api.github.com/users/sbalay/events{/privacy}","received_events_url":"https://api.github.com/users/sbalay/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/wolox-training/ia-react-native/pulls/5/commits","review_comments_url":"https://api.github.com/repos/wolox-training/ia-react-native/pulls/5/comments","review_comment_url":"https://api.github.com/repos/wolox-training/ia-react-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wolox-training/ia-react-native/issues/5/comments","statuses_url":"https://api.github.com/repos/wolox-training/ia-react-native/statuses/43de7060a7cf8982cacf5812c371a3e8c5cdce01","head":{"label":"wolox-training:dashboard_functions","ref":"dashboard_functions","sha":"43de7060a7cf8982cacf5812c371a3e8c5cdce01","user":{"login":"wolox-training","id":14113351,"avatar_url":"https://avatars.githubusercontent.com/u/14113351?v=3","gravatar_id":"","url":"https://api.github.com/users/wolox-training","html_url":"https://github.com/wolox-training","followers_url":"https://api.github.com/users/wolox-training/followers","following_url":"https://api.github.com/users/wolox-training/following{/other_user}","gists_url":"https://api.github.com/users/wolox-training/gists{/gist_id}","starred_url":"https://api.github.com/users/wolox-training/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolox-training/subscriptions","organizations_url":"https://api.github.com/users/wolox-training/orgs","repos_url":"https://api.github.com/users/wolox-training/repos","events_url":"https://api.github.com/users/wolox-training/events{/privacy}","received_events_url":"https://api.github.com/users/wolox-training/received_events","type":"Organization","site_admin":false},"repo":{"id":75636068,"name":"ia-react-native","full_name":"wolox-training/ia-react-native","owner":{"login":"wolox-training","id":14113351,"avatar_url":"https://avatars.githubusercontent.com/u/14113351?v=3","gravatar_id":"","url":"https://api.github.com/users/wolox-training","html_url":"https://github.com/wolox-training","followers_url":"https://api.github.com/users/wolox-training/followers","following_url":"https://api.github.com/users/wolox-training/following{/other_user}","gists_url":"https://api.github.com/users/wolox-training/gists{/gist_id}","starred_url":"https://api.github.com/users/wolox-training/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolox-training/subscriptions","organizations_url":"https://api.github.com/users/wolox-training/orgs","repos_url":"https://api.github.com/users/wolox-training/repos","events_url":"https://api.github.com/users/wolox-training/events{/privacy}","received_events_url":"https://api.github.com/users/wolox-training/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wolox-training/ia-react-native","description":null,"fork":false,"url":"https://api.github.com/repos/wolox-training/ia-react-native","forks_url":"https://api.github.com/repos/wolox-training/ia-react-native/forks","keys_url":"https://api.github.com/repos/wolox-training/ia-react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wolox-training/ia-react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wolox-training/ia-react-native/teams","hooks_url":"https://api.github.com/repos/wolox-training/ia-react-native/hooks","issue_events_url":"https://api.github.com/repos/wolox-training/ia-react-native/issues/events{/number}","events_url":"https://api.github.com/repos/wolox-training/ia-react-native/events","assignees_url":"https://api.github.com/repos/wolox-training/ia-react-native/assignees{/user}","branches_url":"https://api.github.com/repos/wolox-training/ia-react-native/branches{/branch}","tags_url":"https://api.github.com/repos/wolox-training/ia-react-native/tags","blobs_url":"https://api.github.com/repos/wolox-training/ia-react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wolox-training/ia-react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wolox-training/ia-react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/wolox-training/ia-react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wolox-training/ia-react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/wolox-training/ia-react-native/languages","stargazers_url":"https://api.github.com/repos/wolox-training/ia-react-native/stargazers","contributors_url":"https://api.github.com/repos/wolox-training/ia-react-native/contributors","subscribers_url":"https://api.github.com/repos/wolox-training/ia-react-native/subscribers","subscription_url":"https://api.github.com/repos/wolox-training/ia-react-native/subscription","commits_url":"https://api.github.com/repos/wolox-training/ia-react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/wolox-training/ia-react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/wolox-training/ia-react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/wolox-training/ia-react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/wolox-training/ia-react-native/contents/{+path}","compare_url":"https://api.github.com/repos/wolox-training/ia-react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wolox-training/ia-react-native/merges","archive_url":"https://api.github.com/repos/wolox-training/ia-react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wolox-training/ia-react-native/downloads","issues_url":"https://api.github.com/repos/wolox-training/ia-react-native/issues{/number}","pulls_url":"https://api.github.com/repos/wolox-training/ia-react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/wolox-training/ia-react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/wolox-training/ia-react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wolox-training/ia-react-native/labels{/name}","releases_url":"https://api.github.com/repos/wolox-training/ia-react-native/releases{/id}","deployments_url":"https://api.github.com/repos/wolox-training/ia-react-native/deployments","created_at":"2016-12-05T15:03:50Z","updated_at":"2016-12-12T19:47:28Z","pushed_at":"2016-12-19T20:59:31Z","git_url":"git://github.com/wolox-training/ia-react-native.git","ssh_url":"git@github.com:wolox-training/ia-react-native.git","clone_url":"https://github.com/wolox-training/ia-react-native.git","svn_url":"https://github.com/wolox-training/ia-react-native","homepage":null,"size":329,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"wolox-training:development","ref":"development","sha":"4300ec133c759a7c09c80458f966d6485b8c8182","user":{"login":"wolox-training","id":14113351,"avatar_url":"https://avatars.githubusercontent.com/u/14113351?v=3","gravatar_id":"","url":"https://api.github.com/users/wolox-training","html_url":"https://github.com/wolox-training","followers_url":"https://api.github.com/users/wolox-training/followers","following_url":"https://api.github.com/users/wolox-training/following{/other_user}","gists_url":"https://api.github.com/users/wolox-training/gists{/gist_id}","starred_url":"https://api.github.com/users/wolox-training/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolox-training/subscriptions","organizations_url":"https://api.github.com/users/wolox-training/orgs","repos_url":"https://api.github.com/users/wolox-training/repos","events_url":"https://api.github.com/users/wolox-training/events{/privacy}","received_events_url":"https://api.github.com/users/wolox-training/received_events","type":"Organization","site_admin":false},"repo":{"id":75636068,"name":"ia-react-native","full_name":"wolox-training/ia-react-native","owner":{"login":"wolox-training","id":14113351,"avatar_url":"https://avatars.githubusercontent.com/u/14113351?v=3","gravatar_id":"","url":"https://api.github.com/users/wolox-training","html_url":"https://github.com/wolox-training","followers_url":"https://api.github.com/users/wolox-training/followers","following_url":"https://api.github.com/users/wolox-training/following{/other_user}","gists_url":"https://api.github.com/users/wolox-training/gists{/gist_id}","starred_url":"https://api.github.com/users/wolox-training/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolox-training/subscriptions","organizations_url":"https://api.github.com/users/wolox-training/orgs","repos_url":"https://api.github.com/users/wolox-training/repos","events_url":"https://api.github.com/users/wolox-training/events{/privacy}","received_events_url":"https://api.github.com/users/wolox-training/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wolox-training/ia-react-native","description":null,"fork":false,"url":"https://api.github.com/repos/wolox-training/ia-react-native","forks_url":"https://api.github.com/repos/wolox-training/ia-react-native/forks","keys_url":"https://api.github.com/repos/wolox-training/ia-react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wolox-training/ia-react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wolox-training/ia-react-native/teams","hooks_url":"https://api.github.com/repos/wolox-training/ia-react-native/hooks","issue_events_url":"https://api.github.com/repos/wolox-training/ia-react-native/issues/events{/number}","events_url":"https://api.github.com/repos/wolox-training/ia-react-native/events","assignees_url":"https://api.github.com/repos/wolox-training/ia-react-native/assignees{/user}","branches_url":"https://api.github.com/repos/wolox-training/ia-react-native/branches{/branch}","tags_url":"https://api.github.com/repos/wolox-training/ia-react-native/tags","blobs_url":"https://api.github.com/repos/wolox-training/ia-react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wolox-training/ia-react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wolox-training/ia-react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/wolox-training/ia-react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wolox-training/ia-react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/wolox-training/ia-react-native/languages","stargazers_url":"https://api.github.com/repos/wolox-training/ia-react-native/stargazers","contributors_url":"https://api.github.com/repos/wolox-training/ia-react-native/contributors","subscribers_url":"https://api.github.com/repos/wolox-training/ia-react-native/subscribers","subscription_url":"https://api.github.com/repos/wolox-training/ia-react-native/subscription","commits_url":"https://api.github.com/repos/wolox-training/ia-react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/wolox-training/ia-react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/wolox-training/ia-react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/wolox-training/ia-react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/wolox-training/ia-react-native/contents/{+path}","compare_url":"https://api.github.com/repos/wolox-training/ia-react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wolox-training/ia-react-native/merges","archive_url":"https://api.github.com/repos/wolox-training/ia-react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wolox-training/ia-react-native/downloads","issues_url":"https://api.github.com/repos/wolox-training/ia-react-native/issues{/number}","pulls_url":"https://api.github.com/repos/wolox-training/ia-react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/wolox-training/ia-react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/wolox-training/ia-react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wolox-training/ia-react-native/labels{/name}","releases_url":"https://api.github.com/repos/wolox-training/ia-react-native/releases{/id}","deployments_url":"https://api.github.com/repos/wolox-training/ia-react-native/deployments","created_at":"2016-12-05T15:03:50Z","updated_at":"2016-12-12T19:47:28Z","pushed_at":"2016-12-19T20:59:31Z","git_url":"git://github.com/wolox-training/ia-react-native.git","ssh_url":"git@github.com:wolox-training/ia-react-native.git","clone_url":"https://github.com/wolox-training/ia-react-native.git","svn_url":"https://github.com/wolox-training/ia-react-native","homepage":null,"size":329,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wolox-training/ia-react-native/pulls/5"},"html":{"href":"https://github.com/wolox-training/ia-react-native/pull/5"},"issue":{"href":"https://api.github.com/repos/wolox-training/ia-react-native/issues/5"},"comments":{"href":"https://api.github.com/repos/wolox-training/ia-react-native/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/wolox-training/ia-react-native/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/wolox-training/ia-react-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wolox-training/ia-react-native/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/wolox-training/ia-react-native/statuses/43de7060a7cf8982cacf5812c371a3e8c5cdce01"}}}}
{"actor":{"display_login":"sbalay"}}