{"action":"created","comment":{"url":"https://api.github.com/repos/mxenabled/mx-react-components/pulls/comments/67263426","id":67263426,"diff_hunk":"@@ -6,101 +6,69 @@ const Icon = require('./Icon');\n const ToggleSwitch = React.createClass({\n   propTypes: {\n     checked: React.PropTypes.bool,\n-    falseIcon: React.PropTypes.element,\n+    falseIcon: React.PropTypes.string,\n     leftLabel: React.PropTypes.string,\n     onToggle: React.PropTypes.func,\n     rightLabel: React.PropTypes.string,\n     showIcons: React.PropTypes.bool,\n     showLabels: React.PropTypes.bool,\n-    style: React.PropTypes.object,\n-    trueIcon: React.PropTypes.element\n+    styles: React.PropTypes.object,\n+    trueIcon: React.PropTypes.string\n   },\n \n   getDefaultProps () {\n     return {\n       checked: false,\n+      falseIcon: 'close-skinny',\n       leftLabel: 'Off',\n       onToggle () {},\n       rightLabel: 'On',\n       showLabels: false,\n       showIcons: true,\n-      style: {}\n-    };\n-  },\n-\n-  getInitialState () {\n-    return {\n-      checked: this.props.checked\n+      style: {},","path":"src/components/ToggleSwitch.js","position":null,"original_position":33,"commit_id":"738892768c4dc5b38bf7b42ca288d0adef68a3de","original_commit_id":"acc7a20a86878756165e1d850c3184a8c45d2c70","user":{"login":"jmophoto","id":488916,"avatar_url":"https://avatars.githubusercontent.com/u/488916?v=3","gravatar_id":"","url":"https://api.github.com/users/jmophoto","html_url":"https://github.com/jmophoto","followers_url":"https://api.github.com/users/jmophoto/followers","following_url":"https://api.github.com/users/jmophoto/following{/other_user}","gists_url":"https://api.github.com/users/jmophoto/gists{/gist_id}","starred_url":"https://api.github.com/users/jmophoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmophoto/subscriptions","organizations_url":"https://api.github.com/users/jmophoto/orgs","repos_url":"https://api.github.com/users/jmophoto/repos","events_url":"https://api.github.com/users/jmophoto/events{/privacy}","received_events_url":"https://api.github.com/users/jmophoto/received_events","type":"User","site_admin":false},"body":"I removed the default style prop altogether.","created_at":"2016-06-15T23:19:21Z","updated_at":"2016-06-15T23:19:21Z","html_url":"https://github.com/mxenabled/mx-react-components/pull/340#discussion_r67263426","pull_request_url":"https://api.github.com/repos/mxenabled/mx-react-components/pulls/340","_links":{"self":{"href":"https://api.github.com/repos/mxenabled/mx-react-components/pulls/comments/67263426"},"html":{"href":"https://github.com/mxenabled/mx-react-components/pull/340#discussion_r67263426"},"pull_request":{"href":"https://api.github.com/repos/mxenabled/mx-react-components/pulls/340"}}},"pull_request":{"url":"https://api.github.com/repos/mxenabled/mx-react-components/pulls/340","id":73998408,"html_url":"https://github.com/mxenabled/mx-react-components/pull/340","diff_url":"https://github.com/mxenabled/mx-react-components/pull/340.diff","patch_url":"https://github.com/mxenabled/mx-react-components/pull/340.patch","issue_url":"https://api.github.com/repos/mxenabled/mx-react-components/issues/340","number":340,"state":"open","locked":false,"title":"Jmo/toggle switch","user":{"login":"jmophoto","id":488916,"avatar_url":"https://avatars.githubusercontent.com/u/488916?v=3","gravatar_id":"","url":"https://api.github.com/users/jmophoto","html_url":"https://github.com/jmophoto","followers_url":"https://api.github.com/users/jmophoto/followers","following_url":"https://api.github.com/users/jmophoto/following{/other_user}","gists_url":"https://api.github.com/users/jmophoto/gists{/gist_id}","starred_url":"https://api.github.com/users/jmophoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmophoto/subscriptions","organizations_url":"https://api.github.com/users/jmophoto/orgs","repos_url":"https://api.github.com/users/jmophoto/repos","events_url":"https://api.github.com/users/jmophoto/events{/privacy}","received_events_url":"https://api.github.com/users/jmophoto/received_events","type":"User","site_admin":false},"body":"I found that putting this into a project with box-sizing set to border box made the track too small. In fixing that, I had some ideas for refactoring.\r\n\r\n- Changed the icon props from an element to a string and set defaults\r\n- Changed the style prop to styles\r\n- Took out state since the prop is toggled in the parent, so true/false can be checked with the prop.checked\r\n- Moved _renders into main body with ternary\r\n- Removed 'px' from styles\r\n- Fixed fontFamily and fontSize to use style constants\r\n- Combined falseToggle and trueToggle into toggle style with conditional\r\n\r\nThoughts on this @phantomxc? ","created_at":"2016-06-15T23:00:04Z","updated_at":"2016-06-15T23:19:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"984963d62b562f44a10f4f47d123456be753b05f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mxenabled/mx-react-components/pulls/340/commits","review_comments_url":"https://api.github.com/repos/mxenabled/mx-react-components/pulls/340/comments","review_comment_url":"https://api.github.com/repos/mxenabled/mx-react-components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mxenabled/mx-react-components/issues/340/comments","statuses_url":"https://api.github.com/repos/mxenabled/mx-react-components/statuses/738892768c4dc5b38bf7b42ca288d0adef68a3de","head":{"label":"mxenabled:jmo/toggle-switch","ref":"jmo/toggle-switch","sha":"738892768c4dc5b38bf7b42ca288d0adef68a3de","user":{"login":"mxenabled","id":991323,"avatar_url":"https://avatars.githubusercontent.com/u/991323?v=3","gravatar_id":"","url":"https://api.github.com/users/mxenabled","html_url":"https://github.com/mxenabled","followers_url":"https://api.github.com/users/mxenabled/followers","following_url":"https://api.github.com/users/mxenabled/following{/other_user}","gists_url":"https://api.github.com/users/mxenabled/gists{/gist_id}","starred_url":"https://api.github.com/users/mxenabled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxenabled/subscriptions","organizations_url":"https://api.github.com/users/mxenabled/orgs","repos_url":"https://api.github.com/users/mxenabled/repos","events_url":"https://api.github.com/users/mxenabled/events{/privacy}","received_events_url":"https://api.github.com/users/mxenabled/received_events","type":"Organization","site_admin":false},"repo":{"id":41570643,"name":"mx-react-components","full_name":"mxenabled/mx-react-components","owner":{"login":"mxenabled","id":991323,"avatar_url":"https://avatars.githubusercontent.com/u/991323?v=3","gravatar_id":"","url":"https://api.github.com/users/mxenabled","html_url":"https://github.com/mxenabled","followers_url":"https://api.github.com/users/mxenabled/followers","following_url":"https://api.github.com/users/mxenabled/following{/other_user}","gists_url":"https://api.github.com/users/mxenabled/gists{/gist_id}","starred_url":"https://api.github.com/users/mxenabled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxenabled/subscriptions","organizations_url":"https://api.github.com/users/mxenabled/orgs","repos_url":"https://api.github.com/users/mxenabled/repos","events_url":"https://api.github.com/users/mxenabled/events{/privacy}","received_events_url":"https://api.github.com/users/mxenabled/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mxenabled/mx-react-components","description":"A library of generic React components used at MX","fork":false,"url":"https://api.github.com/repos/mxenabled/mx-react-components","forks_url":"https://api.github.com/repos/mxenabled/mx-react-components/forks","keys_url":"https://api.github.com/repos/mxenabled/mx-react-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mxenabled/mx-react-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mxenabled/mx-react-components/teams","hooks_url":"https://api.github.com/repos/mxenabled/mx-react-components/hooks","issue_events_url":"https://api.github.com/repos/mxenabled/mx-react-components/issues/events{/number}","events_url":"https://api.github.com/repos/mxenabled/mx-react-components/events","assignees_url":"https://api.github.com/repos/mxenabled/mx-react-components/assignees{/user}","branches_url":"https://api.github.com/repos/mxenabled/mx-react-components/branches{/branch}","tags_url":"https://api.github.com/repos/mxenabled/mx-react-components/tags","blobs_url":"https://api.github.com/repos/mxenabled/mx-react-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mxenabled/mx-react-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mxenabled/mx-react-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/mxenabled/mx-react-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mxenabled/mx-react-components/statuses/{sha}","languages_url":"https://api.github.com/repos/mxenabled/mx-react-components/languages","stargazers_url":"https://api.github.com/repos/mxenabled/mx-react-components/stargazers","contributors_url":"https://api.github.com/repos/mxenabled/mx-react-components/contributors","subscribers_url":"https://api.github.com/repos/mxenabled/mx-react-components/subscribers","subscription_url":"https://api.github.com/repos/mxenabled/mx-react-components/subscription","commits_url":"https://api.github.com/repos/mxenabled/mx-react-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/mxenabled/mx-react-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/mxenabled/mx-react-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/mxenabled/mx-react-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/mxenabled/mx-react-components/contents/{+path}","compare_url":"https://api.github.com/repos/mxenabled/mx-react-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mxenabled/mx-react-components/merges","archive_url":"https://api.github.com/repos/mxenabled/mx-react-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mxenabled/mx-react-components/downloads","issues_url":"https://api.github.com/repos/mxenabled/mx-react-components/issues{/number}","pulls_url":"https://api.github.com/repos/mxenabled/mx-react-components/pulls{/number}","milestones_url":"https://api.github.com/repos/mxenabled/mx-react-components/milestones{/number}","notifications_url":"https://api.github.com/repos/mxenabled/mx-react-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mxenabled/mx-react-components/labels{/name}","releases_url":"https://api.github.com/repos/mxenabled/mx-react-components/releases{/id}","deployments_url":"https://api.github.com/repos/mxenabled/mx-react-components/deployments","created_at":"2015-08-28T21:47:32Z","updated_at":"2016-05-24T17:22:32Z","pushed_at":"2016-06-15T23:19:07Z","git_url":"git://github.com/mxenabled/mx-react-components.git","ssh_url":"git@github.com:mxenabled/mx-react-components.git","clone_url":"https://github.com/mxenabled/mx-react-components.git","svn_url":"https://github.com/mxenabled/mx-react-components","homepage":null,"size":16016,"stargazers_count":28,"watchers_count":28,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":46,"mirror_url":null,"open_issues_count":4,"forks":46,"open_issues":4,"watchers":28,"default_branch":"master"}},"base":{"label":"mxenabled:master","ref":"master","sha":"b4cd0d7cee620f684947d86d33bce423178c95a0","user":{"login":"mxenabled","id":991323,"avatar_url":"https://avatars.githubusercontent.com/u/991323?v=3","gravatar_id":"","url":"https://api.github.com/users/mxenabled","html_url":"https://github.com/mxenabled","followers_url":"https://api.github.com/users/mxenabled/followers","following_url":"https://api.github.com/users/mxenabled/following{/other_user}","gists_url":"https://api.github.com/users/mxenabled/gists{/gist_id}","starred_url":"https://api.github.com/users/mxenabled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxenabled/subscriptions","organizations_url":"https://api.github.com/users/mxenabled/orgs","repos_url":"https://api.github.com/users/mxenabled/repos","events_url":"https://api.github.com/users/mxenabled/events{/privacy}","received_events_url":"https://api.github.com/users/mxenabled/received_events","type":"Organization","site_admin":false},"repo":{"id":41570643,"name":"mx-react-components","full_name":"mxenabled/mx-react-components","owner":{"login":"mxenabled","id":991323,"avatar_url":"https://avatars.githubusercontent.com/u/991323?v=3","gravatar_id":"","url":"https://api.github.com/users/mxenabled","html_url":"https://github.com/mxenabled","followers_url":"https://api.github.com/users/mxenabled/followers","following_url":"https://api.github.com/users/mxenabled/following{/other_user}","gists_url":"https://api.github.com/users/mxenabled/gists{/gist_id}","starred_url":"https://api.github.com/users/mxenabled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxenabled/subscriptions","organizations_url":"https://api.github.com/users/mxenabled/orgs","repos_url":"https://api.github.com/users/mxenabled/repos","events_url":"https://api.github.com/users/mxenabled/events{/privacy}","received_events_url":"https://api.github.com/users/mxenabled/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mxenabled/mx-react-components","description":"A library of generic React components used at MX","fork":false,"url":"https://api.github.com/repos/mxenabled/mx-react-components","forks_url":"https://api.github.com/repos/mxenabled/mx-react-components/forks","keys_url":"https://api.github.com/repos/mxenabled/mx-react-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mxenabled/mx-react-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mxenabled/mx-react-components/teams","hooks_url":"https://api.github.com/repos/mxenabled/mx-react-components/hooks","issue_events_url":"https://api.github.com/repos/mxenabled/mx-react-components/issues/events{/number}","events_url":"https://api.github.com/repos/mxenabled/mx-react-components/events","assignees_url":"https://api.github.com/repos/mxenabled/mx-react-components/assignees{/user}","branches_url":"https://api.github.com/repos/mxenabled/mx-react-components/branches{/branch}","tags_url":"https://api.github.com/repos/mxenabled/mx-react-components/tags","blobs_url":"https://api.github.com/repos/mxenabled/mx-react-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mxenabled/mx-react-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mxenabled/mx-react-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/mxenabled/mx-react-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mxenabled/mx-react-components/statuses/{sha}","languages_url":"https://api.github.com/repos/mxenabled/mx-react-components/languages","stargazers_url":"https://api.github.com/repos/mxenabled/mx-react-components/stargazers","contributors_url":"https://api.github.com/repos/mxenabled/mx-react-components/contributors","subscribers_url":"https://api.github.com/repos/mxenabled/mx-react-components/subscribers","subscription_url":"https://api.github.com/repos/mxenabled/mx-react-components/subscription","commits_url":"https://api.github.com/repos/mxenabled/mx-react-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/mxenabled/mx-react-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/mxenabled/mx-react-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/mxenabled/mx-react-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/mxenabled/mx-react-components/contents/{+path}","compare_url":"https://api.github.com/repos/mxenabled/mx-react-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mxenabled/mx-react-components/merges","archive_url":"https://api.github.com/repos/mxenabled/mx-react-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mxenabled/mx-react-components/downloads","issues_url":"https://api.github.com/repos/mxenabled/mx-react-components/issues{/number}","pulls_url":"https://api.github.com/repos/mxenabled/mx-react-components/pulls{/number}","milestones_url":"https://api.github.com/repos/mxenabled/mx-react-components/milestones{/number}","notifications_url":"https://api.github.com/repos/mxenabled/mx-react-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mxenabled/mx-react-components/labels{/name}","releases_url":"https://api.github.com/repos/mxenabled/mx-react-components/releases{/id}","deployments_url":"https://api.github.com/repos/mxenabled/mx-react-components/deployments","created_at":"2015-08-28T21:47:32Z","updated_at":"2016-05-24T17:22:32Z","pushed_at":"2016-06-15T23:19:07Z","git_url":"git://github.com/mxenabled/mx-react-components.git","ssh_url":"git@github.com:mxenabled/mx-react-components.git","clone_url":"https://github.com/mxenabled/mx-react-components.git","svn_url":"https://github.com/mxenabled/mx-react-components","homepage":null,"size":16016,"stargazers_count":28,"watchers_count":28,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":46,"mirror_url":null,"open_issues_count":4,"forks":46,"open_issues":4,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mxenabled/mx-react-components/pulls/340"},"html":{"href":"https://github.com/mxenabled/mx-react-components/pull/340"},"issue":{"href":"https://api.github.com/repos/mxenabled/mx-react-components/issues/340"},"comments":{"href":"https://api.github.com/repos/mxenabled/mx-react-components/issues/340/comments"},"review_comments":{"href":"https://api.github.com/repos/mxenabled/mx-react-components/pulls/340/comments"},"review_comment":{"href":"https://api.github.com/repos/mxenabled/mx-react-components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mxenabled/mx-react-components/pulls/340/commits"},"statuses":{"href":"https://api.github.com/repos/mxenabled/mx-react-components/statuses/738892768c4dc5b38bf7b42ca288d0adef68a3de"}}}}
{"actor":{"display_login":"jmophoto"}}