{"action":"created","comment":{"url":"https://api.github.com/repos/callemall/material-ui/pulls/comments/44083362","id":44083362,"diff_hunk":"@@ -0,0 +1,110 @@\n+const React = require('react');\n+const Typography = require('./styles/typography');\n+const DefaultRawTheme = require('./styles/raw-themes/light-raw-theme');\n+const ThemeManager = require('./styles/theme-manager');\n+\n+// Badge\n+export default React.createClass({\n+  displayName: 'Badge',\n+  contextTypes: {\n+    muiTheme: React.PropTypes.object,\n+  },\n+  //for passing default theme context to children\n+  childContextTypes: {\n+    muiTheme: React.PropTypes.object,\n+  },\n+  getChildContext () {\n+    return {\n+      muiTheme: this.state.muiTheme,\n+    };\n+  },\n+  propTypes: {\n+    className: React.PropTypes.string,\n+    primary: React.PropTypes.bool,\n+    secondary: React.PropTypes.bool,\n+    labelColor: React.PropTypes.string,\n+    backgroundColor: React.PropTypes.string,\n+    style: React.PropTypes.object,\n+    primaryText: React.PropTypes.node.isRequired,\n+  },\n+  getInitialState() {\n+    return {\n+      muiTheme: this.context.muiTheme ? this.context.muiTheme : ThemeManager.getMuiTheme(DefaultRawTheme),\n+    };\n+  },\n+  getDefaultProps() {\n+    return {\n+      className: '',\n+      primary: false,\n+      secondary: false,\n+      labelColor: null,\n+      backgroundColor: null,\n+      style: null,\n+    };\n+  },\n+  componentWillReceiveProps(nextProps, nextContext) {\n+    let newMuiTheme = nextContext.muiTheme ? nextContext.muiTheme : this.state.muiTheme;\n+    this.setState({\n+      muiTheme: newMuiTheme,\n+    });\n+  },\n+  getStyles() {\n+    const theme = this.state.muiTheme.badge;\n+\n+    const backgroundColor = this.props.backgroundColor\n+      ? this.props.backgroundColor\n+      : this.props.primary\n+        ? theme.primaryColor\n+        : this.props.secondary\n+          ? theme.secondaryColor\n+          : theme.color;\n+\n+    const labelColor = this.props.labelColor\n+      ? this.props.labelColor\n+        : this.props.primary\n+          ? theme.primaryTextColor\n+          : this.props.secondary\n+            ? theme.secondaryTextColor\n+            : theme.textColor;\n+\n+    const style = {\n+      root: {\n+        backgroundColor: 'none',","path":"src/badge.jsx","position":null,"original_position":72,"commit_id":"e0322dc69b0812d11815faa17a0a69c7a8303d98","original_commit_id":"4cb6becd6422eaf509fec38bec250fae1574d9ab","user":{"login":"rhythnic","id":8162640,"avatar_url":"https://avatars.githubusercontent.com/u/8162640?v=3","gravatar_id":"","url":"https://api.github.com/users/rhythnic","html_url":"https://github.com/rhythnic","followers_url":"https://api.github.com/users/rhythnic/followers","following_url":"https://api.github.com/users/rhythnic/following{/other_user}","gists_url":"https://api.github.com/users/rhythnic/gists{/gist_id}","starred_url":"https://api.github.com/users/rhythnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhythnic/subscriptions","organizations_url":"https://api.github.com/users/rhythnic/orgs","repos_url":"https://api.github.com/users/rhythnic/repos","events_url":"https://api.github.com/users/rhythnic/events{/privacy}","received_events_url":"https://api.github.com/users/rhythnic/received_events","type":"User","site_admin":false},"body":"backgroundColor: 'none' is code that is currently in the RaisedButton component.  I used that element as a basis for creating the Badge.  I've removed it in Badge.","created_at":"2015-11-05T23:06:32Z","updated_at":"2015-11-05T23:06:32Z","html_url":"https://github.com/callemall/material-ui/pull/2045#discussion_r44083362","pull_request_url":"https://api.github.com/repos/callemall/material-ui/pulls/2045","_links":{"self":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/comments/44083362"},"html":{"href":"https://github.com/callemall/material-ui/pull/2045#discussion_r44083362"},"pull_request":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/2045"}}},"pull_request":{"url":"https://api.github.com/repos/callemall/material-ui/pulls/2045","id":49530869,"html_url":"https://github.com/callemall/material-ui/pull/2045","diff_url":"https://github.com/callemall/material-ui/pull/2045.diff","patch_url":"https://github.com/callemall/material-ui/pull/2045.patch","issue_url":"https://api.github.com/repos/callemall/material-ui/issues/2045","number":2045,"state":"open","locked":false,"title":"Added Badge component.","user":{"login":"rhythnic","id":8162640,"avatar_url":"https://avatars.githubusercontent.com/u/8162640?v=3","gravatar_id":"","url":"https://api.github.com/users/rhythnic","html_url":"https://github.com/rhythnic","followers_url":"https://api.github.com/users/rhythnic/followers","following_url":"https://api.github.com/users/rhythnic/following{/other_user}","gists_url":"https://api.github.com/users/rhythnic/gists{/gist_id}","starred_url":"https://api.github.com/users/rhythnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhythnic/subscriptions","organizations_url":"https://api.github.com/users/rhythnic/orgs","repos_url":"https://api.github.com/users/rhythnic/repos","events_url":"https://api.github.com/users/rhythnic/events{/privacy}","received_events_url":"https://api.github.com/users/rhythnic/received_events","type":"User","site_admin":false},"body":"The badge is for displaying a small number or piece of text to the top-right of it's child.  It's mostly useful for displaying a counter.\r\nSee [Material Design Light's Badge](http://www.getmdl.io/components/index.html#badges-section).","created_at":"2015-11-03T08:54:21Z","updated_at":"2015-11-05T23:06:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30f101d52bcdc36973bacfe1239128bfc1a8c930","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/callemall/material-ui/pulls/2045/commits","review_comments_url":"https://api.github.com/repos/callemall/material-ui/pulls/2045/comments","review_comment_url":"https://api.github.com/repos/callemall/material-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/callemall/material-ui/issues/2045/comments","statuses_url":"https://api.github.com/repos/callemall/material-ui/statuses/e0322dc69b0812d11815faa17a0a69c7a8303d98","head":{"label":"rhythnic:master","ref":"master","sha":"e0322dc69b0812d11815faa17a0a69c7a8303d98","user":{"login":"rhythnic","id":8162640,"avatar_url":"https://avatars.githubusercontent.com/u/8162640?v=3","gravatar_id":"","url":"https://api.github.com/users/rhythnic","html_url":"https://github.com/rhythnic","followers_url":"https://api.github.com/users/rhythnic/followers","following_url":"https://api.github.com/users/rhythnic/following{/other_user}","gists_url":"https://api.github.com/users/rhythnic/gists{/gist_id}","starred_url":"https://api.github.com/users/rhythnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhythnic/subscriptions","organizations_url":"https://api.github.com/users/rhythnic/orgs","repos_url":"https://api.github.com/users/rhythnic/repos","events_url":"https://api.github.com/users/rhythnic/events{/privacy}","received_events_url":"https://api.github.com/users/rhythnic/received_events","type":"User","site_admin":false},"repo":{"id":45445208,"name":"material-ui","full_name":"rhythnic/material-ui","owner":{"login":"rhythnic","id":8162640,"avatar_url":"https://avatars.githubusercontent.com/u/8162640?v=3","gravatar_id":"","url":"https://api.github.com/users/rhythnic","html_url":"https://github.com/rhythnic","followers_url":"https://api.github.com/users/rhythnic/followers","following_url":"https://api.github.com/users/rhythnic/following{/other_user}","gists_url":"https://api.github.com/users/rhythnic/gists{/gist_id}","starred_url":"https://api.github.com/users/rhythnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhythnic/subscriptions","organizations_url":"https://api.github.com/users/rhythnic/orgs","repos_url":"https://api.github.com/users/rhythnic/repos","events_url":"https://api.github.com/users/rhythnic/events{/privacy}","received_events_url":"https://api.github.com/users/rhythnic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rhythnic/material-ui","description":"React Components that Implement Google's Material Design.","fork":true,"url":"https://api.github.com/repos/rhythnic/material-ui","forks_url":"https://api.github.com/repos/rhythnic/material-ui/forks","keys_url":"https://api.github.com/repos/rhythnic/material-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rhythnic/material-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rhythnic/material-ui/teams","hooks_url":"https://api.github.com/repos/rhythnic/material-ui/hooks","issue_events_url":"https://api.github.com/repos/rhythnic/material-ui/issues/events{/number}","events_url":"https://api.github.com/repos/rhythnic/material-ui/events","assignees_url":"https://api.github.com/repos/rhythnic/material-ui/assignees{/user}","branches_url":"https://api.github.com/repos/rhythnic/material-ui/branches{/branch}","tags_url":"https://api.github.com/repos/rhythnic/material-ui/tags","blobs_url":"https://api.github.com/repos/rhythnic/material-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rhythnic/material-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rhythnic/material-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/rhythnic/material-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rhythnic/material-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/rhythnic/material-ui/languages","stargazers_url":"https://api.github.com/repos/rhythnic/material-ui/stargazers","contributors_url":"https://api.github.com/repos/rhythnic/material-ui/contributors","subscribers_url":"https://api.github.com/repos/rhythnic/material-ui/subscribers","subscription_url":"https://api.github.com/repos/rhythnic/material-ui/subscription","commits_url":"https://api.github.com/repos/rhythnic/material-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/rhythnic/material-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/rhythnic/material-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/rhythnic/material-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/rhythnic/material-ui/contents/{+path}","compare_url":"https://api.github.com/repos/rhythnic/material-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rhythnic/material-ui/merges","archive_url":"https://api.github.com/repos/rhythnic/material-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rhythnic/material-ui/downloads","issues_url":"https://api.github.com/repos/rhythnic/material-ui/issues{/number}","pulls_url":"https://api.github.com/repos/rhythnic/material-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/rhythnic/material-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/rhythnic/material-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rhythnic/material-ui/labels{/name}","releases_url":"https://api.github.com/repos/rhythnic/material-ui/releases{/id}","created_at":"2015-11-03T06:00:13Z","updated_at":"2015-11-03T06:00:18Z","pushed_at":"2015-11-05T23:04:43Z","git_url":"git://github.com/rhythnic/material-ui.git","ssh_url":"git@github.com:rhythnic/material-ui.git","clone_url":"https://github.com/rhythnic/material-ui.git","svn_url":"https://github.com/rhythnic/material-ui","homepage":"http://material-ui.com","size":30955,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"callemall:master","ref":"master","sha":"ac357ec3ee16a1c23f57b767d913295cd1f61df8","user":{"login":"callemall","id":1262264,"avatar_url":"https://avatars.githubusercontent.com/u/1262264?v=3","gravatar_id":"","url":"https://api.github.com/users/callemall","html_url":"https://github.com/callemall","followers_url":"https://api.github.com/users/callemall/followers","following_url":"https://api.github.com/users/callemall/following{/other_user}","gists_url":"https://api.github.com/users/callemall/gists{/gist_id}","starred_url":"https://api.github.com/users/callemall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callemall/subscriptions","organizations_url":"https://api.github.com/users/callemall/orgs","repos_url":"https://api.github.com/users/callemall/repos","events_url":"https://api.github.com/users/callemall/events{/privacy}","received_events_url":"https://api.github.com/users/callemall/received_events","type":"Organization","site_admin":false},"repo":{"id":23083156,"name":"material-ui","full_name":"callemall/material-ui","owner":{"login":"callemall","id":1262264,"avatar_url":"https://avatars.githubusercontent.com/u/1262264?v=3","gravatar_id":"","url":"https://api.github.com/users/callemall","html_url":"https://github.com/callemall","followers_url":"https://api.github.com/users/callemall/followers","following_url":"https://api.github.com/users/callemall/following{/other_user}","gists_url":"https://api.github.com/users/callemall/gists{/gist_id}","starred_url":"https://api.github.com/users/callemall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callemall/subscriptions","organizations_url":"https://api.github.com/users/callemall/orgs","repos_url":"https://api.github.com/users/callemall/repos","events_url":"https://api.github.com/users/callemall/events{/privacy}","received_events_url":"https://api.github.com/users/callemall/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/callemall/material-ui","description":"React Components that Implement Google's Material Design.","fork":false,"url":"https://api.github.com/repos/callemall/material-ui","forks_url":"https://api.github.com/repos/callemall/material-ui/forks","keys_url":"https://api.github.com/repos/callemall/material-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/callemall/material-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/callemall/material-ui/teams","hooks_url":"https://api.github.com/repos/callemall/material-ui/hooks","issue_events_url":"https://api.github.com/repos/callemall/material-ui/issues/events{/number}","events_url":"https://api.github.com/repos/callemall/material-ui/events","assignees_url":"https://api.github.com/repos/callemall/material-ui/assignees{/user}","branches_url":"https://api.github.com/repos/callemall/material-ui/branches{/branch}","tags_url":"https://api.github.com/repos/callemall/material-ui/tags","blobs_url":"https://api.github.com/repos/callemall/material-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/callemall/material-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/callemall/material-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/callemall/material-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/callemall/material-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/callemall/material-ui/languages","stargazers_url":"https://api.github.com/repos/callemall/material-ui/stargazers","contributors_url":"https://api.github.com/repos/callemall/material-ui/contributors","subscribers_url":"https://api.github.com/repos/callemall/material-ui/subscribers","subscription_url":"https://api.github.com/repos/callemall/material-ui/subscription","commits_url":"https://api.github.com/repos/callemall/material-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/callemall/material-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/callemall/material-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/callemall/material-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/callemall/material-ui/contents/{+path}","compare_url":"https://api.github.com/repos/callemall/material-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/callemall/material-ui/merges","archive_url":"https://api.github.com/repos/callemall/material-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/callemall/material-ui/downloads","issues_url":"https://api.github.com/repos/callemall/material-ui/issues{/number}","pulls_url":"https://api.github.com/repos/callemall/material-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/callemall/material-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/callemall/material-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/callemall/material-ui/labels{/name}","releases_url":"https://api.github.com/repos/callemall/material-ui/releases{/id}","created_at":"2014-08-18T19:11:54Z","updated_at":"2015-11-05T22:47:01Z","pushed_at":"2015-11-05T23:04:45Z","git_url":"git://github.com/callemall/material-ui.git","ssh_url":"git@github.com:callemall/material-ui.git","clone_url":"https://github.com/callemall/material-ui.git","svn_url":"https://github.com/callemall/material-ui","homepage":"http://material-ui.com","size":42888,"stargazers_count":11592,"watchers_count":11592,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1831,"mirror_url":null,"open_issues_count":504,"forks":1831,"open_issues":504,"watchers":11592,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/2045"},"html":{"href":"https://github.com/callemall/material-ui/pull/2045"},"issue":{"href":"https://api.github.com/repos/callemall/material-ui/issues/2045"},"comments":{"href":"https://api.github.com/repos/callemall/material-ui/issues/2045/comments"},"review_comments":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/2045/comments"},"review_comment":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/2045/commits"},"statuses":{"href":"https://api.github.com/repos/callemall/material-ui/statuses/e0322dc69b0812d11815faa17a0a69c7a8303d98"}}}}