{"action":"created","comment":{"url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/pulls/comments/235249006","pull_request_review_id":177071254,"id":235249006,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTI0OTAwNg==","diff_hunk":"@@ -16,6 +19,126 @@ class App extends Component {\n       </div>\n     );\n   }\n-}\n+\tconstructor() {\n+\t\tsuper();\n+\t\tthis.state = {\n+            contactS: [],\n+            contac:contacts\n+\t\t};\n+    }\n+     componentWillMount(){\n+        //llamar a nuestras elementos del state\n+        let {contac,contactS}= this.state;\n+         //insertar los primeros 5 a nuestro array ContactS\n+        contactS = contac.splice(0,5)\n+        //setear el nuevo contactS para que se vean los cambios\n+        this.setState({contactS})\n+        //este nada mas es un console para ver si si hay 5 \n+        console.log(\"tengo algo\",contactS)\n+     }\n+    \n+     //esta funcion es para general uno random \n+    handleClick = () => {\n+         //llamanos a contactS para poderle hace un push al final\n+        let{contactS}=this.state;\n+        console.log(\"original\",contactS)\n+        // creamos esta variable para quitar los primeros 5 del arreglo original\n+        let remaining = this.state.contac.slice(5);\n+        //esta variable es el elemento random que se agrega a contactS\n+        let item = remaining[Math.floor(Math.random()*remaining.length)];\n+        console.log(\"nuvo\",item);\n+        //se hace un push a contactS\n+        contactS.push(item)\n+        //contactS=item\n+         //seteamos para reflejar cambios\n+        this.setState({contactS});\n+      };\n+\n+      //funcion para arreglar por nombre\n+    sortByName = () => {\n+      //lamar a contacts del state\n+      let{contactS} = this.state;\n+      //funcion con operador ternario para comparar por nombre\n+      contactS.sort((a, b) => a.name !== b.name ? a.name < b.name ? -1 : 1 : 0);\n+      //seteamos para cambios\n+      this.setState({contactS})\n+    }\n+\n+        //funcion para arreglar por popularidad\n+    sortByPopularity = () => {\n+      //lamar a contacts del state\n+      let{contactS} = this.state;\n+      //funcion sencilla para comparar por popularidad\n+      contactS.sort((a, b) => b.popularity - a.popularity);\n+      //seteamos para cambios\n+      this.setState({contactS})\n+    }\n+\n+\n+    deleteArtist = (i) => {\n+      let {contactS} = this.state;\n+      contactS = contactS.splice(i,1);\n+      this.setState({contactS});\n+  };\n+\n \n-export default App;\n+ \trender() {\n+\t\treturn (\n+\t\t\t<div className=\"App\">\n+      \n+      <nav class=\"navbar\" role=\"navigation\" aria-label=\"main navigation\">\n+  <div class=\"navbar-brand\">\n+    <a class=\"navbar-item\" href=\"https://bulma.io\">\n+      <img src=\"/cinema.jpg\" height=\"500\"/>\n+    </a>\n+\n+    <a role=\"button\" class=\"navbar-burger burger\" aria-label=\"menu\" aria-expanded=\"false\" data-target=\"navbarBasicExample\">\n+      <span aria-hidden=\"true\"></span>\n+      <span aria-hidden=\"true\"></span>\n+      <span aria-hidden=\"true\"></span>\n+    </a>\n+  </div>\n+\n+    <div class=\"navbar-end\">\n+      <div class=\"navbar-item\">\n+        <div class=\"buttons\">\n+          <a class=\"button is-primary\" onClick={this.handleClick}>\n+            <strong>Add a Random Contact</strong>\n+          </a>\n+          <a class=\"button is-primary\" onClick={this.sortByName}>\n+            <strong>Sort by Name</strong>\n+          </a>\n+          <a class=\"button is-primary\" onClick={this.sortByPopularity}>\n+            <strong>Sort by Popularity</strong>\n+          </a>\n+        </div>\n+      </div>\n+    </div>\n+</nav>  \n+      ","path":"starter-code/src/App.js","position":115,"original_position":115,"commit_id":"23220224327c40bf6a5eb3438f29eecb8eef87a2","original_commit_id":"23220224327c40bf6a5eb3438f29eecb8eef87a2","user":{"login":"ta-web-mex","id":35221964,"node_id":"MDQ6VXNlcjM1MjIxOTY0","avatar_url":"https://avatars1.githubusercontent.com/u/35221964?v=4","gravatar_id":"","url":"https://api.github.com/users/ta-web-mex","html_url":"https://github.com/ta-web-mex","followers_url":"https://api.github.com/users/ta-web-mex/followers","following_url":"https://api.github.com/users/ta-web-mex/following{/other_user}","gists_url":"https://api.github.com/users/ta-web-mex/gists{/gist_id}","starred_url":"https://api.github.com/users/ta-web-mex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ta-web-mex/subscriptions","organizations_url":"https://api.github.com/users/ta-web-mex/orgs","repos_url":"https://api.github.com/users/ta-web-mex/repos","events_url":"https://api.github.com/users/ta-web-mex/events{/privacy}","received_events_url":"https://api.github.com/users/ta-web-mex/received_events","type":"User","site_admin":false},"body":"corregir la indentación ","created_at":"2018-11-21T04:14:14Z","updated_at":"2018-11-21T04:15:48Z","html_url":"https://github.com/ironhack-labs/lab-react-ironcontacts/pull/57#discussion_r235249006","pull_request_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/pulls/57","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/pulls/comments/235249006"},"html":{"href":"https://github.com/ironhack-labs/lab-react-ironcontacts/pull/57#discussion_r235249006"},"pull_request":{"href":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/pulls/57"}}},"pull_request":{"url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/pulls/57","id":232473729,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyNDczNzI5","html_url":"https://github.com/ironhack-labs/lab-react-ironcontacts/pull/57","diff_url":"https://github.com/ironhack-labs/lab-react-ironcontacts/pull/57.diff","patch_url":"https://github.com/ironhack-labs/lab-react-ironcontacts/pull/57.patch","issue_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/issues/57","number":57,"state":"open","locked":false,"title":"PP - PT2MEX - Ricardo y Gus","user":{"login":"gzuppa","id":40968747,"node_id":"MDQ6VXNlcjQwOTY4NzQ3","avatar_url":"https://avatars2.githubusercontent.com/u/40968747?v=4","gravatar_id":"","url":"https://api.github.com/users/gzuppa","html_url":"https://github.com/gzuppa","followers_url":"https://api.github.com/users/gzuppa/followers","following_url":"https://api.github.com/users/gzuppa/following{/other_user}","gists_url":"https://api.github.com/users/gzuppa/gists{/gist_id}","starred_url":"https://api.github.com/users/gzuppa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gzuppa/subscriptions","organizations_url":"https://api.github.com/users/gzuppa/orgs","repos_url":"https://api.github.com/users/gzuppa/repos","events_url":"https://api.github.com/users/gzuppa/events{/privacy}","received_events_url":"https://api.github.com/users/gzuppa/received_events","type":"User","site_admin":false},"body":"Lucas no colaboró","created_at":"2018-11-20T22:03:58Z","updated_at":"2018-11-21T04:15:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"35d28b8f63dfd4472ffecb7257a9d836829a92fe","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/pulls/57/commits","review_comments_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/pulls/57/comments","review_comment_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/issues/57/comments","statuses_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/statuses/23220224327c40bf6a5eb3438f29eecb8eef87a2","head":{"label":"gzuppa:master","ref":"master","sha":"23220224327c40bf6a5eb3438f29eecb8eef87a2","user":{"login":"gzuppa","id":40968747,"node_id":"MDQ6VXNlcjQwOTY4NzQ3","avatar_url":"https://avatars2.githubusercontent.com/u/40968747?v=4","gravatar_id":"","url":"https://api.github.com/users/gzuppa","html_url":"https://github.com/gzuppa","followers_url":"https://api.github.com/users/gzuppa/followers","following_url":"https://api.github.com/users/gzuppa/following{/other_user}","gists_url":"https://api.github.com/users/gzuppa/gists{/gist_id}","starred_url":"https://api.github.com/users/gzuppa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gzuppa/subscriptions","organizations_url":"https://api.github.com/users/gzuppa/orgs","repos_url":"https://api.github.com/users/gzuppa/repos","events_url":"https://api.github.com/users/gzuppa/events{/privacy}","received_events_url":"https://api.github.com/users/gzuppa/received_events","type":"User","site_admin":false},"repo":{"id":158011083,"node_id":"MDEwOlJlcG9zaXRvcnkxNTgwMTEwODM=","name":"lab-react-ironcontacts","full_name":"gzuppa/lab-react-ironcontacts","private":false,"owner":{"login":"gzuppa","id":40968747,"node_id":"MDQ6VXNlcjQwOTY4NzQ3","avatar_url":"https://avatars2.githubusercontent.com/u/40968747?v=4","gravatar_id":"","url":"https://api.github.com/users/gzuppa","html_url":"https://github.com/gzuppa","followers_url":"https://api.github.com/users/gzuppa/followers","following_url":"https://api.github.com/users/gzuppa/following{/other_user}","gists_url":"https://api.github.com/users/gzuppa/gists{/gist_id}","starred_url":"https://api.github.com/users/gzuppa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gzuppa/subscriptions","organizations_url":"https://api.github.com/users/gzuppa/orgs","repos_url":"https://api.github.com/users/gzuppa/repos","events_url":"https://api.github.com/users/gzuppa/events{/privacy}","received_events_url":"https://api.github.com/users/gzuppa/received_events","type":"User","site_admin":false},"html_url":"https://github.com/gzuppa/lab-react-ironcontacts","description":null,"fork":true,"url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts","forks_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/forks","keys_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/teams","hooks_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/hooks","issue_events_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/issues/events{/number}","events_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/events","assignees_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/assignees{/user}","branches_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/branches{/branch}","tags_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/tags","blobs_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/git/refs{/sha}","trees_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/statuses/{sha}","languages_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/languages","stargazers_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/stargazers","contributors_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/contributors","subscribers_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/subscribers","subscription_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/subscription","commits_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/commits{/sha}","git_commits_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/git/commits{/sha}","comments_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/comments{/number}","issue_comment_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/issues/comments{/number}","contents_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/contents/{+path}","compare_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/merges","archive_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/downloads","issues_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/issues{/number}","pulls_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/pulls{/number}","milestones_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/milestones{/number}","notifications_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/labels{/name}","releases_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/releases{/id}","deployments_url":"https://api.github.com/repos/gzuppa/lab-react-ironcontacts/deployments","created_at":"2018-11-17T18:05:27Z","updated_at":"2018-11-20T22:05:59Z","pushed_at":"2018-11-20T22:05:57Z","git_url":"git://github.com/gzuppa/lab-react-ironcontacts.git","ssh_url":"git@github.com:gzuppa/lab-react-ironcontacts.git","clone_url":"https://github.com/gzuppa/lab-react-ironcontacts.git","svn_url":"https://github.com/gzuppa/lab-react-ironcontacts","homepage":null,"size":330,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ironhack-labs:master","ref":"master","sha":"c69967ae9bef86d461138a4f69c5ad5815b00213","user":{"login":"ironhack-labs","id":25032046,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDMyMDQ2","avatar_url":"https://avatars3.githubusercontent.com/u/25032046?v=4","gravatar_id":"","url":"https://api.github.com/users/ironhack-labs","html_url":"https://github.com/ironhack-labs","followers_url":"https://api.github.com/users/ironhack-labs/followers","following_url":"https://api.github.com/users/ironhack-labs/following{/other_user}","gists_url":"https://api.github.com/users/ironhack-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/ironhack-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironhack-labs/subscriptions","organizations_url":"https://api.github.com/users/ironhack-labs/orgs","repos_url":"https://api.github.com/users/ironhack-labs/repos","events_url":"https://api.github.com/users/ironhack-labs/events{/privacy}","received_events_url":"https://api.github.com/users/ironhack-labs/received_events","type":"Organization","site_admin":false},"repo":{"id":141992421,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE5OTI0MjE=","name":"lab-react-ironcontacts","full_name":"ironhack-labs/lab-react-ironcontacts","private":false,"owner":{"login":"ironhack-labs","id":25032046,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDMyMDQ2","avatar_url":"https://avatars3.githubusercontent.com/u/25032046?v=4","gravatar_id":"","url":"https://api.github.com/users/ironhack-labs","html_url":"https://github.com/ironhack-labs","followers_url":"https://api.github.com/users/ironhack-labs/followers","following_url":"https://api.github.com/users/ironhack-labs/following{/other_user}","gists_url":"https://api.github.com/users/ironhack-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/ironhack-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironhack-labs/subscriptions","organizations_url":"https://api.github.com/users/ironhack-labs/orgs","repos_url":"https://api.github.com/users/ironhack-labs/repos","events_url":"https://api.github.com/users/ironhack-labs/events{/privacy}","received_events_url":"https://api.github.com/users/ironhack-labs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ironhack-labs/lab-react-ironcontacts","description":null,"fork":false,"url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts","forks_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/forks","keys_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/teams","hooks_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/hooks","issue_events_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/issues/events{/number}","events_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/events","assignees_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/assignees{/user}","branches_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/branches{/branch}","tags_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/tags","blobs_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/git/refs{/sha}","trees_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/statuses/{sha}","languages_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/languages","stargazers_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/stargazers","contributors_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/contributors","subscribers_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/subscribers","subscription_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/subscription","commits_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/commits{/sha}","git_commits_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/git/commits{/sha}","comments_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/comments{/number}","issue_comment_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/issues/comments{/number}","contents_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/contents/{+path}","compare_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/merges","archive_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/downloads","issues_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/issues{/number}","pulls_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/pulls{/number}","milestones_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/milestones{/number}","notifications_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/labels{/name}","releases_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/releases{/id}","deployments_url":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/deployments","created_at":"2018-07-23T09:30:07Z","updated_at":"2018-09-21T21:59:07Z","pushed_at":"2018-11-21T01:09:55Z","git_url":"git://github.com/ironhack-labs/lab-react-ironcontacts.git","ssh_url":"git@github.com:ironhack-labs/lab-react-ironcontacts.git","clone_url":"https://github.com/ironhack-labs/lab-react-ironcontacts.git","svn_url":"https://github.com/ironhack-labs/lab-react-ironcontacts","homepage":null,"size":126,"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":165,"mirror_url":null,"archived":false,"open_issues_count":22,"license":null,"forks":165,"open_issues":22,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/pulls/57"},"html":{"href":"https://github.com/ironhack-labs/lab-react-ironcontacts/pull/57"},"issue":{"href":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/issues/57"},"comments":{"href":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/issues/57/comments"},"review_comments":{"href":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/pulls/57/comments"},"review_comment":{"href":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/pulls/57/commits"},"statuses":{"href":"https://api.github.com/repos/ironhack-labs/lab-react-ironcontacts/statuses/23220224327c40bf6a5eb3438f29eecb8eef87a2"}},"author_association":"NONE"}}
{"actor":{"display_login":"ta-web-mex"}}