{"action":"created","comment":{"url":"https://api.github.com/repos/callemall/material-ui/pulls/comments/84149461","pull_request_review_id":4941159,"id":84149461,"diff_hunk":"@@ -0,0 +1,102 @@\n+import React, { Component, PropTypes } from 'react';\n+import { createStyleSheet } from 'jss-theme-reactor';\n+import ClassNames from 'classnames';\n+import TabIndicator from './TabIndicator';\n+\n+export const styleSheet = createStyleSheet('Tabs', () => {\n+  return {\n+    root: {\n+      maxHeight: 48,\n+      position: 'relative',\n+      display: 'flex',\n+      justifyContent: 'flex-start',\n+      width: 'auto',\n+    },\n+    centered: {\n+      justifyContent: 'center',\n+    },\n+  };\n+});\n+\n+export default class Tabs extends Component {\n+  static propTypes = {\n+    /**\n+     * The content of the Tabs.\n+     */\n+    activeTab: PropTypes.number,\n+    /**\n+     * The content of the Tabs.\n+     */\n+    centered: PropTypes.bool,\n+    /**\n+     * The content of the Tabs.\n+     */\n+    fixed: PropTypes.bool,\n+    /**\n+     * The content of the Tabs.\n+     */\n+    children: PropTypes.node,\n+    /**\n+     * The CSS class name of the root element.\n+     */\n+    className: PropTypes.string,\n+  };\n+\n+  static contextTypes = {\n+    styleManager: PropTypes.object.isRequired,\n+  };\n+\n+  state = {\n+    indicator: {},\n+  };\n+\n+  componentDidMount() {\n+    this.updateIndicator();\n+  }\n+\n+  componentWillReceiveProps() {\n+    this.updateIndicator();\n+  }\n+\n+  updateIndicator() {\n+    clearTimeout(this.indicatorTimeout);\n+    this.indicatorTimeout = setTimeout(() => {\n+      const { activeTab } = this.props;\n+      this.setState({\n+        indicator: {\n+          left: this.tabs.children[activeTab].getBoundingClientRect().left - this.tabs.getBoundingClientRect().left,\n+          width: this.tabs.children[activeTab].getBoundingClientRect().width,\n+        },\n+      });\n+    }, 20);\n+  }\n+\n+  render() {\n+    const {\n+      centered,\n+      children,\n+      className,\n+      fixed,\n+    } = this.props;\n+\n+    const classes = this.context.styleManager.render(styleSheet, { group: 'mui' });\n+    const classNames = ClassNames({\n+      [classes.root]: true,\n+      [classes.centered]: centered,\n+    }, className);\n+\n+    const tabs = React.Children.map(children, (tab, index) => {\n+      return React.cloneElement(tab, {\n+        active: this.props.activeTab === index,\n+        style: { width: fixed && '100%' },\n+      });\n+    });\n+\n+    return (\n+      <div className={classNames} ref={(t) => this.tabs = t}>\n+        {tabs}\n+        <TabIndicator primary style={this.state.indicator} />","path":"src/Tabs/Tabs.js","position":98,"original_position":98,"commit_id":"cae79eba18e855297089d0b953cbc2ef5e901dcb","original_commit_id":"cae79eba18e855297089d0b953cbc2ef5e901dcb","user":{"login":"oliviertassinari","id":3165635,"avatar_url":"https://avatars.githubusercontent.com/u/3165635?v=3","gravatar_id":"","url":"https://api.github.com/users/oliviertassinari","html_url":"https://github.com/oliviertassinari","followers_url":"https://api.github.com/users/oliviertassinari/followers","following_url":"https://api.github.com/users/oliviertassinari/following{/other_user}","gists_url":"https://api.github.com/users/oliviertassinari/gists{/gist_id}","starred_url":"https://api.github.com/users/oliviertassinari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliviertassinari/subscriptions","organizations_url":"https://api.github.com/users/oliviertassinari/orgs","repos_url":"https://api.github.com/users/oliviertassinari/repos","events_url":"https://api.github.com/users/oliviertassinari/events{/privacy}","received_events_url":"https://api.github.com/users/oliviertassinari/received_events","type":"User","site_admin":false},"body":"It would be great to add an option to remove the `TabIndicator`. We have an issue for this.","created_at":"2016-10-19T19:35:13Z","updated_at":"2016-10-19T19:35:39Z","html_url":"https://github.com/callemall/material-ui/pull/5097#discussion_r84149461","pull_request_url":"https://api.github.com/repos/callemall/material-ui/pulls/5097","_links":{"self":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/comments/84149461"},"html":{"href":"https://github.com/callemall/material-ui/pull/5097#discussion_r84149461"},"pull_request":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/5097"}}},"pull_request":{"url":"https://api.github.com/repos/callemall/material-ui/pulls/5097","id":83395828,"html_url":"https://github.com/callemall/material-ui/pull/5097","diff_url":"https://github.com/callemall/material-ui/pull/5097.diff","patch_url":"https://github.com/callemall/material-ui/pull/5097.patch","issue_url":"https://api.github.com/repos/callemall/material-ui/issues/5097","number":5097,"state":"open","locked":false,"title":"[WIP][Tabs] Initial migration of tab components","user":{"login":"newoga","id":344018,"avatar_url":"https://avatars.githubusercontent.com/u/344018?v=3","gravatar_id":"","url":"https://api.github.com/users/newoga","html_url":"https://github.com/newoga","followers_url":"https://api.github.com/users/newoga/followers","following_url":"https://api.github.com/users/newoga/following{/other_user}","gists_url":"https://api.github.com/users/newoga/gists{/gist_id}","starred_url":"https://api.github.com/users/newoga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newoga/subscriptions","organizations_url":"https://api.github.com/users/newoga/orgs","repos_url":"https://api.github.com/users/newoga/repos","events_url":"https://api.github.com/users/newoga/events{/privacy}","received_events_url":"https://api.github.com/users/newoga/received_events","type":"User","site_admin":false},"body":"<!-- Thanks so much for your PR, your contribution is appreciated! -->\r\n\r\n- [ ] PR has tests / docs demo, and is linted.\r\n- [ ] Commit and PR titles begin with [ComponentName], and are in imperative form: \"[Component] Fix leaky abstraction\".\r\n- [ ] Description explains the issue / use-case resolved, and auto-closes the related issue(s) (http://tr.im/vFqem).\r\n\r\n**Not finished yet!**\r\n\r\nThis is currently functional but still needs tests and better written examples/docs. I also want to revisit some of the open Tabs issues and see if I can fit any other functionality in. Also, noticed some of the styles changed a tad from when we switched to jss so need to revisit and compare against the spec for everything.\r\n","created_at":"2016-08-31T06:33:38Z","updated_at":"2016-10-19T19:35:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cffd4918589ac61bb169aff6fae1ae0e6209f9ed","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/callemall/material-ui/pulls/5097/commits","review_comments_url":"https://api.github.com/repos/callemall/material-ui/pulls/5097/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/5097/comments","statuses_url":"https://api.github.com/repos/callemall/material-ui/statuses/cae79eba18e855297089d0b953cbc2ef5e901dcb","head":{"label":"newoga:next-tabs","ref":"next-tabs","sha":"cae79eba18e855297089d0b953cbc2ef5e901dcb","user":{"login":"newoga","id":344018,"avatar_url":"https://avatars.githubusercontent.com/u/344018?v=3","gravatar_id":"","url":"https://api.github.com/users/newoga","html_url":"https://github.com/newoga","followers_url":"https://api.github.com/users/newoga/followers","following_url":"https://api.github.com/users/newoga/following{/other_user}","gists_url":"https://api.github.com/users/newoga/gists{/gist_id}","starred_url":"https://api.github.com/users/newoga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newoga/subscriptions","organizations_url":"https://api.github.com/users/newoga/orgs","repos_url":"https://api.github.com/users/newoga/repos","events_url":"https://api.github.com/users/newoga/events{/privacy}","received_events_url":"https://api.github.com/users/newoga/received_events","type":"User","site_admin":false},"repo":{"id":47232679,"name":"material-ui","full_name":"newoga/material-ui","owner":{"login":"newoga","id":344018,"avatar_url":"https://avatars.githubusercontent.com/u/344018?v=3","gravatar_id":"","url":"https://api.github.com/users/newoga","html_url":"https://github.com/newoga","followers_url":"https://api.github.com/users/newoga/followers","following_url":"https://api.github.com/users/newoga/following{/other_user}","gists_url":"https://api.github.com/users/newoga/gists{/gist_id}","starred_url":"https://api.github.com/users/newoga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newoga/subscriptions","organizations_url":"https://api.github.com/users/newoga/orgs","repos_url":"https://api.github.com/users/newoga/repos","events_url":"https://api.github.com/users/newoga/events{/privacy}","received_events_url":"https://api.github.com/users/newoga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/newoga/material-ui","description":"React Components that Implement Google's Material Design.","fork":true,"url":"https://api.github.com/repos/newoga/material-ui","forks_url":"https://api.github.com/repos/newoga/material-ui/forks","keys_url":"https://api.github.com/repos/newoga/material-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/newoga/material-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/newoga/material-ui/teams","hooks_url":"https://api.github.com/repos/newoga/material-ui/hooks","issue_events_url":"https://api.github.com/repos/newoga/material-ui/issues/events{/number}","events_url":"https://api.github.com/repos/newoga/material-ui/events","assignees_url":"https://api.github.com/repos/newoga/material-ui/assignees{/user}","branches_url":"https://api.github.com/repos/newoga/material-ui/branches{/branch}","tags_url":"https://api.github.com/repos/newoga/material-ui/tags","blobs_url":"https://api.github.com/repos/newoga/material-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/newoga/material-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/newoga/material-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/newoga/material-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/newoga/material-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/newoga/material-ui/languages","stargazers_url":"https://api.github.com/repos/newoga/material-ui/stargazers","contributors_url":"https://api.github.com/repos/newoga/material-ui/contributors","subscribers_url":"https://api.github.com/repos/newoga/material-ui/subscribers","subscription_url":"https://api.github.com/repos/newoga/material-ui/subscription","commits_url":"https://api.github.com/repos/newoga/material-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/newoga/material-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/newoga/material-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/newoga/material-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/newoga/material-ui/contents/{+path}","compare_url":"https://api.github.com/repos/newoga/material-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/newoga/material-ui/merges","archive_url":"https://api.github.com/repos/newoga/material-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/newoga/material-ui/downloads","issues_url":"https://api.github.com/repos/newoga/material-ui/issues{/number}","pulls_url":"https://api.github.com/repos/newoga/material-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/newoga/material-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/newoga/material-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/newoga/material-ui/labels{/name}","releases_url":"https://api.github.com/repos/newoga/material-ui/releases{/id}","deployments_url":"https://api.github.com/repos/newoga/material-ui/deployments","created_at":"2015-12-02T02:48:02Z","updated_at":"2016-02-01T22:19:06Z","pushed_at":"2016-08-31T18:24:34Z","git_url":"git://github.com/newoga/material-ui.git","ssh_url":"git@github.com:newoga/material-ui.git","clone_url":"https://github.com/newoga/material-ui.git","svn_url":"https://github.com/newoga/material-ui","homepage":"http://www.material-ui.com","size":41862,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"callemall:next","ref":"next","sha":"af8464406324069a2bdd4588fc2e268fe3ef184d","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}","deployments_url":"https://api.github.com/repos/callemall/material-ui/deployments","created_at":"2014-08-18T19:11:54Z","updated_at":"2016-10-19T16:03:30Z","pushed_at":"2016-10-19T18:48:48Z","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://www.material-ui.com","size":82102,"stargazers_count":20314,"watchers_count":20314,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3653,"mirror_url":null,"open_issues_count":631,"forks":3653,"open_issues":631,"watchers":20314,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/5097"},"html":{"href":"https://github.com/callemall/material-ui/pull/5097"},"issue":{"href":"https://api.github.com/repos/callemall/material-ui/issues/5097"},"comments":{"href":"https://api.github.com/repos/callemall/material-ui/issues/5097/comments"},"review_comments":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/5097/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/5097/commits"},"statuses":{"href":"https://api.github.com/repos/callemall/material-ui/statuses/cae79eba18e855297089d0b953cbc2ef5e901dcb"}}}}
{"actor":{"display_login":"oliviertassinari"}}