{"action":"created","comment":{"url":"https://api.github.com/repos/keybase/client/pulls/comments/51313085","id":51313085,"diff_hunk":"@@ -0,0 +1,116 @@\n+/* @flow */\n+/* eslint-disable react/prop-types */\n+\n+import React from 'react'\n+import _ from 'lodash'\n+\n+import {Component} from '../base-react'\n+import {globalStyles, globalColors} from '../styles/style-guide'\n+import {Text} from '../common-adapters'\n+\n+export type CarouselProps = {\n+  style?: ?Object,\n+  itemWidth: number\n+}\n+\n+class CarouselThing extends Component {\n+  render (): ReactElement {\n+    return (\n+      <div style={{...this.props.style}}>\n+          <Text style={{margin: 20}} type='Body'>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sagittis lacus vel augue laoreet.</Text>\n+      </div>\n+    )\n+  }\n+}\n+\n+function PageIndicator ({selectedIndex, itemCount, style, onClickPage}: {selectedIndex: number, itemCount: number, style: Object, onClickPage: (i: number) => void}): ReactElement {\n+  const marks = _.range(itemCount).map(n => {\n+    const color = (n === selectedIndex) ? globalColors.white : globalColors.lightBlue\n+    return (<i className='fa fa-circle' style={{color, ...styles.pageIndicator}} onClick={() => onClickPage(n)} key={n}/>)\n+  })\n+  return (\n+    <div style={style}>{marks}</div>\n+  )\n+}\n+\n+export default class Carousel extends Component {\n+  props: CarouselProps;\n+  state: {selectedIndex: number, itemCount: number};\n+\n+  interval: number;\n+  timeout: number;\n+\n+  constructor (props: CarouselProps) {\n+    super(props)\n+    this.state = {selectedIndex: 0, itemCount: 4}\n+    this.timeout = 5e3\n+  }\n+\n+  incrementIndex () {\n+    this.setState({selectedIndex: (this.state.selectedIndex + 1) % this.state.itemCount})\n+  }\n+\n+  componentDidMount () {\n+    // timer to change the state\n+    this.interval = setInterval(() => this.incrementIndex(), this.timeout)\n+  }\n+\n+  componentWillUnmount () {\n+    clearInterval(this.interval)\n+  }\n+\n+  resetIndex (i: number) {\n+    this.setState({selectedIndex: i})\n+    // Reset the timer so we don't change index as soon as the user clicks a page.\n+    clearInterval(this.interval)\n+    this.interval = setInterval(() => this.incrementIndex(), this.timeout)\n+  }\n+\n+  render (): ReactElement {\n+    const marginLeft = this.state.selectedIndex * -(this.props.itemWidth + 20)\n+    const itemWidth = this.props.itemWidth\n+    return (\n+      <div style={{...styles.carousel, ...this.props.style}}>\n+        <div style={{...globalStyles.flexBoxRow, width: itemWidth, overflow: 'visible'}}>\n+          <div style={{...styles.carouselWrapper, marginLeft}}>\n+            <CarouselThing style={{...styles.carouselThing, ...globalStyles.rounded, width: itemWidth}}/>","path":"react-native/react/util/carousel.desktop.js","position":76,"original_position":76,"commit_id":"6fa7f2da2a521d1525412dd4ce4e1cb03bea21dd","original_commit_id":"6fa7f2da2a521d1525412dd4ce4e1cb03bea21dd","user":{"login":"chrisnojima","id":516435,"avatar_url":"https://avatars.githubusercontent.com/u/516435?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisnojima","html_url":"https://github.com/chrisnojima","followers_url":"https://api.github.com/users/chrisnojima/followers","following_url":"https://api.github.com/users/chrisnojima/following{/other_user}","gists_url":"https://api.github.com/users/chrisnojima/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisnojima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisnojima/subscriptions","organizations_url":"https://api.github.com/users/chrisnojima/orgs","repos_url":"https://api.github.com/users/chrisnojima/repos","events_url":"https://api.github.com/users/chrisnojima/events{/privacy}","received_events_url":"https://api.github.com/users/chrisnojima/received_events","type":"User","site_admin":false},"body":"its fine to leave it but its a 2 line change right? :)\r\n:+1: ","created_at":"2016-01-29T20:43:34Z","updated_at":"2016-01-29T20:43:34Z","html_url":"https://github.com/keybase/client/pull/1847#discussion_r51313085","pull_request_url":"https://api.github.com/repos/keybase/client/pulls/1847","_links":{"self":{"href":"https://api.github.com/repos/keybase/client/pulls/comments/51313085"},"html":{"href":"https://github.com/keybase/client/pull/1847#discussion_r51313085"},"pull_request":{"href":"https://api.github.com/repos/keybase/client/pulls/1847"}}},"pull_request":{"url":"https://api.github.com/repos/keybase/client/pulls/1847","id":57684468,"html_url":"https://github.com/keybase/client/pull/1847","diff_url":"https://github.com/keybase/client/pull/1847.diff","patch_url":"https://github.com/keybase/client/pull/1847.patch","issue_url":"https://api.github.com/repos/keybase/client/issues/1847","number":1847,"state":"open","locked":false,"title":"Login holder","user":{"login":"MarcoPolo","id":594035,"avatar_url":"https://avatars.githubusercontent.com/u/594035?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcoPolo","html_url":"https://github.com/MarcoPolo","followers_url":"https://api.github.com/users/MarcoPolo/followers","following_url":"https://api.github.com/users/MarcoPolo/following{/other_user}","gists_url":"https://api.github.com/users/MarcoPolo/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoPolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoPolo/subscriptions","organizations_url":"https://api.github.com/users/MarcoPolo/orgs","repos_url":"https://api.github.com/users/MarcoPolo/repos","events_url":"https://api.github.com/users/MarcoPolo/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoPolo/received_events","type":"User","site_admin":false},"body":"## Preview\r\n![loginform](https://cloud.githubusercontent.com/assets/594035/12684252/b402ecdc-c672-11e5-9af2-f984690e9613.gif)\r\n\r\n\r\nThis makes the boiler plate for the login page.\r\n\r\nBasically there is a new tab called login, it doesn't show up in the top tabs on the main part of the app.\r\n\r\nWhen you go there you have a carousel, and a form container. You can put anything in the form container by registering a new path for it under login/index.js (see the `intro` component for an example).\r\n\r\nThis means that do switch between pages in the login/signup form you just have to dispatch an action to update the navState.\r\n\r\n## Dev Stuff\r\n\r\nI added a global function to dispatch the `devEdit` function, so know you can change the store arbitrarily from the console. You can do things like:\r\n```\r\ndevEdit(['tabbedRouter','tabs', 'tabs:loginTab', 'uri'], Immutable.List([Immutable.Map({path: 'root'}), Immutable.Map({path: 'foo'})])))\r\ndevEdit(['tabbedRouter','activeTab'], 'tabs:moreTab')\r\n```\r\n\r\n@keybase/react-hackers ","created_at":"2016-01-29T18:30:47Z","updated_at":"2016-01-29T20:43:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e52f0657b2bd3e318dc2a3731c82824c6c45a839","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/keybase/client/pulls/1847/commits","review_comments_url":"https://api.github.com/repos/keybase/client/pulls/1847/comments","review_comment_url":"https://api.github.com/repos/keybase/client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/keybase/client/issues/1847/comments","statuses_url":"https://api.github.com/repos/keybase/client/statuses/6fa7f2da2a521d1525412dd4ce4e1cb03bea21dd","head":{"label":"keybase:login-holder","ref":"login-holder","sha":"6fa7f2da2a521d1525412dd4ce4e1cb03bea21dd","user":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"repo":{"id":29099181,"name":"client","full_name":"keybase/client","owner":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keybase/client","description":"Keybase Go Library, Client, Service, OS X, iOS, Android, Electron","fork":false,"url":"https://api.github.com/repos/keybase/client","forks_url":"https://api.github.com/repos/keybase/client/forks","keys_url":"https://api.github.com/repos/keybase/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keybase/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keybase/client/teams","hooks_url":"https://api.github.com/repos/keybase/client/hooks","issue_events_url":"https://api.github.com/repos/keybase/client/issues/events{/number}","events_url":"https://api.github.com/repos/keybase/client/events","assignees_url":"https://api.github.com/repos/keybase/client/assignees{/user}","branches_url":"https://api.github.com/repos/keybase/client/branches{/branch}","tags_url":"https://api.github.com/repos/keybase/client/tags","blobs_url":"https://api.github.com/repos/keybase/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keybase/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keybase/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/keybase/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keybase/client/statuses/{sha}","languages_url":"https://api.github.com/repos/keybase/client/languages","stargazers_url":"https://api.github.com/repos/keybase/client/stargazers","contributors_url":"https://api.github.com/repos/keybase/client/contributors","subscribers_url":"https://api.github.com/repos/keybase/client/subscribers","subscription_url":"https://api.github.com/repos/keybase/client/subscription","commits_url":"https://api.github.com/repos/keybase/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/keybase/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/keybase/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/keybase/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/keybase/client/contents/{+path}","compare_url":"https://api.github.com/repos/keybase/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keybase/client/merges","archive_url":"https://api.github.com/repos/keybase/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keybase/client/downloads","issues_url":"https://api.github.com/repos/keybase/client/issues{/number}","pulls_url":"https://api.github.com/repos/keybase/client/pulls{/number}","milestones_url":"https://api.github.com/repos/keybase/client/milestones{/number}","notifications_url":"https://api.github.com/repos/keybase/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keybase/client/labels{/name}","releases_url":"https://api.github.com/repos/keybase/client/releases{/id}","deployments_url":"https://api.github.com/repos/keybase/client/deployments","created_at":"2015-01-11T17:17:12Z","updated_at":"2016-01-28T08:59:53Z","pushed_at":"2016-01-29T20:03:13Z","git_url":"git://github.com/keybase/client.git","ssh_url":"git@github.com:keybase/client.git","clone_url":"https://github.com/keybase/client.git","svn_url":"https://github.com/keybase/client","homepage":"","size":140474,"stargazers_count":75,"watchers_count":75,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":27,"forks":6,"open_issues":27,"watchers":75,"default_branch":"master"}},"base":{"label":"keybase:master","ref":"master","sha":"4c520a15d0f560ff4e38bf177df13c4417dad3ef","user":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"repo":{"id":29099181,"name":"client","full_name":"keybase/client","owner":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keybase/client","description":"Keybase Go Library, Client, Service, OS X, iOS, Android, Electron","fork":false,"url":"https://api.github.com/repos/keybase/client","forks_url":"https://api.github.com/repos/keybase/client/forks","keys_url":"https://api.github.com/repos/keybase/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keybase/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keybase/client/teams","hooks_url":"https://api.github.com/repos/keybase/client/hooks","issue_events_url":"https://api.github.com/repos/keybase/client/issues/events{/number}","events_url":"https://api.github.com/repos/keybase/client/events","assignees_url":"https://api.github.com/repos/keybase/client/assignees{/user}","branches_url":"https://api.github.com/repos/keybase/client/branches{/branch}","tags_url":"https://api.github.com/repos/keybase/client/tags","blobs_url":"https://api.github.com/repos/keybase/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keybase/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keybase/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/keybase/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keybase/client/statuses/{sha}","languages_url":"https://api.github.com/repos/keybase/client/languages","stargazers_url":"https://api.github.com/repos/keybase/client/stargazers","contributors_url":"https://api.github.com/repos/keybase/client/contributors","subscribers_url":"https://api.github.com/repos/keybase/client/subscribers","subscription_url":"https://api.github.com/repos/keybase/client/subscription","commits_url":"https://api.github.com/repos/keybase/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/keybase/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/keybase/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/keybase/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/keybase/client/contents/{+path}","compare_url":"https://api.github.com/repos/keybase/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keybase/client/merges","archive_url":"https://api.github.com/repos/keybase/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keybase/client/downloads","issues_url":"https://api.github.com/repos/keybase/client/issues{/number}","pulls_url":"https://api.github.com/repos/keybase/client/pulls{/number}","milestones_url":"https://api.github.com/repos/keybase/client/milestones{/number}","notifications_url":"https://api.github.com/repos/keybase/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keybase/client/labels{/name}","releases_url":"https://api.github.com/repos/keybase/client/releases{/id}","deployments_url":"https://api.github.com/repos/keybase/client/deployments","created_at":"2015-01-11T17:17:12Z","updated_at":"2016-01-28T08:59:53Z","pushed_at":"2016-01-29T20:03:13Z","git_url":"git://github.com/keybase/client.git","ssh_url":"git@github.com:keybase/client.git","clone_url":"https://github.com/keybase/client.git","svn_url":"https://github.com/keybase/client","homepage":"","size":140474,"stargazers_count":75,"watchers_count":75,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":27,"forks":6,"open_issues":27,"watchers":75,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keybase/client/pulls/1847"},"html":{"href":"https://github.com/keybase/client/pull/1847"},"issue":{"href":"https://api.github.com/repos/keybase/client/issues/1847"},"comments":{"href":"https://api.github.com/repos/keybase/client/issues/1847/comments"},"review_comments":{"href":"https://api.github.com/repos/keybase/client/pulls/1847/comments"},"review_comment":{"href":"https://api.github.com/repos/keybase/client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/keybase/client/pulls/1847/commits"},"statuses":{"href":"https://api.github.com/repos/keybase/client/statuses/6fa7f2da2a521d1525412dd4ce4e1cb03bea21dd"}}}}