|
1 |
| -import React from 'react'; |
| 1 | +import React, { Component } from 'react'; |
2 | 2 | import Logo from '../../assets/logo.png';
|
3 | 3 | import { Container, Form } from './styles';
|
4 | 4 | import CompareList from '../../components/CompareList';
|
5 | 5 |
|
6 |
| -const Main = () => ( |
7 |
| - <Container> |
8 |
| - <img src={Logo} alt="Github Compare" /> |
| 6 | +export default class Main extends Component { |
| 7 | + state = { |
| 8 | + repositories: [ |
| 9 | + { |
| 10 | + id: 10270250, |
| 11 | + node_id: 'MDEwOlJlcG9zaXRvcnkxMDI3MDI1MA==', |
| 12 | + name: 'react', |
| 13 | + full_name: 'facebook/react', |
| 14 | + private: false, |
| 15 | + owner: { |
| 16 | + login: 'facebook', |
| 17 | + id: 69631, |
| 18 | + node_id: 'MDEyOk9yZ2FuaXphdGlvbjY5NjMx', |
| 19 | + avatar_url: 'https://avatars3.githubusercontent.com/u/69631?v=4', |
| 20 | + gravatar_id: '', |
| 21 | + url: 'https://api.github.com/users/facebook', |
| 22 | + html_url: 'https://github.com/facebook', |
| 23 | + followers_url: 'https://api.github.com/users/facebook/followers', |
| 24 | + following_url: 'https://api.github.com/users/facebook/following{/other_user}', |
| 25 | + gists_url: 'https://api.github.com/users/facebook/gists{/gist_id}', |
| 26 | + starred_url: 'https://api.github.com/users/facebook/starred{/owner}{/repo}', |
| 27 | + subscriptions_url: 'https://api.github.com/users/facebook/subscriptions', |
| 28 | + organizations_url: 'https://api.github.com/users/facebook/orgs', |
| 29 | + repos_url: 'https://api.github.com/users/facebook/repos', |
| 30 | + events_url: 'https://api.github.com/users/facebook/events{/privacy}', |
| 31 | + received_events_url: 'https://api.github.com/users/facebook/received_events', |
| 32 | + type: 'Organization', |
| 33 | + site_admin: false, |
| 34 | + }, |
| 35 | + html_url: 'https://github.com/facebook/react', |
| 36 | + description: |
| 37 | + 'A declarative, efficient, and flexible JavaScript library for building user interfaces.', |
| 38 | + fork: false, |
| 39 | + url: 'https://api.github.com/repos/facebook/react', |
| 40 | + forks_url: 'https://api.github.com/repos/facebook/react/forks', |
| 41 | + keys_url: 'https://api.github.com/repos/facebook/react/keys{/key_id}', |
| 42 | + collaborators_url: |
| 43 | + 'https://api.github.com/repos/facebook/react/collaborators{/collaborator}', |
| 44 | + teams_url: 'https://api.github.com/repos/facebook/react/teams', |
| 45 | + hooks_url: 'https://api.github.com/repos/facebook/react/hooks', |
| 46 | + issue_events_url: 'https://api.github.com/repos/facebook/react/issues/events{/number}', |
| 47 | + events_url: 'https://api.github.com/repos/facebook/react/events', |
| 48 | + assignees_url: 'https://api.github.com/repos/facebook/react/assignees{/user}', |
| 49 | + branches_url: 'https://api.github.com/repos/facebook/react/branches{/branch}', |
| 50 | + tags_url: 'https://api.github.com/repos/facebook/react/tags', |
| 51 | + blobs_url: 'https://api.github.com/repos/facebook/react/git/blobs{/sha}', |
| 52 | + git_tags_url: 'https://api.github.com/repos/facebook/react/git/tags{/sha}', |
| 53 | + git_refs_url: 'https://api.github.com/repos/facebook/react/git/refs{/sha}', |
| 54 | + trees_url: 'https://api.github.com/repos/facebook/react/git/trees{/sha}', |
| 55 | + statuses_url: 'https://api.github.com/repos/facebook/react/statuses/{sha}', |
| 56 | + languages_url: 'https://api.github.com/repos/facebook/react/languages', |
| 57 | + stargazers_url: 'https://api.github.com/repos/facebook/react/stargazers', |
| 58 | + contributors_url: 'https://api.github.com/repos/facebook/react/contributors', |
| 59 | + subscribers_url: 'https://api.github.com/repos/facebook/react/subscribers', |
| 60 | + subscription_url: 'https://api.github.com/repos/facebook/react/subscription', |
| 61 | + commits_url: 'https://api.github.com/repos/facebook/react/commits{/sha}', |
| 62 | + git_commits_url: 'https://api.github.com/repos/facebook/react/git/commits{/sha}', |
| 63 | + comments_url: 'https://api.github.com/repos/facebook/react/comments{/number}', |
| 64 | + issue_comment_url: 'https://api.github.com/repos/facebook/react/issues/comments{/number}', |
| 65 | + contents_url: 'https://api.github.com/repos/facebook/react/contents/{+path}', |
| 66 | + compare_url: 'https://api.github.com/repos/facebook/react/compare/{base}...{head}', |
| 67 | + merges_url: 'https://api.github.com/repos/facebook/react/merges', |
| 68 | + archive_url: 'https://api.github.com/repos/facebook/react/{archive_format}{/ref}', |
| 69 | + downloads_url: 'https://api.github.com/repos/facebook/react/downloads', |
| 70 | + issues_url: 'https://api.github.com/repos/facebook/react/issues{/number}', |
| 71 | + pulls_url: 'https://api.github.com/repos/facebook/react/pulls{/number}', |
| 72 | + milestones_url: 'https://api.github.com/repos/facebook/react/milestones{/number}', |
| 73 | + notifications_url: |
| 74 | + 'https://api.github.com/repos/facebook/react/notifications{?since,all,participating}', |
| 75 | + labels_url: 'https://api.github.com/repos/facebook/react/labels{/name}', |
| 76 | + releases_url: 'https://api.github.com/repos/facebook/react/releases{/id}', |
| 77 | + deployments_url: 'https://api.github.com/repos/facebook/react/deployments', |
| 78 | + created_at: '2013-05-24T16:15:54Z', |
| 79 | + updated_at: '2019-03-24T08:04:54Z', |
| 80 | + pushed_at: '2019-03-23T10:40:06Z', |
| 81 | + git_url: 'git://github.com/facebook/react.git', |
| 82 | + ssh_url: 'git@github.com:facebook/react.git', |
| 83 | + clone_url: 'https://github.com/facebook/react.git', |
| 84 | + svn_url: 'https://github.com/facebook/react', |
| 85 | + homepage: 'https://reactjs.org', |
| 86 | + size: 141303, |
| 87 | + stargazers_count: 125151, |
| 88 | + watchers_count: 125151, |
| 89 | + language: 'JavaScript', |
| 90 | + has_issues: true, |
| 91 | + has_projects: true, |
| 92 | + has_downloads: true, |
| 93 | + has_wiki: true, |
| 94 | + has_pages: true, |
| 95 | + forks_count: 22751, |
| 96 | + mirror_url: null, |
| 97 | + archived: false, |
| 98 | + open_issues_count: 601, |
| 99 | + license: { |
| 100 | + key: 'mit', |
| 101 | + name: 'MIT License', |
| 102 | + spdx_id: 'MIT', |
| 103 | + url: 'https://api.github.com/licenses/mit', |
| 104 | + node_id: 'MDc6TGljZW5zZTEz', |
| 105 | + }, |
| 106 | + forks: 22751, |
| 107 | + open_issues: 601, |
| 108 | + watchers: 125151, |
| 109 | + default_branch: 'master', |
| 110 | + organization: { |
| 111 | + login: 'facebook', |
| 112 | + id: 69631, |
| 113 | + node_id: 'MDEyOk9yZ2FuaXphdGlvbjY5NjMx', |
| 114 | + avatar_url: 'https://avatars3.githubusercontent.com/u/69631?v=4', |
| 115 | + gravatar_id: '', |
| 116 | + url: 'https://api.github.com/users/facebook', |
| 117 | + html_url: 'https://github.com/facebook', |
| 118 | + followers_url: 'https://api.github.com/users/facebook/followers', |
| 119 | + following_url: 'https://api.github.com/users/facebook/following{/other_user}', |
| 120 | + gists_url: 'https://api.github.com/users/facebook/gists{/gist_id}', |
| 121 | + starred_url: 'https://api.github.com/users/facebook/starred{/owner}{/repo}', |
| 122 | + subscriptions_url: 'https://api.github.com/users/facebook/subscriptions', |
| 123 | + organizations_url: 'https://api.github.com/users/facebook/orgs', |
| 124 | + repos_url: 'https://api.github.com/users/facebook/repos', |
| 125 | + events_url: 'https://api.github.com/users/facebook/events{/privacy}', |
| 126 | + received_events_url: 'https://api.github.com/users/facebook/received_events', |
| 127 | + type: 'Organization', |
| 128 | + site_admin: false, |
| 129 | + }, |
| 130 | + network_count: 22751, |
| 131 | + subscribers_count: 6650, |
| 132 | + }, |
| 133 | + ], |
| 134 | + }; |
9 | 135 |
|
10 |
| - <Form> |
11 |
| - <input type="text" placeholder="usuário/repositório" /> |
12 |
| - <button type="submit">OK</button> |
13 |
| - </Form> |
| 136 | + render() { |
| 137 | + return ( |
| 138 | + <Container> |
| 139 | + <img src={Logo} alt="Github Compare" /> |
14 | 140 |
|
15 |
| - <CompareList /> |
16 |
| - </Container> |
17 |
| -); |
| 141 | + <Form> |
| 142 | + <input type="text" placeholder="usuário/repositório" /> |
| 143 | + <button type="submit">OK</button> |
| 144 | + </Form> |
18 | 145 |
|
19 |
| -export default Main; |
| 146 | + <CompareList repositories={this.state.repositories} /> |
| 147 | + </Container> |
| 148 | + ); |
| 149 | + } |
| 150 | +} |
0 commit comments