{"action":"created","comment":{"url":"https://api.github.com/repos/CityOfZion/neon-wallet/pulls/comments/179652108","pull_request_review_id":109932152,"id":179652108,"diff_hunk":"@@ -0,0 +1,62 @@\n+// @flow\n+\n+import React, { Component } from 'react'\n+import { omit } from 'lodash'\n+\n+import styles from './Button.scss'\n+import Login from '../../../images/icons/Login.svg'\n+import Plus from '../../../images/icons/Plus.svg'\n+import Wallet from '../../../images/icons/Wallet.svg'\n+\n+const iconMap = name => {\n+  if (!name) {\n+    return console.warn('iconMap in Button.jsx invoked without a valid icon!')\n+  }\n+\n+  const icons = {\n+    login: Login,\n+    plus: Plus,\n+    wallet: Wallet\n+  }\n+  return icons[name]\n+}\n+\n+type Props = {\n+  icon: ?string,\n+  text: string,\n+  dark: ?boolean,\n+  light: ?boolean\n+}\n+\n+class Button extends Component<Props> {\n+  render = () => {\n+    const { dark, light, text, icon } = this.props\n+    const passDownProps = omit(this.props, 'dark', 'light', 'icon')\n+    const Icon = iconMap(icon)","path":"app/components/Button/Redesign/Button.jsx","position":35,"original_position":35,"commit_id":"ffa74df326dd2e6e47dc6e6f121204ed6698382c","original_commit_id":"ffa74df326dd2e6e47dc6e6f121204ed6698382c","user":{"login":"mhuggins","id":169093,"avatar_url":"https://avatars0.githubusercontent.com/u/169093?v=4","gravatar_id":"","url":"https://api.github.com/users/mhuggins","html_url":"https://github.com/mhuggins","followers_url":"https://api.github.com/users/mhuggins/followers","following_url":"https://api.github.com/users/mhuggins/following{/other_user}","gists_url":"https://api.github.com/users/mhuggins/gists{/gist_id}","starred_url":"https://api.github.com/users/mhuggins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhuggins/subscriptions","organizations_url":"https://api.github.com/users/mhuggins/orgs","repos_url":"https://api.github.com/users/mhuggins/repos","events_url":"https://api.github.com/users/mhuggins/events{/privacy}","received_events_url":"https://api.github.com/users/mhuggins/received_events","type":"User","site_admin":false},"body":"By hard coding the icon map in here, we're limiting the capabilities of the button.  Something I've started doing in components that may or may not want something rendered in a certain way (e.g.: a header or footer), is to pass in a special render function prop for that (e.g.: `renderHeader` or `renderFooter`).  That way, whatever is using the prop can pass in exactly what it needs using any style it wants, and there's no further need to update the other component to support new rendering functionality.\r\n\r\nFor this component, that might look something like this:\r\n\r\n```js\r\ntype Props = {\r\n  renderIcon: ?Function\r\n}\r\n\r\nrender = () => {\r\n  return (\r\n    <button className={classNames(styles.button, buttonStyle)}>\r\n      {this.renderIcon()}\r\n      <span>{text}</span>\r\n  )\r\n}\r\n\r\nrenderIcon = {\r\n  if (!this.props.renderIcon) {\r\n    return null\r\n  }\r\n\r\n  return (\r\n    <span className={classNames(styles.icon, iconStyle)}>\r\n      {this.props.renderIcon()}\r\n    </span>\r\n  )\r\n}\r\n```","created_at":"2018-04-06T03:19:33Z","updated_at":"2018-04-06T03:28:44Z","html_url":"https://github.com/CityOfZion/neon-wallet/pull/943#discussion_r179652108","pull_request_url":"https://api.github.com/repos/CityOfZion/neon-wallet/pulls/943","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/CityOfZion/neon-wallet/pulls/comments/179652108"},"html":{"href":"https://github.com/CityOfZion/neon-wallet/pull/943#discussion_r179652108"},"pull_request":{"href":"https://api.github.com/repos/CityOfZion/neon-wallet/pulls/943"}}},"pull_request":{"url":"https://api.github.com/repos/CityOfZion/neon-wallet/pulls/943","id":179837643,"html_url":"https://github.com/CityOfZion/neon-wallet/pull/943","diff_url":"https://github.com/CityOfZion/neon-wallet/pull/943.diff","patch_url":"https://github.com/CityOfZion/neon-wallet/pull/943.patch","issue_url":"https://api.github.com/repos/CityOfZion/neon-wallet/issues/943","number":943,"state":"open","locked":false,"title":"button redesign","user":{"login":"comountainclimber","id":13072035,"avatar_url":"https://avatars0.githubusercontent.com/u/13072035?v=4","gravatar_id":"","url":"https://api.github.com/users/comountainclimber","html_url":"https://github.com/comountainclimber","followers_url":"https://api.github.com/users/comountainclimber/followers","following_url":"https://api.github.com/users/comountainclimber/following{/other_user}","gists_url":"https://api.github.com/users/comountainclimber/gists{/gist_id}","starred_url":"https://api.github.com/users/comountainclimber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/comountainclimber/subscriptions","organizations_url":"https://api.github.com/users/comountainclimber/orgs","repos_url":"https://api.github.com/users/comountainclimber/repos","events_url":"https://api.github.com/users/comountainclimber/events{/privacy}","received_events_url":"https://api.github.com/users/comountainclimber/received_events","type":"User","site_admin":false},"body":"\r\n<img width=\"861\" alt=\"screen shot 2018-04-04 at 9 31 58 pm\" src=\"https://user-images.githubusercontent.com/13072035/38399911-8123197e-390a-11e8-8ced-737c06638da2.png\">\r\n<img width=\"1440\" alt=\"screen shot 2018-04-04 at 8 48 17 pm\" src=\"https://user-images.githubusercontent.com/13072035/38399912-821d11c2-390a-11e8-86f4-ad4693e703dc.png\">\r\n<img width=\"1440\" alt=\"screen shot 2018-04-04 at 8 40 30 pm\" src=\"https://user-images.githubusercontent.com/13072035/38399914-834a7850-390a-11e8-9f98-8f46697b979b.png\">\r\n<img width=\"1440\" alt=\"screen shot 2018-04-04 at 8 40 24 pm\" src=\"https://user-images.githubusercontent.com/13072035/38399917-84957674-390a-11e8-87d1-e58a512c8d52.png\">\r\n<img width=\"1041\" alt=\"screen shot 2018-04-02 at 11 18 31 am\" src=\"https://user-images.githubusercontent.com/13072035/38399918-8596b5e2-390a-11e8-9f52-d5a6b7914438.png\">\r\n\r\n\r\n**What current issue(s) from Trello/Github does this address?**\r\n\r\n**What problem does this PR solve?**\r\nThis PR adds a new button component based on the redesign spec above ss show hover/active states.\r\n\r\n**How did you solve this problem?**\r\nReact and CSS\r\n\r\n**How did you make sure your solution works?**\r\nExtensive testing on my local work on Home.jsx\r\n\r\n**Are there any special changes in the code that we should be aware of?**\r\nThe PR adds a `.prettierrc` file for those of us who get down with that.\r\n\r\n**Is there anything else we should know?**\r\n\r\n- [ ] Unit tests written?\r\n","created_at":"2018-04-06T01:51:12Z","updated_at":"2018-04-06T03:28:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df3cad31376deadb00c637066b667f41a2210a91","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/CityOfZion/neon-wallet/pulls/943/commits","review_comments_url":"https://api.github.com/repos/CityOfZion/neon-wallet/pulls/943/comments","review_comment_url":"https://api.github.com/repos/CityOfZion/neon-wallet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CityOfZion/neon-wallet/issues/943/comments","statuses_url":"https://api.github.com/repos/CityOfZion/neon-wallet/statuses/ffa74df326dd2e6e47dc6e6f121204ed6698382c","head":{"label":"comountainclimber:feature/button-refactor","ref":"feature/button-refactor","sha":"ffa74df326dd2e6e47dc6e6f121204ed6698382c","user":{"login":"comountainclimber","id":13072035,"avatar_url":"https://avatars0.githubusercontent.com/u/13072035?v=4","gravatar_id":"","url":"https://api.github.com/users/comountainclimber","html_url":"https://github.com/comountainclimber","followers_url":"https://api.github.com/users/comountainclimber/followers","following_url":"https://api.github.com/users/comountainclimber/following{/other_user}","gists_url":"https://api.github.com/users/comountainclimber/gists{/gist_id}","starred_url":"https://api.github.com/users/comountainclimber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/comountainclimber/subscriptions","organizations_url":"https://api.github.com/users/comountainclimber/orgs","repos_url":"https://api.github.com/users/comountainclimber/repos","events_url":"https://api.github.com/users/comountainclimber/events{/privacy}","received_events_url":"https://api.github.com/users/comountainclimber/received_events","type":"User","site_admin":false},"repo":{"id":117926760,"name":"neon-wallet","full_name":"comountainclimber/neon-wallet","owner":{"login":"comountainclimber","id":13072035,"avatar_url":"https://avatars0.githubusercontent.com/u/13072035?v=4","gravatar_id":"","url":"https://api.github.com/users/comountainclimber","html_url":"https://github.com/comountainclimber","followers_url":"https://api.github.com/users/comountainclimber/followers","following_url":"https://api.github.com/users/comountainclimber/following{/other_user}","gists_url":"https://api.github.com/users/comountainclimber/gists{/gist_id}","starred_url":"https://api.github.com/users/comountainclimber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/comountainclimber/subscriptions","organizations_url":"https://api.github.com/users/comountainclimber/orgs","repos_url":"https://api.github.com/users/comountainclimber/repos","events_url":"https://api.github.com/users/comountainclimber/events{/privacy}","received_events_url":"https://api.github.com/users/comountainclimber/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/comountainclimber/neon-wallet","description":"Light wallet for the NEO blockchain","fork":true,"url":"https://api.github.com/repos/comountainclimber/neon-wallet","forks_url":"https://api.github.com/repos/comountainclimber/neon-wallet/forks","keys_url":"https://api.github.com/repos/comountainclimber/neon-wallet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/comountainclimber/neon-wallet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/comountainclimber/neon-wallet/teams","hooks_url":"https://api.github.com/repos/comountainclimber/neon-wallet/hooks","issue_events_url":"https://api.github.com/repos/comountainclimber/neon-wallet/issues/events{/number}","events_url":"https://api.github.com/repos/comountainclimber/neon-wallet/events","assignees_url":"https://api.github.com/repos/comountainclimber/neon-wallet/assignees{/user}","branches_url":"https://api.github.com/repos/comountainclimber/neon-wallet/branches{/branch}","tags_url":"https://api.github.com/repos/comountainclimber/neon-wallet/tags","blobs_url":"https://api.github.com/repos/comountainclimber/neon-wallet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/comountainclimber/neon-wallet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/comountainclimber/neon-wallet/git/refs{/sha}","trees_url":"https://api.github.com/repos/comountainclimber/neon-wallet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/comountainclimber/neon-wallet/statuses/{sha}","languages_url":"https://api.github.com/repos/comountainclimber/neon-wallet/languages","stargazers_url":"https://api.github.com/repos/comountainclimber/neon-wallet/stargazers","contributors_url":"https://api.github.com/repos/comountainclimber/neon-wallet/contributors","subscribers_url":"https://api.github.com/repos/comountainclimber/neon-wallet/subscribers","subscription_url":"https://api.github.com/repos/comountainclimber/neon-wallet/subscription","commits_url":"https://api.github.com/repos/comountainclimber/neon-wallet/commits{/sha}","git_commits_url":"https://api.github.com/repos/comountainclimber/neon-wallet/git/commits{/sha}","comments_url":"https://api.github.com/repos/comountainclimber/neon-wallet/comments{/number}","issue_comment_url":"https://api.github.com/repos/comountainclimber/neon-wallet/issues/comments{/number}","contents_url":"https://api.github.com/repos/comountainclimber/neon-wallet/contents/{+path}","compare_url":"https://api.github.com/repos/comountainclimber/neon-wallet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/comountainclimber/neon-wallet/merges","archive_url":"https://api.github.com/repos/comountainclimber/neon-wallet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/comountainclimber/neon-wallet/downloads","issues_url":"https://api.github.com/repos/comountainclimber/neon-wallet/issues{/number}","pulls_url":"https://api.github.com/repos/comountainclimber/neon-wallet/pulls{/number}","milestones_url":"https://api.github.com/repos/comountainclimber/neon-wallet/milestones{/number}","notifications_url":"https://api.github.com/repos/comountainclimber/neon-wallet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/comountainclimber/neon-wallet/labels{/name}","releases_url":"https://api.github.com/repos/comountainclimber/neon-wallet/releases{/id}","deployments_url":"https://api.github.com/repos/comountainclimber/neon-wallet/deployments","created_at":"2018-01-18T03:25:51Z","updated_at":"2018-01-18T03:25:54Z","pushed_at":"2018-04-06T01:49:23Z","git_url":"git://github.com/comountainclimber/neon-wallet.git","ssh_url":"git@github.com:comountainclimber/neon-wallet.git","clone_url":"https://github.com/comountainclimber/neon-wallet.git","svn_url":"https://github.com/comountainclimber/neon-wallet","homepage":"http://neonwallet.com","size":48007,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"CityOfZion:design-v2","ref":"design-v2","sha":"fd131fbfdcea3e80b13d5bde4045ed1016c7939c","user":{"login":"CityOfZion","id":29782569,"avatar_url":"https://avatars1.githubusercontent.com/u/29782569?v=4","gravatar_id":"","url":"https://api.github.com/users/CityOfZion","html_url":"https://github.com/CityOfZion","followers_url":"https://api.github.com/users/CityOfZion/followers","following_url":"https://api.github.com/users/CityOfZion/following{/other_user}","gists_url":"https://api.github.com/users/CityOfZion/gists{/gist_id}","starred_url":"https://api.github.com/users/CityOfZion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CityOfZion/subscriptions","organizations_url":"https://api.github.com/users/CityOfZion/orgs","repos_url":"https://api.github.com/users/CityOfZion/repos","events_url":"https://api.github.com/users/CityOfZion/events{/privacy}","received_events_url":"https://api.github.com/users/CityOfZion/received_events","type":"Organization","site_admin":false},"repo":{"id":95630805,"name":"neon-wallet","full_name":"CityOfZion/neon-wallet","owner":{"login":"CityOfZion","id":29782569,"avatar_url":"https://avatars1.githubusercontent.com/u/29782569?v=4","gravatar_id":"","url":"https://api.github.com/users/CityOfZion","html_url":"https://github.com/CityOfZion","followers_url":"https://api.github.com/users/CityOfZion/followers","following_url":"https://api.github.com/users/CityOfZion/following{/other_user}","gists_url":"https://api.github.com/users/CityOfZion/gists{/gist_id}","starred_url":"https://api.github.com/users/CityOfZion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CityOfZion/subscriptions","organizations_url":"https://api.github.com/users/CityOfZion/orgs","repos_url":"https://api.github.com/users/CityOfZion/repos","events_url":"https://api.github.com/users/CityOfZion/events{/privacy}","received_events_url":"https://api.github.com/users/CityOfZion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CityOfZion/neon-wallet","description":"Light wallet for the NEO blockchain","fork":false,"url":"https://api.github.com/repos/CityOfZion/neon-wallet","forks_url":"https://api.github.com/repos/CityOfZion/neon-wallet/forks","keys_url":"https://api.github.com/repos/CityOfZion/neon-wallet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CityOfZion/neon-wallet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CityOfZion/neon-wallet/teams","hooks_url":"https://api.github.com/repos/CityOfZion/neon-wallet/hooks","issue_events_url":"https://api.github.com/repos/CityOfZion/neon-wallet/issues/events{/number}","events_url":"https://api.github.com/repos/CityOfZion/neon-wallet/events","assignees_url":"https://api.github.com/repos/CityOfZion/neon-wallet/assignees{/user}","branches_url":"https://api.github.com/repos/CityOfZion/neon-wallet/branches{/branch}","tags_url":"https://api.github.com/repos/CityOfZion/neon-wallet/tags","blobs_url":"https://api.github.com/repos/CityOfZion/neon-wallet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CityOfZion/neon-wallet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CityOfZion/neon-wallet/git/refs{/sha}","trees_url":"https://api.github.com/repos/CityOfZion/neon-wallet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CityOfZion/neon-wallet/statuses/{sha}","languages_url":"https://api.github.com/repos/CityOfZion/neon-wallet/languages","stargazers_url":"https://api.github.com/repos/CityOfZion/neon-wallet/stargazers","contributors_url":"https://api.github.com/repos/CityOfZion/neon-wallet/contributors","subscribers_url":"https://api.github.com/repos/CityOfZion/neon-wallet/subscribers","subscription_url":"https://api.github.com/repos/CityOfZion/neon-wallet/subscription","commits_url":"https://api.github.com/repos/CityOfZion/neon-wallet/commits{/sha}","git_commits_url":"https://api.github.com/repos/CityOfZion/neon-wallet/git/commits{/sha}","comments_url":"https://api.github.com/repos/CityOfZion/neon-wallet/comments{/number}","issue_comment_url":"https://api.github.com/repos/CityOfZion/neon-wallet/issues/comments{/number}","contents_url":"https://api.github.com/repos/CityOfZion/neon-wallet/contents/{+path}","compare_url":"https://api.github.com/repos/CityOfZion/neon-wallet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CityOfZion/neon-wallet/merges","archive_url":"https://api.github.com/repos/CityOfZion/neon-wallet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CityOfZion/neon-wallet/downloads","issues_url":"https://api.github.com/repos/CityOfZion/neon-wallet/issues{/number}","pulls_url":"https://api.github.com/repos/CityOfZion/neon-wallet/pulls{/number}","milestones_url":"https://api.github.com/repos/CityOfZion/neon-wallet/milestones{/number}","notifications_url":"https://api.github.com/repos/CityOfZion/neon-wallet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CityOfZion/neon-wallet/labels{/name}","releases_url":"https://api.github.com/repos/CityOfZion/neon-wallet/releases{/id}","deployments_url":"https://api.github.com/repos/CityOfZion/neon-wallet/deployments","created_at":"2017-06-28T05:11:01Z","updated_at":"2018-04-04T16:00:00Z","pushed_at":"2018-04-06T01:51:13Z","git_url":"git://github.com/CityOfZion/neon-wallet.git","ssh_url":"git@github.com:CityOfZion/neon-wallet.git","clone_url":"https://github.com/CityOfZion/neon-wallet.git","svn_url":"https://github.com/CityOfZion/neon-wallet","homepage":"http://neonwallet.com","size":47192,"stargazers_count":804,"watchers_count":804,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":224,"mirror_url":null,"archived":false,"open_issues_count":84,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":224,"open_issues":84,"watchers":804,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/CityOfZion/neon-wallet/pulls/943"},"html":{"href":"https://github.com/CityOfZion/neon-wallet/pull/943"},"issue":{"href":"https://api.github.com/repos/CityOfZion/neon-wallet/issues/943"},"comments":{"href":"https://api.github.com/repos/CityOfZion/neon-wallet/issues/943/comments"},"review_comments":{"href":"https://api.github.com/repos/CityOfZion/neon-wallet/pulls/943/comments"},"review_comment":{"href":"https://api.github.com/repos/CityOfZion/neon-wallet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CityOfZion/neon-wallet/pulls/943/commits"},"statuses":{"href":"https://api.github.com/repos/CityOfZion/neon-wallet/statuses/ffa74df326dd2e6e47dc6e6f121204ed6698382c"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mhuggins"}}