{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/voice-web/pulls/comments/147716799","pull_request_review_id":72850528,"id":147716799,"diff_hunk":"@@ -0,0 +1,84 @@\n+import { h, Component } from 'preact';\n+import Profile from '../profile/profile';\n+import User from '../../../user';\n+\n+interface Props {\n+  user: User;\n+}\n+\n+interface State {\n+  profileFormVisible: boolean;\n+  whyProfileVisible: boolean;\n+}\n+\n+export default class ProfileActions extends Component<Props, State> {\n+  state: State = {\n+    profileFormVisible: false,\n+    whyProfileVisible: false,\n+  };\n+\n+  private toggleProfileForm = () => {\n+    this.setState({ profileFormVisible: !this.state.profileFormVisible });\n+  };\n+\n+  private toggleWhyProfile = () => {\n+    this.setState({ whyProfileVisible: !this.state.whyProfileVisible });\n+  };\n+\n+  render() {\n+    return (\n+      <div id=\"profile-actions\">\n+        <hr />\n+        {this.state.profileFormVisible ? (\n+          <div id=\"profile-form-container\">\n+            <a class=\"cancel\" onClick={this.toggleProfileForm}>\n+              Cancel\n+            </a>\n+            <Profile active=\"\" user={this.props.user} />\n+          </div>\n+        ) : this.props.user.hasEnteredInfo() ? (\n+          <a onClick={this.toggleProfileForm}>Edit Profile</a>\n+        ) : (\n+          this.renderOnboarding()\n+        )}\n+      </div>\n+    );\n+  }\n+\n+  private renderOnboarding() {\n+    const { profileFormVisible, whyProfileVisible } = this.state;\n+    return [\n+      !profileFormVisible && (\n+        <button\n+          type=\"button\"\n+          id=\"create-profile-button\"\n+          onClick={this.toggleProfileForm}>\n+          Create a profile\n+        </button>\n+      ),\n+      <div>\n+        {whyProfileVisible ? (","path":"web/src/lib/components/pages/record/profile-actions.tsx","position":60,"original_position":60,"commit_id":"6aa14296c9cbcc4abc7f48c7e3901d6559549370","original_commit_id":"6aa14296c9cbcc4abc7f48c7e3901d6559549370","user":{"login":"nevik","id":1099818,"avatar_url":"https://avatars0.githubusercontent.com/u/1099818?v=4","gravatar_id":"","url":"https://api.github.com/users/nevik","html_url":"https://github.com/nevik","followers_url":"https://api.github.com/users/nevik/followers","following_url":"https://api.github.com/users/nevik/following{/other_user}","gists_url":"https://api.github.com/users/nevik/gists{/gist_id}","starred_url":"https://api.github.com/users/nevik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevik/subscriptions","organizations_url":"https://api.github.com/users/nevik/orgs","repos_url":"https://api.github.com/users/nevik/repos","events_url":"https://api.github.com/users/nevik/events{/privacy}","received_events_url":"https://api.github.com/users/nevik/received_events","type":"User","site_admin":false},"body":"instead of switching at the top level of the why-profile box, i think we should use a common element structure for it, and switch visibility with CSS based on a class (or so).\r\n\r\nbut we can do that in a separate PR after this one","created_at":"2017-10-30T14:24:28Z","updated_at":"2017-10-30T14:30:57Z","html_url":"https://github.com/mozilla/voice-web/pull/578#discussion_r147716799","pull_request_url":"https://api.github.com/repos/mozilla/voice-web/pulls/578","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mozilla/voice-web/pulls/comments/147716799"},"html":{"href":"https://github.com/mozilla/voice-web/pull/578#discussion_r147716799"},"pull_request":{"href":"https://api.github.com/repos/mozilla/voice-web/pulls/578"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/voice-web/pulls/578","id":149529403,"html_url":"https://github.com/mozilla/voice-web/pull/578","diff_url":"https://github.com/mozilla/voice-web/pull/578.diff","patch_url":"https://github.com/mozilla/voice-web/pull/578.patch","issue_url":"https://api.github.com/repos/mozilla/voice-web/issues/578","number":578,"state":"open","locked":false,"title":"show profile form underneath record","user":{"login":"Gregoor","id":4051932,"avatar_url":"https://avatars1.githubusercontent.com/u/4051932?v=4","gravatar_id":"","url":"https://api.github.com/users/Gregoor","html_url":"https://github.com/Gregoor","followers_url":"https://api.github.com/users/Gregoor/followers","following_url":"https://api.github.com/users/Gregoor/following{/other_user}","gists_url":"https://api.github.com/users/Gregoor/gists{/gist_id}","starred_url":"https://api.github.com/users/Gregoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gregoor/subscriptions","organizations_url":"https://api.github.com/users/Gregoor/orgs","repos_url":"https://api.github.com/users/Gregoor/repos","events_url":"https://api.github.com/users/Gregoor/events{/privacy}","received_events_url":"https://api.github.com/users/Gregoor/received_events","type":"User","site_admin":false},"body":"Issue #550","created_at":"2017-10-30T13:58:15Z","updated_at":"2017-10-30T14:30:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a485827bc6a60a69d5b3be3ae7d19f87724ef479","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/voice-web/pulls/578/commits","review_comments_url":"https://api.github.com/repos/mozilla/voice-web/pulls/578/comments","review_comment_url":"https://api.github.com/repos/mozilla/voice-web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/voice-web/issues/578/comments","statuses_url":"https://api.github.com/repos/mozilla/voice-web/statuses/6aa14296c9cbcc4abc7f48c7e3901d6559549370","head":{"label":"Gregoor:feature/profile-form-under-record","ref":"feature/profile-form-under-record","sha":"6aa14296c9cbcc4abc7f48c7e3901d6559549370","user":{"login":"Gregoor","id":4051932,"avatar_url":"https://avatars1.githubusercontent.com/u/4051932?v=4","gravatar_id":"","url":"https://api.github.com/users/Gregoor","html_url":"https://github.com/Gregoor","followers_url":"https://api.github.com/users/Gregoor/followers","following_url":"https://api.github.com/users/Gregoor/following{/other_user}","gists_url":"https://api.github.com/users/Gregoor/gists{/gist_id}","starred_url":"https://api.github.com/users/Gregoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gregoor/subscriptions","organizations_url":"https://api.github.com/users/Gregoor/orgs","repos_url":"https://api.github.com/users/Gregoor/repos","events_url":"https://api.github.com/users/Gregoor/events{/privacy}","received_events_url":"https://api.github.com/users/Gregoor/received_events","type":"User","site_admin":false},"repo":{"id":107965867,"name":"voice-web","full_name":"Gregoor/voice-web","owner":{"login":"Gregoor","id":4051932,"avatar_url":"https://avatars1.githubusercontent.com/u/4051932?v=4","gravatar_id":"","url":"https://api.github.com/users/Gregoor","html_url":"https://github.com/Gregoor","followers_url":"https://api.github.com/users/Gregoor/followers","following_url":"https://api.github.com/users/Gregoor/following{/other_user}","gists_url":"https://api.github.com/users/Gregoor/gists{/gist_id}","starred_url":"https://api.github.com/users/Gregoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gregoor/subscriptions","organizations_url":"https://api.github.com/users/Gregoor/orgs","repos_url":"https://api.github.com/users/Gregoor/repos","events_url":"https://api.github.com/users/Gregoor/events{/privacy}","received_events_url":"https://api.github.com/users/Gregoor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Gregoor/voice-web","description":"Common Voice: Our responsive web, Android and iOS apps for collecting public voice data.","fork":true,"url":"https://api.github.com/repos/Gregoor/voice-web","forks_url":"https://api.github.com/repos/Gregoor/voice-web/forks","keys_url":"https://api.github.com/repos/Gregoor/voice-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gregoor/voice-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gregoor/voice-web/teams","hooks_url":"https://api.github.com/repos/Gregoor/voice-web/hooks","issue_events_url":"https://api.github.com/repos/Gregoor/voice-web/issues/events{/number}","events_url":"https://api.github.com/repos/Gregoor/voice-web/events","assignees_url":"https://api.github.com/repos/Gregoor/voice-web/assignees{/user}","branches_url":"https://api.github.com/repos/Gregoor/voice-web/branches{/branch}","tags_url":"https://api.github.com/repos/Gregoor/voice-web/tags","blobs_url":"https://api.github.com/repos/Gregoor/voice-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gregoor/voice-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gregoor/voice-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gregoor/voice-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gregoor/voice-web/statuses/{sha}","languages_url":"https://api.github.com/repos/Gregoor/voice-web/languages","stargazers_url":"https://api.github.com/repos/Gregoor/voice-web/stargazers","contributors_url":"https://api.github.com/repos/Gregoor/voice-web/contributors","subscribers_url":"https://api.github.com/repos/Gregoor/voice-web/subscribers","subscription_url":"https://api.github.com/repos/Gregoor/voice-web/subscription","commits_url":"https://api.github.com/repos/Gregoor/voice-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gregoor/voice-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gregoor/voice-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gregoor/voice-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gregoor/voice-web/contents/{+path}","compare_url":"https://api.github.com/repos/Gregoor/voice-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gregoor/voice-web/merges","archive_url":"https://api.github.com/repos/Gregoor/voice-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gregoor/voice-web/downloads","issues_url":"https://api.github.com/repos/Gregoor/voice-web/issues{/number}","pulls_url":"https://api.github.com/repos/Gregoor/voice-web/pulls{/number}","milestones_url":"https://api.github.com/repos/Gregoor/voice-web/milestones{/number}","notifications_url":"https://api.github.com/repos/Gregoor/voice-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gregoor/voice-web/labels{/name}","releases_url":"https://api.github.com/repos/Gregoor/voice-web/releases{/id}","deployments_url":"https://api.github.com/repos/Gregoor/voice-web/deployments","created_at":"2017-10-23T10:19:02Z","updated_at":"2017-10-23T10:19:04Z","pushed_at":"2017-10-30T14:26:23Z","git_url":"git://github.com/Gregoor/voice-web.git","ssh_url":"git@github.com:Gregoor/voice-web.git","clone_url":"https://github.com/Gregoor/voice-web.git","svn_url":"https://github.com/Gregoor/voice-web","homepage":"https://voice.mozilla.org/","size":26504,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"b24e07e0c91f5c70b1eda5f6f318142707cbc274","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":90392762,"name":"voice-web","full_name":"mozilla/voice-web","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/voice-web","description":"Common Voice: Our responsive web, Android and iOS apps for collecting public voice data.","fork":false,"url":"https://api.github.com/repos/mozilla/voice-web","forks_url":"https://api.github.com/repos/mozilla/voice-web/forks","keys_url":"https://api.github.com/repos/mozilla/voice-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/voice-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/voice-web/teams","hooks_url":"https://api.github.com/repos/mozilla/voice-web/hooks","issue_events_url":"https://api.github.com/repos/mozilla/voice-web/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/voice-web/events","assignees_url":"https://api.github.com/repos/mozilla/voice-web/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/voice-web/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/voice-web/tags","blobs_url":"https://api.github.com/repos/mozilla/voice-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/voice-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/voice-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/voice-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/voice-web/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/voice-web/languages","stargazers_url":"https://api.github.com/repos/mozilla/voice-web/stargazers","contributors_url":"https://api.github.com/repos/mozilla/voice-web/contributors","subscribers_url":"https://api.github.com/repos/mozilla/voice-web/subscribers","subscription_url":"https://api.github.com/repos/mozilla/voice-web/subscription","commits_url":"https://api.github.com/repos/mozilla/voice-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/voice-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/voice-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/voice-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/voice-web/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/voice-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/voice-web/merges","archive_url":"https://api.github.com/repos/mozilla/voice-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/voice-web/downloads","issues_url":"https://api.github.com/repos/mozilla/voice-web/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/voice-web/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/voice-web/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/voice-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/voice-web/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/voice-web/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/voice-web/deployments","created_at":"2017-05-05T15:53:07Z","updated_at":"2017-10-30T14:24:58Z","pushed_at":"2017-10-30T14:25:59Z","git_url":"git://github.com/mozilla/voice-web.git","ssh_url":"git@github.com:mozilla/voice-web.git","clone_url":"https://github.com/mozilla/voice-web.git","svn_url":"https://github.com/mozilla/voice-web","homepage":"https://voice.mozilla.org/","size":26476,"stargazers_count":482,"watchers_count":482,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":104,"mirror_url":null,"archived":false,"open_issues_count":67,"forks":104,"open_issues":67,"watchers":482,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/voice-web/pulls/578"},"html":{"href":"https://github.com/mozilla/voice-web/pull/578"},"issue":{"href":"https://api.github.com/repos/mozilla/voice-web/issues/578"},"comments":{"href":"https://api.github.com/repos/mozilla/voice-web/issues/578/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/voice-web/pulls/578/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/voice-web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/voice-web/pulls/578/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/voice-web/statuses/6aa14296c9cbcc4abc7f48c7e3901d6559549370"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"nevik"}}