{"action":"created","comment":{"url":"https://api.github.com/repos/wix/wix-style-react/pulls/comments/239754288","pull_request_review_id":182624766,"id":239754288,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTc1NDI4OA==","diff_hunk":"@@ -0,0 +1,93 @@\n+import React from 'react';\n+import PropTypes from 'prop-types';\n+import styles from './Counter.scss';\n+\n+import Heading from '../Heading';\n+import Button from '../Button';\n+\n+class Counter extends React.PureComponent {\n+  static displayName = 'Counter';\n+\n+  static propTypes = {\n+    dataHook: PropTypes.string,\n+\n+    /** The initial count */\n+    initialCount: PropTypes.number,\n+    /** Callback funtion to be called when the count has been changed. Signature is `onCountUpdate(newCount)`. */\n+    onCountUpdate: PropTypes.func,\n+    /** Text for the increment button */\n+    incrementText: PropTypes.string,\n+    /** Text for the decrement button */\n+    decrementText: PropTypes.string,\n+\n+    /** Theme of the buttons */\n+    theme: Button.propTypes.theme,\n+  };\n+\n+  static defaultProps = {\n+    initialCount: 0,\n+    onCountUpdate: () => {},\n+    incrementText: '+',\n+    decrementText: '-',\n+  };\n+\n+  constructor(props) {\n+    super(props);\n+\n+    this.state = {\n+      count: props.initialCount || 0,\n+    };\n+  }\n+\n+  handleIncrement = () => {\n+    this.setState(\n+      ({ count }) => ({\n+        count: count + 1,\n+      }),\n+      () => {\n+        this.props.onCountUpdate(this.state.count);\n+      },\n+    );\n+  };\n+\n+  handleDecrement = () => {\n+    this.setState(\n+      ({ count }) => ({\n+        count: count - 1,\n+      }),\n+      () => {\n+        this.props.onCountUpdate(this.state.count);\n+      },\n+    );\n+  };\n+\n+  render() {\n+    const { count } = this.state;\n+    const { dataHook, incrementText, decrementText, theme } = this.props;\n+\n+    return (\n+      <div className={styles.root} data-hook={dataHook}>\n+        <Heading dataHook=\"counter-count\">{count}</Heading>\n+\n+        <div className={styles.buttons}>\n+          <Button\n+            onClick={this.handleDecrement}\n+            theme={theme}\n+            dataHook=\"counter-decrement\"\n+          >\n+            {decrementText}\n+          </Button>\n+          <Button\n+            onClick={this.handleIncrement}\n+            theme={theme}\n+            dataHook=\"counter-increment\"\n+          >\n+            {incrementText}\n+          </Button>\n+        </div>\n+      </div>\n+    );\n+  }\n+}\n+\n+export default Counter;","path":"src/Counter/Counter.js","position":93,"original_position":93,"commit_id":"bb12bc13fe4c3db2acbab9d49ab873f30f0a08d0","original_commit_id":"bb12bc13fe4c3db2acbab9d49ab873f30f0a08d0","user":{"login":"hepiyellow","id":6338722,"node_id":"MDQ6VXNlcjYzMzg3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6338722?v=4","gravatar_id":"","url":"https://api.github.com/users/hepiyellow","html_url":"https://github.com/hepiyellow","followers_url":"https://api.github.com/users/hepiyellow/followers","following_url":"https://api.github.com/users/hepiyellow/following{/other_user}","gists_url":"https://api.github.com/users/hepiyellow/gists{/gist_id}","starred_url":"https://api.github.com/users/hepiyellow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hepiyellow/subscriptions","organizations_url":"https://api.github.com/users/hepiyellow/orgs","repos_url":"https://api.github.com/users/hepiyellow/repos","events_url":"https://api.github.com/users/hepiyellow/events{/privacy}","received_events_url":"https://api.github.com/users/hepiyellow/received_events","type":"User","site_admin":false},"body":"I thought we want to encourage exporting like this:\r\n`export {Counter}`;\r\n\r\nAnd have the default Export only from the `index.js` file.\r\n(For backwards consistency)","created_at":"2018-12-07T10:08:18Z","updated_at":"2018-12-07T10:08:19Z","html_url":"https://github.com/wix/wix-style-react/pull/2543#discussion_r239754288","pull_request_url":"https://api.github.com/repos/wix/wix-style-react/pulls/2543","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/wix/wix-style-react/pulls/comments/239754288"},"html":{"href":"https://github.com/wix/wix-style-react/pull/2543#discussion_r239754288"},"pull_request":{"href":"https://api.github.com/repos/wix/wix-style-react/pulls/2543"}}},"pull_request":{"url":"https://api.github.com/repos/wix/wix-style-react/pulls/2543","id":236533052,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2NTMzMDUy","html_url":"https://github.com/wix/wix-style-react/pull/2543","diff_url":"https://github.com/wix/wix-style-react/pull/2543.diff","patch_url":"https://github.com/wix/wix-style-react/pull/2543.patch","issue_url":"https://api.github.com/repos/wix/wix-style-react/issues/2543","number":2543,"state":"open","locked":false,"title":"[DO NOT MERGE] <Counter/> - template for the component generator","user":{"login":"yardnsm","id":11786506,"node_id":"MDQ6VXNlcjExNzg2NTA2","avatar_url":"https://avatars2.githubusercontent.com/u/11786506?v=4","gravatar_id":"","url":"https://api.github.com/users/yardnsm","html_url":"https://github.com/yardnsm","followers_url":"https://api.github.com/users/yardnsm/followers","following_url":"https://api.github.com/users/yardnsm/following{/other_user}","gists_url":"https://api.github.com/users/yardnsm/gists{/gist_id}","starred_url":"https://api.github.com/users/yardnsm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yardnsm/subscriptions","organizations_url":"https://api.github.com/users/yardnsm/orgs","repos_url":"https://api.github.com/users/yardnsm/repos","events_url":"https://api.github.com/users/yardnsm/events{/privacy}","received_events_url":"https://api.github.com/users/yardnsm/received_events","type":"User","site_admin":false},"body":"**Do not merge this PR, its meant for discussion purposes only.**\r\n\r\nIn order for us to create a great component generator, we first need to define a common component template including our best-practices and conventions. This PR includes a simple `<Counter/>` component, that resembles a new component added to the library.\r\n\r\nEventually, the component generator will generate this exact component, with its test driver and tests, but of course its naming will be different.\r\n\r\nDo you think this is a good template? Please suggest any changes.\r\n\r\n@shlomitc @argshook @mykas @hepiyellow ","created_at":"2018-12-06T13:39:07Z","updated_at":"2018-12-07T10:08:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0b2c4fc8327687546eb6b3d6402831131c88a446","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wix/wix-style-react/pulls/2543/commits","review_comments_url":"https://api.github.com/repos/wix/wix-style-react/pulls/2543/comments","review_comment_url":"https://api.github.com/repos/wix/wix-style-react/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wix/wix-style-react/issues/2543/comments","statuses_url":"https://api.github.com/repos/wix/wix-style-react/statuses/bb12bc13fe4c3db2acbab9d49ab873f30f0a08d0","head":{"label":"wix:tmp/counter-component","ref":"tmp/counter-component","sha":"bb12bc13fe4c3db2acbab9d49ab873f30f0a08d0","user":{"login":"wix","id":686511,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/686511?v=4","gravatar_id":"","url":"https://api.github.com/users/wix","html_url":"https://github.com/wix","followers_url":"https://api.github.com/users/wix/followers","following_url":"https://api.github.com/users/wix/following{/other_user}","gists_url":"https://api.github.com/users/wix/gists{/gist_id}","starred_url":"https://api.github.com/users/wix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wix/subscriptions","organizations_url":"https://api.github.com/users/wix/orgs","repos_url":"https://api.github.com/users/wix/repos","events_url":"https://api.github.com/users/wix/events{/privacy}","received_events_url":"https://api.github.com/users/wix/received_events","type":"Organization","site_admin":false},"repo":{"id":73713311,"node_id":"MDEwOlJlcG9zaXRvcnk3MzcxMzMxMQ==","name":"wix-style-react","full_name":"wix/wix-style-react","private":false,"owner":{"login":"wix","id":686511,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/686511?v=4","gravatar_id":"","url":"https://api.github.com/users/wix","html_url":"https://github.com/wix","followers_url":"https://api.github.com/users/wix/followers","following_url":"https://api.github.com/users/wix/following{/other_user}","gists_url":"https://api.github.com/users/wix/gists{/gist_id}","starred_url":"https://api.github.com/users/wix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wix/subscriptions","organizations_url":"https://api.github.com/users/wix/orgs","repos_url":"https://api.github.com/users/wix/repos","events_url":"https://api.github.com/users/wix/events{/privacy}","received_events_url":"https://api.github.com/users/wix/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/wix/wix-style-react","description":"Common React UI components for all Wix verticals developing in React","fork":false,"url":"https://api.github.com/repos/wix/wix-style-react","forks_url":"https://api.github.com/repos/wix/wix-style-react/forks","keys_url":"https://api.github.com/repos/wix/wix-style-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wix/wix-style-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wix/wix-style-react/teams","hooks_url":"https://api.github.com/repos/wix/wix-style-react/hooks","issue_events_url":"https://api.github.com/repos/wix/wix-style-react/issues/events{/number}","events_url":"https://api.github.com/repos/wix/wix-style-react/events","assignees_url":"https://api.github.com/repos/wix/wix-style-react/assignees{/user}","branches_url":"https://api.github.com/repos/wix/wix-style-react/branches{/branch}","tags_url":"https://api.github.com/repos/wix/wix-style-react/tags","blobs_url":"https://api.github.com/repos/wix/wix-style-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wix/wix-style-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wix/wix-style-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/wix/wix-style-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wix/wix-style-react/statuses/{sha}","languages_url":"https://api.github.com/repos/wix/wix-style-react/languages","stargazers_url":"https://api.github.com/repos/wix/wix-style-react/stargazers","contributors_url":"https://api.github.com/repos/wix/wix-style-react/contributors","subscribers_url":"https://api.github.com/repos/wix/wix-style-react/subscribers","subscription_url":"https://api.github.com/repos/wix/wix-style-react/subscription","commits_url":"https://api.github.com/repos/wix/wix-style-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/wix/wix-style-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/wix/wix-style-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/wix/wix-style-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/wix/wix-style-react/contents/{+path}","compare_url":"https://api.github.com/repos/wix/wix-style-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wix/wix-style-react/merges","archive_url":"https://api.github.com/repos/wix/wix-style-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wix/wix-style-react/downloads","issues_url":"https://api.github.com/repos/wix/wix-style-react/issues{/number}","pulls_url":"https://api.github.com/repos/wix/wix-style-react/pulls{/number}","milestones_url":"https://api.github.com/repos/wix/wix-style-react/milestones{/number}","notifications_url":"https://api.github.com/repos/wix/wix-style-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wix/wix-style-react/labels{/name}","releases_url":"https://api.github.com/repos/wix/wix-style-react/releases{/id}","deployments_url":"https://api.github.com/repos/wix/wix-style-react/deployments","created_at":"2016-11-14T14:37:00Z","updated_at":"2018-12-06T16:26:38Z","pushed_at":"2018-12-07T09:50:53Z","git_url":"git://github.com/wix/wix-style-react.git","ssh_url":"git@github.com:wix/wix-style-react.git","clone_url":"https://github.com/wix/wix-style-react.git","svn_url":"https://github.com/wix/wix-style-react","homepage":"https://wix-wix-style-react.surge.sh","size":10150,"stargazers_count":437,"watchers_count":437,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":96,"mirror_url":null,"archived":false,"open_issues_count":112,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":96,"open_issues":112,"watchers":437,"default_branch":"master"}},"base":{"label":"wix:master","ref":"master","sha":"14759064d183601b8568c3abe71cbee49a4b24a9","user":{"login":"wix","id":686511,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/686511?v=4","gravatar_id":"","url":"https://api.github.com/users/wix","html_url":"https://github.com/wix","followers_url":"https://api.github.com/users/wix/followers","following_url":"https://api.github.com/users/wix/following{/other_user}","gists_url":"https://api.github.com/users/wix/gists{/gist_id}","starred_url":"https://api.github.com/users/wix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wix/subscriptions","organizations_url":"https://api.github.com/users/wix/orgs","repos_url":"https://api.github.com/users/wix/repos","events_url":"https://api.github.com/users/wix/events{/privacy}","received_events_url":"https://api.github.com/users/wix/received_events","type":"Organization","site_admin":false},"repo":{"id":73713311,"node_id":"MDEwOlJlcG9zaXRvcnk3MzcxMzMxMQ==","name":"wix-style-react","full_name":"wix/wix-style-react","private":false,"owner":{"login":"wix","id":686511,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/686511?v=4","gravatar_id":"","url":"https://api.github.com/users/wix","html_url":"https://github.com/wix","followers_url":"https://api.github.com/users/wix/followers","following_url":"https://api.github.com/users/wix/following{/other_user}","gists_url":"https://api.github.com/users/wix/gists{/gist_id}","starred_url":"https://api.github.com/users/wix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wix/subscriptions","organizations_url":"https://api.github.com/users/wix/orgs","repos_url":"https://api.github.com/users/wix/repos","events_url":"https://api.github.com/users/wix/events{/privacy}","received_events_url":"https://api.github.com/users/wix/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/wix/wix-style-react","description":"Common React UI components for all Wix verticals developing in React","fork":false,"url":"https://api.github.com/repos/wix/wix-style-react","forks_url":"https://api.github.com/repos/wix/wix-style-react/forks","keys_url":"https://api.github.com/repos/wix/wix-style-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wix/wix-style-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wix/wix-style-react/teams","hooks_url":"https://api.github.com/repos/wix/wix-style-react/hooks","issue_events_url":"https://api.github.com/repos/wix/wix-style-react/issues/events{/number}","events_url":"https://api.github.com/repos/wix/wix-style-react/events","assignees_url":"https://api.github.com/repos/wix/wix-style-react/assignees{/user}","branches_url":"https://api.github.com/repos/wix/wix-style-react/branches{/branch}","tags_url":"https://api.github.com/repos/wix/wix-style-react/tags","blobs_url":"https://api.github.com/repos/wix/wix-style-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wix/wix-style-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wix/wix-style-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/wix/wix-style-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wix/wix-style-react/statuses/{sha}","languages_url":"https://api.github.com/repos/wix/wix-style-react/languages","stargazers_url":"https://api.github.com/repos/wix/wix-style-react/stargazers","contributors_url":"https://api.github.com/repos/wix/wix-style-react/contributors","subscribers_url":"https://api.github.com/repos/wix/wix-style-react/subscribers","subscription_url":"https://api.github.com/repos/wix/wix-style-react/subscription","commits_url":"https://api.github.com/repos/wix/wix-style-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/wix/wix-style-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/wix/wix-style-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/wix/wix-style-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/wix/wix-style-react/contents/{+path}","compare_url":"https://api.github.com/repos/wix/wix-style-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wix/wix-style-react/merges","archive_url":"https://api.github.com/repos/wix/wix-style-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wix/wix-style-react/downloads","issues_url":"https://api.github.com/repos/wix/wix-style-react/issues{/number}","pulls_url":"https://api.github.com/repos/wix/wix-style-react/pulls{/number}","milestones_url":"https://api.github.com/repos/wix/wix-style-react/milestones{/number}","notifications_url":"https://api.github.com/repos/wix/wix-style-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wix/wix-style-react/labels{/name}","releases_url":"https://api.github.com/repos/wix/wix-style-react/releases{/id}","deployments_url":"https://api.github.com/repos/wix/wix-style-react/deployments","created_at":"2016-11-14T14:37:00Z","updated_at":"2018-12-06T16:26:38Z","pushed_at":"2018-12-07T09:50:53Z","git_url":"git://github.com/wix/wix-style-react.git","ssh_url":"git@github.com:wix/wix-style-react.git","clone_url":"https://github.com/wix/wix-style-react.git","svn_url":"https://github.com/wix/wix-style-react","homepage":"https://wix-wix-style-react.surge.sh","size":10150,"stargazers_count":437,"watchers_count":437,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":96,"mirror_url":null,"archived":false,"open_issues_count":112,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":96,"open_issues":112,"watchers":437,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wix/wix-style-react/pulls/2543"},"html":{"href":"https://github.com/wix/wix-style-react/pull/2543"},"issue":{"href":"https://api.github.com/repos/wix/wix-style-react/issues/2543"},"comments":{"href":"https://api.github.com/repos/wix/wix-style-react/issues/2543/comments"},"review_comments":{"href":"https://api.github.com/repos/wix/wix-style-react/pulls/2543/comments"},"review_comment":{"href":"https://api.github.com/repos/wix/wix-style-react/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wix/wix-style-react/pulls/2543/commits"},"statuses":{"href":"https://api.github.com/repos/wix/wix-style-react/statuses/bb12bc13fe4c3db2acbab9d49ab873f30f0a08d0"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"hepiyellow"}}