{"action":"created","comment":{"url":"https://api.github.com/repos/singggum3b/react-components/pulls/comments/79303231","id":79303231,"diff_hunk":"@@ -1,44 +1,52 @@\n-var Layer = React.createClass({\n-\tdisplayName: \"Layer\",\n-\tpropTypes: {\n-\t\tonClick: React.PropTypes.func,\n-\t\tonScroll: React.PropTypes.func,\n-\t\tparent: React.PropTypes.bool,\n-\t\tonWheel: React.PropTypes.func,\n-\t\tclassName: React.PropTypes.string,\n-\t\tstyle: React.PropTypes.string,\n-\t\tchildren: React.PropTypes.node,\n-\t\tallowTouchMove: React.PropTypes.bool\n-\t},\n-\tgetDefaultProps() {\n-\t\treturn {\n-\t\t\tallowTouchMove: false\n-\t\t}\n-\t},\n-\tonClick: function (e) {\n-\t\tif (e.target === e.currentTarget) {\n-\t\t\tthis.props.onClick && this.props.onClick(e);\n-\t\t}\n-\t},\n-\tonWheel(e) {\n-\t\tthis.props.onWheel && this.props.onWheel(e);\n-\t},\n-\trender() {\n-\t\tvar {parent} = this.props;\n-\t\tvar _className = cx({\n-\t\t\t\"b-overlay\": true,\n-\t\t\t\"b-overlay--parent\": !!parent,\n-\t\t\t[this.props.className]: !!this.props.className\n-\t\t});\n+import classNames from \"classnames\";\n+import { propTypes, ReactNode } from \"tcomb-react\";\n+import \"./layer.styl\";\n \n-\t\treturn (\n-\t\t\t<div title=\"Click to close\" className={_className} onWheel={this.onWheel} onClick={this.onClick}\n-\t\t\t\t\t style={this.props.style}\n-\t\t\t\t\t onTouchMove={(e)=>{if (!this.props.allowTouchMove) {e.preventDefault();e.stopPropagation();}}}>\n-\t\t\t\t{this.props.children}\n-\t\t\t</div>\n-\t\t);\n+export type LayerPropsType = {\n+\tonClick?: Function,\n+\tonScroll?: Function,\n+\tparent?: boolean,\n+\tonWheel?: Function,\n+\tclassName?: string,\n+\tchildren?: ReactNode,\n+\tallowTouchMove?: boolean,\n+}\n+\n+export default function Layer(props) {\n+\tconst { parent } = props;\n+\tconst _className = classNames({\n+\t\t\"g-layer\": true,\n+\t\t\"g-layer--parent\": !!parent,\n+\t\t[props.className]: !!props.className\n+\t});\n+\n+\treturn (\n+\t\t<div className={_className} onWheel={onWheel(props)} onClick={onClick(props)}\n+\t\t\t onTouchMove={onTouchMove}>\n+\t\t\t{props.children}\n+\t\t</div>\n+\t);\n+}\n+\n+const onWheel = (props) => (e) => {\n+\tprops.onWheel && props.onWheel(e);\n+};\n+\n+const onClick = (props) => (e) => {\n+\tif (e.target === e.currentTarget) {\n+\t\tprops.onClick && props.onClick(e);\n+\t}\n+};\n+\n+function onTouchMove(e) {\n+\tif (!props.allowTouchMove) {","path":"layer/layer.js","position":81,"original_position":81,"commit_id":"10c0380e5a4c9d7b11e664d7e45f243ced81475d","original_commit_id":"10c0380e5a4c9d7b11e664d7e45f243ced81475d","user":{"login":"singggum3b","id":5172112,"avatar_url":"https://avatars.githubusercontent.com/u/5172112?v=3","gravatar_id":"","url":"https://api.github.com/users/singggum3b","html_url":"https://github.com/singggum3b","followers_url":"https://api.github.com/users/singggum3b/followers","following_url":"https://api.github.com/users/singggum3b/following{/other_user}","gists_url":"https://api.github.com/users/singggum3b/gists{/gist_id}","starred_url":"https://api.github.com/users/singggum3b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singggum3b/subscriptions","organizations_url":"https://api.github.com/users/singggum3b/orgs","repos_url":"https://api.github.com/users/singggum3b/repos","events_url":"https://api.github.com/users/singggum3b/events{/privacy}","received_events_url":"https://api.github.com/users/singggum3b/received_events","type":"User","site_admin":false},"body":"very nice rewrite 👍 ","created_at":"2016-09-18T10:56:53Z","updated_at":"2016-09-18T11:00:58Z","html_url":"https://github.com/singggum3b/react-components/pull/4#discussion_r79303231","pull_request_url":"https://api.github.com/repos/singggum3b/react-components/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/singggum3b/react-components/pulls/comments/79303231"},"html":{"href":"https://github.com/singggum3b/react-components/pull/4#discussion_r79303231"},"pull_request":{"href":"https://api.github.com/repos/singggum3b/react-components/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/singggum3b/react-components/pulls/4","id":85428042,"html_url":"https://github.com/singggum3b/react-components/pull/4","diff_url":"https://github.com/singggum3b/react-components/pull/4.diff","patch_url":"https://github.com/singggum3b/react-components/pull/4.patch","issue_url":"https://api.github.com/repos/singggum3b/react-components/issues/4","number":4,"state":"open","locked":false,"title":"Migrate/layer","user":{"login":"mvtnghia","id":8247063,"avatar_url":"https://avatars.githubusercontent.com/u/8247063?v=3","gravatar_id":"","url":"https://api.github.com/users/mvtnghia","html_url":"https://github.com/mvtnghia","followers_url":"https://api.github.com/users/mvtnghia/followers","following_url":"https://api.github.com/users/mvtnghia/following{/other_user}","gists_url":"https://api.github.com/users/mvtnghia/gists{/gist_id}","starred_url":"https://api.github.com/users/mvtnghia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvtnghia/subscriptions","organizations_url":"https://api.github.com/users/mvtnghia/orgs","repos_url":"https://api.github.com/users/mvtnghia/repos","events_url":"https://api.github.com/users/mvtnghia/events{/privacy}","received_events_url":"https://api.github.com/users/mvtnghia/received_events","type":"User","site_admin":false},"body":"--Migrate Layer","created_at":"2016-09-15T15:38:02Z","updated_at":"2016-09-18T11:00:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"652b00dda1fbe7ff1e2da2cc03227b0345f06bde","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/singggum3b/react-components/pulls/4/commits","review_comments_url":"https://api.github.com/repos/singggum3b/react-components/pulls/4/comments","review_comment_url":"https://api.github.com/repos/singggum3b/react-components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/singggum3b/react-components/issues/4/comments","statuses_url":"https://api.github.com/repos/singggum3b/react-components/statuses/10c0380e5a4c9d7b11e664d7e45f243ced81475d","head":{"label":"singggum3b:migrate/layer","ref":"migrate/layer","sha":"10c0380e5a4c9d7b11e664d7e45f243ced81475d","user":{"login":"singggum3b","id":5172112,"avatar_url":"https://avatars.githubusercontent.com/u/5172112?v=3","gravatar_id":"","url":"https://api.github.com/users/singggum3b","html_url":"https://github.com/singggum3b","followers_url":"https://api.github.com/users/singggum3b/followers","following_url":"https://api.github.com/users/singggum3b/following{/other_user}","gists_url":"https://api.github.com/users/singggum3b/gists{/gist_id}","starred_url":"https://api.github.com/users/singggum3b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singggum3b/subscriptions","organizations_url":"https://api.github.com/users/singggum3b/orgs","repos_url":"https://api.github.com/users/singggum3b/repos","events_url":"https://api.github.com/users/singggum3b/events{/privacy}","received_events_url":"https://api.github.com/users/singggum3b/received_events","type":"User","site_admin":false},"repo":{"id":66096662,"name":"react-components","full_name":"singggum3b/react-components","owner":{"login":"singggum3b","id":5172112,"avatar_url":"https://avatars.githubusercontent.com/u/5172112?v=3","gravatar_id":"","url":"https://api.github.com/users/singggum3b","html_url":"https://github.com/singggum3b","followers_url":"https://api.github.com/users/singggum3b/followers","following_url":"https://api.github.com/users/singggum3b/following{/other_user}","gists_url":"https://api.github.com/users/singggum3b/gists{/gist_id}","starred_url":"https://api.github.com/users/singggum3b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singggum3b/subscriptions","organizations_url":"https://api.github.com/users/singggum3b/orgs","repos_url":"https://api.github.com/users/singggum3b/repos","events_url":"https://api.github.com/users/singggum3b/events{/privacy}","received_events_url":"https://api.github.com/users/singggum3b/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/singggum3b/react-components","description":null,"fork":false,"url":"https://api.github.com/repos/singggum3b/react-components","forks_url":"https://api.github.com/repos/singggum3b/react-components/forks","keys_url":"https://api.github.com/repos/singggum3b/react-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/singggum3b/react-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/singggum3b/react-components/teams","hooks_url":"https://api.github.com/repos/singggum3b/react-components/hooks","issue_events_url":"https://api.github.com/repos/singggum3b/react-components/issues/events{/number}","events_url":"https://api.github.com/repos/singggum3b/react-components/events","assignees_url":"https://api.github.com/repos/singggum3b/react-components/assignees{/user}","branches_url":"https://api.github.com/repos/singggum3b/react-components/branches{/branch}","tags_url":"https://api.github.com/repos/singggum3b/react-components/tags","blobs_url":"https://api.github.com/repos/singggum3b/react-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/singggum3b/react-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/singggum3b/react-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/singggum3b/react-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/singggum3b/react-components/statuses/{sha}","languages_url":"https://api.github.com/repos/singggum3b/react-components/languages","stargazers_url":"https://api.github.com/repos/singggum3b/react-components/stargazers","contributors_url":"https://api.github.com/repos/singggum3b/react-components/contributors","subscribers_url":"https://api.github.com/repos/singggum3b/react-components/subscribers","subscription_url":"https://api.github.com/repos/singggum3b/react-components/subscription","commits_url":"https://api.github.com/repos/singggum3b/react-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/singggum3b/react-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/singggum3b/react-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/singggum3b/react-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/singggum3b/react-components/contents/{+path}","compare_url":"https://api.github.com/repos/singggum3b/react-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/singggum3b/react-components/merges","archive_url":"https://api.github.com/repos/singggum3b/react-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/singggum3b/react-components/downloads","issues_url":"https://api.github.com/repos/singggum3b/react-components/issues{/number}","pulls_url":"https://api.github.com/repos/singggum3b/react-components/pulls{/number}","milestones_url":"https://api.github.com/repos/singggum3b/react-components/milestones{/number}","notifications_url":"https://api.github.com/repos/singggum3b/react-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/singggum3b/react-components/labels{/name}","releases_url":"https://api.github.com/repos/singggum3b/react-components/releases{/id}","deployments_url":"https://api.github.com/repos/singggum3b/react-components/deployments","created_at":"2016-08-19T16:32:29Z","updated_at":"2016-08-19T16:52:42Z","pushed_at":"2016-09-18T10:51:13Z","git_url":"git://github.com/singggum3b/react-components.git","ssh_url":"git@github.com:singggum3b/react-components.git","clone_url":"https://github.com/singggum3b/react-components.git","svn_url":"https://github.com/singggum3b/react-components","homepage":null,"size":51,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"singggum3b:master","ref":"master","sha":"cf2ecc0929aab13adf86d1e66198d2c8e80298b0","user":{"login":"singggum3b","id":5172112,"avatar_url":"https://avatars.githubusercontent.com/u/5172112?v=3","gravatar_id":"","url":"https://api.github.com/users/singggum3b","html_url":"https://github.com/singggum3b","followers_url":"https://api.github.com/users/singggum3b/followers","following_url":"https://api.github.com/users/singggum3b/following{/other_user}","gists_url":"https://api.github.com/users/singggum3b/gists{/gist_id}","starred_url":"https://api.github.com/users/singggum3b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singggum3b/subscriptions","organizations_url":"https://api.github.com/users/singggum3b/orgs","repos_url":"https://api.github.com/users/singggum3b/repos","events_url":"https://api.github.com/users/singggum3b/events{/privacy}","received_events_url":"https://api.github.com/users/singggum3b/received_events","type":"User","site_admin":false},"repo":{"id":66096662,"name":"react-components","full_name":"singggum3b/react-components","owner":{"login":"singggum3b","id":5172112,"avatar_url":"https://avatars.githubusercontent.com/u/5172112?v=3","gravatar_id":"","url":"https://api.github.com/users/singggum3b","html_url":"https://github.com/singggum3b","followers_url":"https://api.github.com/users/singggum3b/followers","following_url":"https://api.github.com/users/singggum3b/following{/other_user}","gists_url":"https://api.github.com/users/singggum3b/gists{/gist_id}","starred_url":"https://api.github.com/users/singggum3b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singggum3b/subscriptions","organizations_url":"https://api.github.com/users/singggum3b/orgs","repos_url":"https://api.github.com/users/singggum3b/repos","events_url":"https://api.github.com/users/singggum3b/events{/privacy}","received_events_url":"https://api.github.com/users/singggum3b/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/singggum3b/react-components","description":null,"fork":false,"url":"https://api.github.com/repos/singggum3b/react-components","forks_url":"https://api.github.com/repos/singggum3b/react-components/forks","keys_url":"https://api.github.com/repos/singggum3b/react-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/singggum3b/react-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/singggum3b/react-components/teams","hooks_url":"https://api.github.com/repos/singggum3b/react-components/hooks","issue_events_url":"https://api.github.com/repos/singggum3b/react-components/issues/events{/number}","events_url":"https://api.github.com/repos/singggum3b/react-components/events","assignees_url":"https://api.github.com/repos/singggum3b/react-components/assignees{/user}","branches_url":"https://api.github.com/repos/singggum3b/react-components/branches{/branch}","tags_url":"https://api.github.com/repos/singggum3b/react-components/tags","blobs_url":"https://api.github.com/repos/singggum3b/react-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/singggum3b/react-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/singggum3b/react-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/singggum3b/react-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/singggum3b/react-components/statuses/{sha}","languages_url":"https://api.github.com/repos/singggum3b/react-components/languages","stargazers_url":"https://api.github.com/repos/singggum3b/react-components/stargazers","contributors_url":"https://api.github.com/repos/singggum3b/react-components/contributors","subscribers_url":"https://api.github.com/repos/singggum3b/react-components/subscribers","subscription_url":"https://api.github.com/repos/singggum3b/react-components/subscription","commits_url":"https://api.github.com/repos/singggum3b/react-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/singggum3b/react-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/singggum3b/react-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/singggum3b/react-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/singggum3b/react-components/contents/{+path}","compare_url":"https://api.github.com/repos/singggum3b/react-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/singggum3b/react-components/merges","archive_url":"https://api.github.com/repos/singggum3b/react-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/singggum3b/react-components/downloads","issues_url":"https://api.github.com/repos/singggum3b/react-components/issues{/number}","pulls_url":"https://api.github.com/repos/singggum3b/react-components/pulls{/number}","milestones_url":"https://api.github.com/repos/singggum3b/react-components/milestones{/number}","notifications_url":"https://api.github.com/repos/singggum3b/react-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/singggum3b/react-components/labels{/name}","releases_url":"https://api.github.com/repos/singggum3b/react-components/releases{/id}","deployments_url":"https://api.github.com/repos/singggum3b/react-components/deployments","created_at":"2016-08-19T16:32:29Z","updated_at":"2016-08-19T16:52:42Z","pushed_at":"2016-09-18T10:51:13Z","git_url":"git://github.com/singggum3b/react-components.git","ssh_url":"git@github.com:singggum3b/react-components.git","clone_url":"https://github.com/singggum3b/react-components.git","svn_url":"https://github.com/singggum3b/react-components","homepage":null,"size":51,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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/singggum3b/react-components/pulls/4"},"html":{"href":"https://github.com/singggum3b/react-components/pull/4"},"issue":{"href":"https://api.github.com/repos/singggum3b/react-components/issues/4"},"comments":{"href":"https://api.github.com/repos/singggum3b/react-components/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/singggum3b/react-components/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/singggum3b/react-components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/singggum3b/react-components/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/singggum3b/react-components/statuses/10c0380e5a4c9d7b11e664d7e45f243ced81475d"}}}}
{"actor":{"display_login":"singggum3b"}}