{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/comments/192226840","pull_request_review_id":124963323,"id":192226840,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjIyNjg0MA==","diff_hunk":"@@ -0,0 +1,122 @@\n+/* @flow */\n+import makeClassName from 'classnames';\n+import * as React from 'react';\n+import { compose } from 'redux';\n+\n+import translate from 'core/i18n/translate';\n+import Button from 'ui/components/Button';\n+import type { I18nType } from 'core/types/i18n';\n+\n+import './styles.scss';\n+\n+\n+type Props = {|\n+  buttonType?: string,\n+  cancelButtonText?: string,\n+  cancelButtonType?: string,\n+  children: React.Element<any>,\n+  className?: string,\n+  confirmButtonText?: string,\n+  confirmButtonType?: string,\n+  i18n: I18nType,\n+  message: string,\n+  onConfirm: Function,\n+|};\n+\n+type State = {|\n+  showConfirmation: boolean,\n+|};\n+\n+export class ConfirmButtonBase extends React.Component<Props, State> {\n+  static defaultProps = {\n+    buttonType: 'neutral',\n+    cancelButtonText: null,\n+    cancelButtonType: 'cancel',\n+    confirmButtonText: null,\n+    confirmButtonType: 'alert',\n+  };\n+\n+  constructor(props: Props) {\n+    super(props);\n+\n+    this.state = {\n+      showConfirmation: false,\n+    };\n+  }\n+\n+  onConfirm = (e: SyntheticEvent<HTMLButtonElement>) => {\n+    this.setState({ showConfirmation: false });\n+    this.props.onConfirm(e);\n+  }\n+\n+  toggleConfirmation = (e: SyntheticEvent<HTMLButtonElement>) => {\n+    e.preventDefault();\n+\n+    this.setState((prevState) => ({\n+      showConfirmation: !prevState.showConfirmation,\n+    }));\n+  }\n+\n+  render() {\n+    const {\n+      buttonType,\n+      cancelButtonText,\n+      cancelButtonType,\n+      children,\n+      className,\n+      confirmButtonText,\n+      confirmButtonType,\n+      i18n,\n+      message,\n+    } = this.props;\n+\n+    const { showConfirmation } = this.state;\n+\n+    const classNames = makeClassName('ConfirmButton', className, {\n+      'ConfirmButton--show-confirmation': showConfirmation,\n+    });\n+\n+    if (this.state.showConfirmation) {","path":"src/ui/components/ConfirmButton/index.js","position":79,"original_position":79,"commit_id":"2d5aa6e0ef93ce0fb82d547a21e93e7aaba658c4","original_commit_id":"2d5aa6e0ef93ce0fb82d547a21e93e7aaba658c4","user":{"login":"willdurand","id":217628,"node_id":"MDQ6VXNlcjIxNzYyOA==","avatar_url":"https://avatars0.githubusercontent.com/u/217628?v=4","gravatar_id":"","url":"https://api.github.com/users/willdurand","html_url":"https://github.com/willdurand","followers_url":"https://api.github.com/users/willdurand/followers","following_url":"https://api.github.com/users/willdurand/following{/other_user}","gists_url":"https://api.github.com/users/willdurand/gists{/gist_id}","starred_url":"https://api.github.com/users/willdurand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willdurand/subscriptions","organizations_url":"https://api.github.com/users/willdurand/orgs","repos_url":"https://api.github.com/users/willdurand/repos","events_url":"https://api.github.com/users/willdurand/events{/privacy}","received_events_url":"https://api.github.com/users/willdurand/received_events","type":"User","site_admin":false},"body":"good catch! ","created_at":"2018-05-31T20:28:13Z","updated_at":"2018-05-31T20:28:13Z","html_url":"https://github.com/mozilla/addons-frontend/pull/5152#discussion_r192226840","pull_request_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/5152","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/comments/192226840"},"html":{"href":"https://github.com/mozilla/addons-frontend/pull/5152#discussion_r192226840"},"pull_request":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/5152"}},"in_reply_to_id":192196318},"pull_request":{"url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/5152","id":191741454,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxNzQxNDU0","html_url":"https://github.com/mozilla/addons-frontend/pull/5152","diff_url":"https://github.com/mozilla/addons-frontend/pull/5152.diff","patch_url":"https://github.com/mozilla/addons-frontend/pull/5152.patch","issue_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/5152","number":5152,"state":"open","locked":false,"title":"Add a ConfirmButton and use it to delete a profile picture","user":{"login":"willdurand","id":217628,"node_id":"MDQ6VXNlcjIxNzYyOA==","avatar_url":"https://avatars0.githubusercontent.com/u/217628?v=4","gravatar_id":"","url":"https://api.github.com/users/willdurand","html_url":"https://github.com/willdurand","followers_url":"https://api.github.com/users/willdurand/followers","following_url":"https://api.github.com/users/willdurand/following{/other_user}","gists_url":"https://api.github.com/users/willdurand/gists{/gist_id}","starred_url":"https://api.github.com/users/willdurand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willdurand/subscriptions","organizations_url":"https://api.github.com/users/willdurand/orgs","repos_url":"https://api.github.com/users/willdurand/repos","events_url":"https://api.github.com/users/willdurand/events{/privacy}","received_events_url":"https://api.github.com/users/willdurand/received_events","type":"User","site_admin":false},"body":"Fix #5151\r\n\r\n---\r\n\r\nNotes:\r\n\r\n- I chose to hide this action on small screens. I am not sure we really need it on a smartphone...\r\n- The \"cancel\" style for the button is fixed in another PR (#5140)\r\n\r\n## Gif\r\n\r\n![2018-05-31 13 38 20](https://user-images.githubusercontent.com/217628/40782832-790c8dc0-64d8-11e8-9d0e-09631cebf96b.gif)\r\n","created_at":"2018-05-31T12:42:20Z","updated_at":"2018-05-31T20:28:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66be9aa0dfb2ec5b557bc820ee0e97d68dea8004","assignee":null,"assignees":[],"requested_reviewers":[{"login":"bobsilverberg","id":142755,"node_id":"MDQ6VXNlcjE0Mjc1NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/142755?v=4","gravatar_id":"","url":"https://api.github.com/users/bobsilverberg","html_url":"https://github.com/bobsilverberg","followers_url":"https://api.github.com/users/bobsilverberg/followers","following_url":"https://api.github.com/users/bobsilverberg/following{/other_user}","gists_url":"https://api.github.com/users/bobsilverberg/gists{/gist_id}","starred_url":"https://api.github.com/users/bobsilverberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobsilverberg/subscriptions","organizations_url":"https://api.github.com/users/bobsilverberg/orgs","repos_url":"https://api.github.com/users/bobsilverberg/repos","events_url":"https://api.github.com/users/bobsilverberg/events{/privacy}","received_events_url":"https://api.github.com/users/bobsilverberg/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/5152/commits","review_comments_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/5152/comments","review_comment_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/5152/comments","statuses_url":"https://api.github.com/repos/mozilla/addons-frontend/statuses/2d5aa6e0ef93ce0fb82d547a21e93e7aaba658c4","head":{"label":"mozilla:confirm-picture-deletion","ref":"confirm-picture-deletion","sha":"2d5aa6e0ef93ce0fb82d547a21e93e7aaba658c4","user":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","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":52104368,"node_id":"MDEwOlJlcG9zaXRvcnk1MjEwNDM2OA==","name":"addons-frontend","full_name":"mozilla/addons-frontend","owner":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","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/addons-frontend","description":"Front-end to complement mozilla/addons-server","fork":false,"url":"https://api.github.com/repos/mozilla/addons-frontend","forks_url":"https://api.github.com/repos/mozilla/addons-frontend/forks","keys_url":"https://api.github.com/repos/mozilla/addons-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/addons-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/addons-frontend/teams","hooks_url":"https://api.github.com/repos/mozilla/addons-frontend/hooks","issue_events_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/addons-frontend/events","assignees_url":"https://api.github.com/repos/mozilla/addons-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/addons-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/addons-frontend/tags","blobs_url":"https://api.github.com/repos/mozilla/addons-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/addons-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/addons-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/addons-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/addons-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/addons-frontend/languages","stargazers_url":"https://api.github.com/repos/mozilla/addons-frontend/stargazers","contributors_url":"https://api.github.com/repos/mozilla/addons-frontend/contributors","subscribers_url":"https://api.github.com/repos/mozilla/addons-frontend/subscribers","subscription_url":"https://api.github.com/repos/mozilla/addons-frontend/subscription","commits_url":"https://api.github.com/repos/mozilla/addons-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/addons-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/addons-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/addons-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/addons-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/addons-frontend/merges","archive_url":"https://api.github.com/repos/mozilla/addons-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/addons-frontend/downloads","issues_url":"https://api.github.com/repos/mozilla/addons-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/addons-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/addons-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/addons-frontend/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/addons-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/addons-frontend/deployments","created_at":"2016-02-19T17:25:57Z","updated_at":"2018-05-31T20:12:22Z","pushed_at":"2018-05-31T20:12:19Z","git_url":"git://github.com/mozilla/addons-frontend.git","ssh_url":"git@github.com:mozilla/addons-frontend.git","clone_url":"https://github.com/mozilla/addons-frontend.git","svn_url":"https://github.com/mozilla/addons-frontend","homepage":"","size":520838,"stargazers_count":213,"watchers_count":213,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":142,"mirror_url":null,"archived":false,"open_issues_count":458,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":142,"open_issues":458,"watchers":213,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"54b1d145afecce13aeecfb85ec84ffc7b2ea4189","user":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","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":52104368,"node_id":"MDEwOlJlcG9zaXRvcnk1MjEwNDM2OA==","name":"addons-frontend","full_name":"mozilla/addons-frontend","owner":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","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/addons-frontend","description":"Front-end to complement mozilla/addons-server","fork":false,"url":"https://api.github.com/repos/mozilla/addons-frontend","forks_url":"https://api.github.com/repos/mozilla/addons-frontend/forks","keys_url":"https://api.github.com/repos/mozilla/addons-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/addons-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/addons-frontend/teams","hooks_url":"https://api.github.com/repos/mozilla/addons-frontend/hooks","issue_events_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/addons-frontend/events","assignees_url":"https://api.github.com/repos/mozilla/addons-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/addons-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/addons-frontend/tags","blobs_url":"https://api.github.com/repos/mozilla/addons-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/addons-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/addons-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/addons-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/addons-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/addons-frontend/languages","stargazers_url":"https://api.github.com/repos/mozilla/addons-frontend/stargazers","contributors_url":"https://api.github.com/repos/mozilla/addons-frontend/contributors","subscribers_url":"https://api.github.com/repos/mozilla/addons-frontend/subscribers","subscription_url":"https://api.github.com/repos/mozilla/addons-frontend/subscription","commits_url":"https://api.github.com/repos/mozilla/addons-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/addons-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/addons-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/addons-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/addons-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/addons-frontend/merges","archive_url":"https://api.github.com/repos/mozilla/addons-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/addons-frontend/downloads","issues_url":"https://api.github.com/repos/mozilla/addons-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/addons-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/addons-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/addons-frontend/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/addons-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/addons-frontend/deployments","created_at":"2016-02-19T17:25:57Z","updated_at":"2018-05-31T20:12:22Z","pushed_at":"2018-05-31T20:12:19Z","git_url":"git://github.com/mozilla/addons-frontend.git","ssh_url":"git@github.com:mozilla/addons-frontend.git","clone_url":"https://github.com/mozilla/addons-frontend.git","svn_url":"https://github.com/mozilla/addons-frontend","homepage":"","size":520838,"stargazers_count":213,"watchers_count":213,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":142,"mirror_url":null,"archived":false,"open_issues_count":458,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":142,"open_issues":458,"watchers":213,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/5152"},"html":{"href":"https://github.com/mozilla/addons-frontend/pull/5152"},"issue":{"href":"https://api.github.com/repos/mozilla/addons-frontend/issues/5152"},"comments":{"href":"https://api.github.com/repos/mozilla/addons-frontend/issues/5152/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/5152/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/5152/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/addons-frontend/statuses/2d5aa6e0ef93ce0fb82d547a21e93e7aaba658c4"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"willdurand"}}