{"action":"created","comment":{"url":"https://api.github.com/repos/capsulajs/capsulahub-ui/pulls/comments/218406299","pull_request_review_id":156334865,"id":218406299,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODQwNjI5OQ==","diff_hunk":"@@ -0,0 +1,118 @@\n+import React from 'react';\n+import styled from 'styled-components';\n+import { defaultFontFamily } from '../constants';\n+\n+const Container = styled.div`\n+  font-family: ${defaultFontFamily};\n+  font-size: 12px;\n+  font-weight: 500;\n+  background: #737373;\n+  color: #B1B1B1;\n+  width: 100%;\n+  max-width: 300px;\n+`;\n+\n+const Header = styled.div`\n+  font-family: ${defaultFontFamily};\n+  font-style: regular;\n+  font-size: 12px;\n+  width: calc(100% - 20px);\n+  height: 30px;\n+  line-height: 30px;\n+  padding-left: 10px;\n+  padding-right: 10px;\n+  border: none;\n+  display: flex;\n+  flex-direction: row;\n+  justify-content: space-between;\n+  cursor: pointer;\n+`;\n+\n+const Title = styled.div``;\n+\n+const ArrowDown = styled.div`\n+  width: 5px;\n+  height: 5px;\n+  margin-top: 10px;\n+  border: solid #B1B1B1 1px;\n+  border-width: 0 2px 2px 0;\n+  transform: rotate(45deg);\n+  -webkit-transform: rotate(45deg);\n+`;\n+\n+const ArrowUp = styled.div`\n+  width: 5px;\n+  height: 5px;\n+  margin-top: 12px;\n+  border: solid #B1B1B1 1px;\n+  border-width: 0 2px 2px 0;\n+  transform: rotate(-135deg);\n+  -webkit-transform: rotate(-135deg);\n+`;\n+\n+const List = styled.ul`\n+  position: absolute;\n+  z-index: 99;\n+  list-style-type: none;\n+  background: #737373;\n+  margin: 0;\n+  padding: 0;\n+  width: 300px;\n+`;\n+\n+const Item = styled.li`\n+  text-decoration: none;\n+  padding: 10px;\n+  border-bottom: solid #5F5F5F 1px;\n+  :first-child { border-top: solid #5F5F5F 1px; }\n+  :last-child { border-bottom: none; }\n+  cursor: pointer;\n+`;\n+\n+class Dropdown extends React.Component {\n+  constructor(props){\n+    super(props);\n+    \n+    this.state = {\n+      isOpen: false,\n+      title: this.props.title,\n+      items: this.props.items || [],\n+      selected: null\n+    }\n+  }\n+  \n+  handleClickOutside() {\n+    this.setState({\n+      isOpen: false\n+    });\n+  }\n+  \n+  toggle() {\n+    this.setState(prevState => ({\n+      isOpen: !prevState.isOpen\n+    }));\n+  }\n+  \n+  select(selected) {\n+    this.setState({ selected });\n+    this.toggle();\n+  }\n+  \n+  render() {\n+    const { title,items, selected, isOpen } = this.state;\n+    \n+    return (<Container>\n+      <Header onClick={() => this.toggle()}>\n+        <Title>{Number.isInteger(selected) ? items[selected].label : title}</Title>\n+        {isOpen ? <ArrowUp/> : <ArrowDown/>}\n+      </Header>\n+      {this.state.isOpen &&","path":"src/lib/form/dropdown.js","position":109,"original_position":109,"commit_id":"53ee71377006bd26c9493c66d52494b527dc1d49","original_commit_id":"f1d13d254222177ac1e1dac849ed53bdf6a34b91","user":{"login":"taras-shedenko","id":32277464,"node_id":"MDQ6VXNlcjMyMjc3NDY0","avatar_url":"https://avatars2.githubusercontent.com/u/32277464?v=4","gravatar_id":"","url":"https://api.github.com/users/taras-shedenko","html_url":"https://github.com/taras-shedenko","followers_url":"https://api.github.com/users/taras-shedenko/followers","following_url":"https://api.github.com/users/taras-shedenko/following{/other_user}","gists_url":"https://api.github.com/users/taras-shedenko/gists{/gist_id}","starred_url":"https://api.github.com/users/taras-shedenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taras-shedenko/subscriptions","organizations_url":"https://api.github.com/users/taras-shedenko/orgs","repos_url":"https://api.github.com/users/taras-shedenko/repos","events_url":"https://api.github.com/users/taras-shedenko/events{/privacy}","received_events_url":"https://api.github.com/users/taras-shedenko/received_events","type":"User","site_admin":false},"body":"use isOpen instead of this.state.isOpen","created_at":"2018-09-18T12:14:32Z","updated_at":"2018-09-18T12:14:32Z","html_url":"https://github.com/capsulajs/capsulahub-ui/pull/1#discussion_r218406299","pull_request_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/capsulajs/capsulahub-ui/pulls/comments/218406299"},"html":{"href":"https://github.com/capsulajs/capsulahub-ui/pull/1#discussion_r218406299"},"pull_request":{"href":"https://api.github.com/repos/capsulajs/capsulahub-ui/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/capsulajs/capsulahub-ui/pulls/1","id":213526626,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzNTI2NjI2","html_url":"https://github.com/capsulajs/capsulahub-ui/pull/1","diff_url":"https://github.com/capsulajs/capsulahub-ui/pull/1.diff","patch_url":"https://github.com/capsulajs/capsulahub-ui/pull/1.patch","issue_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/issues/1","number":1,"state":"open","locked":false,"title":"MPA-6137-CapsulaHub-UI-controls-library","user":{"login":"sergiupadure","id":14937682,"node_id":"MDQ6VXNlcjE0OTM3Njgy","avatar_url":"https://avatars0.githubusercontent.com/u/14937682?v=4","gravatar_id":"","url":"https://api.github.com/users/sergiupadure","html_url":"https://github.com/sergiupadure","followers_url":"https://api.github.com/users/sergiupadure/followers","following_url":"https://api.github.com/users/sergiupadure/following{/other_user}","gists_url":"https://api.github.com/users/sergiupadure/gists{/gist_id}","starred_url":"https://api.github.com/users/sergiupadure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergiupadure/subscriptions","organizations_url":"https://api.github.com/users/sergiupadure/orgs","repos_url":"https://api.github.com/users/sergiupadure/repos","events_url":"https://api.github.com/users/sergiupadure/events{/privacy}","received_events_url":"https://api.github.com/users/sergiupadure/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-06T07:56:29Z","updated_at":"2018-09-18T12:14:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0906117478ca98ab25833aa6c51327e989921979","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/pulls/1/commits","review_comments_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/pulls/1/comments","review_comment_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/issues/1/comments","statuses_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/statuses/53ee71377006bd26c9493c66d52494b527dc1d49","head":{"label":"capsulajs:feature/MPA-6137-CapsulaHub-UI-controls-library","ref":"feature/MPA-6137-CapsulaHub-UI-controls-library","sha":"53ee71377006bd26c9493c66d52494b527dc1d49","user":{"login":"capsulajs","id":40060224,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMDYwMjI0","avatar_url":"https://avatars3.githubusercontent.com/u/40060224?v=4","gravatar_id":"","url":"https://api.github.com/users/capsulajs","html_url":"https://github.com/capsulajs","followers_url":"https://api.github.com/users/capsulajs/followers","following_url":"https://api.github.com/users/capsulajs/following{/other_user}","gists_url":"https://api.github.com/users/capsulajs/gists{/gist_id}","starred_url":"https://api.github.com/users/capsulajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capsulajs/subscriptions","organizations_url":"https://api.github.com/users/capsulajs/orgs","repos_url":"https://api.github.com/users/capsulajs/repos","events_url":"https://api.github.com/users/capsulajs/events{/privacy}","received_events_url":"https://api.github.com/users/capsulajs/received_events","type":"Organization","site_admin":false},"repo":{"id":147314448,"node_id":"MDEwOlJlcG9zaXRvcnkxNDczMTQ0NDg=","name":"capsulahub-ui","full_name":"capsulajs/capsulahub-ui","private":false,"owner":{"login":"capsulajs","id":40060224,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMDYwMjI0","avatar_url":"https://avatars3.githubusercontent.com/u/40060224?v=4","gravatar_id":"","url":"https://api.github.com/users/capsulajs","html_url":"https://github.com/capsulajs","followers_url":"https://api.github.com/users/capsulajs/followers","following_url":"https://api.github.com/users/capsulajs/following{/other_user}","gists_url":"https://api.github.com/users/capsulajs/gists{/gist_id}","starred_url":"https://api.github.com/users/capsulajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capsulajs/subscriptions","organizations_url":"https://api.github.com/users/capsulajs/orgs","repos_url":"https://api.github.com/users/capsulajs/repos","events_url":"https://api.github.com/users/capsulajs/events{/privacy}","received_events_url":"https://api.github.com/users/capsulajs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/capsulajs/capsulahub-ui","description":null,"fork":false,"url":"https://api.github.com/repos/capsulajs/capsulahub-ui","forks_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/forks","keys_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/teams","hooks_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/hooks","issue_events_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/issues/events{/number}","events_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/events","assignees_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/assignees{/user}","branches_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/branches{/branch}","tags_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/tags","blobs_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/languages","stargazers_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/stargazers","contributors_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/contributors","subscribers_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/subscribers","subscription_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/subscription","commits_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/contents/{+path}","compare_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/merges","archive_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/downloads","issues_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/issues{/number}","pulls_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/labels{/name}","releases_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/releases{/id}","deployments_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/deployments","created_at":"2018-09-04T08:37:05Z","updated_at":"2018-09-04T08:37:08Z","pushed_at":"2018-09-18T12:11:22Z","git_url":"git://github.com/capsulajs/capsulahub-ui.git","ssh_url":"git@github.com:capsulajs/capsulahub-ui.git","clone_url":"https://github.com/capsulajs/capsulahub-ui.git","svn_url":"https://github.com/capsulajs/capsulahub-ui","homepage":null,"size":623,"stargazers_count":0,"watchers_count":0,"language":null,"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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"capsulajs:master","ref":"master","sha":"437733081accc05eb47467c7da6b6715808aeaad","user":{"login":"capsulajs","id":40060224,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMDYwMjI0","avatar_url":"https://avatars3.githubusercontent.com/u/40060224?v=4","gravatar_id":"","url":"https://api.github.com/users/capsulajs","html_url":"https://github.com/capsulajs","followers_url":"https://api.github.com/users/capsulajs/followers","following_url":"https://api.github.com/users/capsulajs/following{/other_user}","gists_url":"https://api.github.com/users/capsulajs/gists{/gist_id}","starred_url":"https://api.github.com/users/capsulajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capsulajs/subscriptions","organizations_url":"https://api.github.com/users/capsulajs/orgs","repos_url":"https://api.github.com/users/capsulajs/repos","events_url":"https://api.github.com/users/capsulajs/events{/privacy}","received_events_url":"https://api.github.com/users/capsulajs/received_events","type":"Organization","site_admin":false},"repo":{"id":147314448,"node_id":"MDEwOlJlcG9zaXRvcnkxNDczMTQ0NDg=","name":"capsulahub-ui","full_name":"capsulajs/capsulahub-ui","private":false,"owner":{"login":"capsulajs","id":40060224,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMDYwMjI0","avatar_url":"https://avatars3.githubusercontent.com/u/40060224?v=4","gravatar_id":"","url":"https://api.github.com/users/capsulajs","html_url":"https://github.com/capsulajs","followers_url":"https://api.github.com/users/capsulajs/followers","following_url":"https://api.github.com/users/capsulajs/following{/other_user}","gists_url":"https://api.github.com/users/capsulajs/gists{/gist_id}","starred_url":"https://api.github.com/users/capsulajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capsulajs/subscriptions","organizations_url":"https://api.github.com/users/capsulajs/orgs","repos_url":"https://api.github.com/users/capsulajs/repos","events_url":"https://api.github.com/users/capsulajs/events{/privacy}","received_events_url":"https://api.github.com/users/capsulajs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/capsulajs/capsulahub-ui","description":null,"fork":false,"url":"https://api.github.com/repos/capsulajs/capsulahub-ui","forks_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/forks","keys_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/teams","hooks_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/hooks","issue_events_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/issues/events{/number}","events_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/events","assignees_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/assignees{/user}","branches_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/branches{/branch}","tags_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/tags","blobs_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/languages","stargazers_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/stargazers","contributors_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/contributors","subscribers_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/subscribers","subscription_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/subscription","commits_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/contents/{+path}","compare_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/merges","archive_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/downloads","issues_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/issues{/number}","pulls_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/labels{/name}","releases_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/releases{/id}","deployments_url":"https://api.github.com/repos/capsulajs/capsulahub-ui/deployments","created_at":"2018-09-04T08:37:05Z","updated_at":"2018-09-04T08:37:08Z","pushed_at":"2018-09-18T12:11:22Z","git_url":"git://github.com/capsulajs/capsulahub-ui.git","ssh_url":"git@github.com:capsulajs/capsulahub-ui.git","clone_url":"https://github.com/capsulajs/capsulahub-ui.git","svn_url":"https://github.com/capsulajs/capsulahub-ui","homepage":null,"size":623,"stargazers_count":0,"watchers_count":0,"language":null,"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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/capsulajs/capsulahub-ui/pulls/1"},"html":{"href":"https://github.com/capsulajs/capsulahub-ui/pull/1"},"issue":{"href":"https://api.github.com/repos/capsulajs/capsulahub-ui/issues/1"},"comments":{"href":"https://api.github.com/repos/capsulajs/capsulahub-ui/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/capsulajs/capsulahub-ui/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/capsulajs/capsulahub-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/capsulajs/capsulahub-ui/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/capsulajs/capsulahub-ui/statuses/53ee71377006bd26c9493c66d52494b527dc1d49"}},"author_association":"NONE"}}
{"actor":{"display_login":"taras-shedenko"}}