{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/comments/123755194","pull_request_review_id":45992027,"id":123755194,"diff_hunk":"@@ -0,0 +1,101 @@\n+import classNames from 'classnames';\n+import PropTypes from 'prop-types';\n+import React from 'react';\n+import { compose } from 'redux';\n+\n+import fallbackIcon from 'amo/img/icons/default-64.png';\n+import Link from 'amo/components/Link';\n+import translate from 'core/i18n/translate';\n+import { ADDON_TYPE_THEME } from 'core/constants';\n+import { isAllowedOrigin, sanitizeHTML } from 'core/utils';\n+import Icon from 'ui/components/Icon';\n+import Rating from 'ui/components/Rating';\n+\n+import './styles.scss';\n+\n+\n+export class SearchResultBase extends React.Component {\n+  static propTypes = {\n+    addon: PropTypes.object.isRequired,\n+    i18n: PropTypes.object.isRequired,\n+  }\n+\n+  render() {\n+    const { addon, i18n } = this.props;\n+    const averageDailyUsers = addon.average_daily_users;\n+    const isTheme = addon.type === ADDON_TYPE_THEME;\n+    const resultClassnames = classNames('SearchResult', {\n+      'SearchResult--theme': isTheme,\n+    });\n+\n+    // Fall-back to default icon if invalid icon url.\n+    const iconURL = isAllowedOrigin(addon.icon_url) ? addon.icon_url : fallbackIcon;\n+    const themeURL = (addon.theme_data && isAllowedOrigin(addon.theme_data.previewURL)) ?\n+      addon.theme_data.previewURL : null;\n+    const imageURL = isTheme ? themeURL : iconURL;\n+\n+    // Sets classes to handle fallback if theme preview is not available.\n+    const iconWrapperClassnames = classNames('SearchResult-icon-wrapper', {\n+      'SearchResult-icon-wrapper--no-theme-image': (\n+        isTheme && imageURL === null\n+      ),\n+    });\n+\n+    // eslint-disable react-no-danger\n+    return (\n+      <li className={resultClassnames}>\n+        <Link to={`/addon/${addon.slug}/`}\n+              className=\"SearchResult-link\"\n+              ref={(el) => { this.name = el; }}>\n+          <div className={iconWrapperClassnames}>\n+            {imageURL ? (\n+              <img className=\"SearchResult-icon\" src={imageURL} alt=\"\" />\n+            ) : (\n+              <p className=\"SearchResult-notheme\">\n+                {i18n.gettext('No theme preview available')}\n+              </p>\n+            )}\n+          </div>\n+\n+          <div className=\"SearchResult-contents\">\n+            <h2 className=\"SearchResult-name\">{addon.name}</h2>\n+            <p\n+              className=\"SearchResult-summary\"\n+              dangerouslySetInnerHTML={sanitizeHTML(addon.summary)}","path":"src/amo/components/SearchResult/index.js","position":64,"original_position":64,"commit_id":"0f41a6eeeab1d00ae527d73d992fc299b103bc2a","original_commit_id":"4a65e24a01975dc596665c834db79f7a9c031473","user":{"login":"tofumatt","id":90871,"avatar_url":"https://avatars1.githubusercontent.com/u/90871?v=3","gravatar_id":"","url":"https://api.github.com/users/tofumatt","html_url":"https://github.com/tofumatt","followers_url":"https://api.github.com/users/tofumatt/followers","following_url":"https://api.github.com/users/tofumatt/following{/other_user}","gists_url":"https://api.github.com/users/tofumatt/gists{/gist_id}","starred_url":"https://api.github.com/users/tofumatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tofumatt/subscriptions","organizations_url":"https://api.github.com/users/tofumatt/orgs","repos_url":"https://api.github.com/users/tofumatt/repos","events_url":"https://api.github.com/users/tofumatt/events{/privacy}","received_events_url":"https://api.github.com/users/tofumatt/received_events","type":"User","site_admin":false},"body":"Though I opted not to use description here because it has the potential to be very long and I don't want all that text on the search results page. We will deal with it better in #2626 where if we find a description but no summary we can make a shortened summary from description I think. But for now they are fine blank.","created_at":"2017-06-23T14:03:39Z","updated_at":"2017-06-23T14:03:39Z","html_url":"https://github.com/mozilla/addons-frontend/pull/2618#discussion_r123755194","pull_request_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/2618","_links":{"self":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/comments/123755194"},"html":{"href":"https://github.com/mozilla/addons-frontend/pull/2618#discussion_r123755194"},"pull_request":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/2618"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/2618","id":126753084,"html_url":"https://github.com/mozilla/addons-frontend/pull/2618","diff_url":"https://github.com/mozilla/addons-frontend/pull/2618.diff","patch_url":"https://github.com/mozilla/addons-frontend/pull/2618.patch","issue_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/2618","number":2618,"state":"open","locked":false,"title":"Create a desktop search page","user":{"login":"tofumatt","id":90871,"avatar_url":"https://avatars1.githubusercontent.com/u/90871?v=3","gravatar_id":"","url":"https://api.github.com/users/tofumatt","html_url":"https://github.com/tofumatt","followers_url":"https://api.github.com/users/tofumatt/followers","following_url":"https://api.github.com/users/tofumatt/following{/other_user}","gists_url":"https://api.github.com/users/tofumatt/gists{/gist_id}","starred_url":"https://api.github.com/users/tofumatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tofumatt/subscriptions","organizations_url":"https://api.github.com/users/tofumatt/orgs","repos_url":"https://api.github.com/users/tofumatt/repos","events_url":"https://api.github.com/users/tofumatt/events{/privacy}","received_events_url":"https://api.github.com/users/tofumatt/received_events","type":"User","site_admin":false},"body":"Fixes #2560.\r\n\r\nThis one was a bit intense! I cleaned up the folder structure and ended up refactoring/cleaning up the `SearchResult` CSS. Pretty much everything here is a style change except the new `SearchContextCard` at the top of the page which shows result counts, etc.\r\n\r\nWe had, in my opinion, more than enough space for add-on descriptions in the medium/\"tablet\" view so I added them. It felt okay on a tablet, cue \"developers hate whitespace\" jokes.\r\n\r\nHere is a bunch of screenshots:\r\n\r\n### Small\r\n![screen shot 2017-06-21 at 13 34 14](https://user-images.githubusercontent.com/90871/27384461-e00546d6-5686-11e7-899a-a020cbaeee97.png)\r\n![screen shot 2017-06-21 at 13 34 12](https://user-images.githubusercontent.com/90871/27384462-e00f2138-5686-11e7-9c5f-99b940899ea9.png)\r\n\r\n### Medium\r\n![screen shot 2017-06-21 at 13 34 30](https://user-images.githubusercontent.com/90871/27384473-e8f907be-5686-11e7-892c-9cbe76a7554e.png)\r\n![screen shot 2017-06-21 at 13 34 27](https://user-images.githubusercontent.com/90871/27384472-e8ef2e6a-5686-11e7-9e7c-a85a2f056501.png)\r\n\r\n### Large/Desktop\r\n<img width=\"1109\" alt=\"screenshot 2017-06-21 13 34 03\" src=\"https://user-images.githubusercontent.com/90871/27384523-11226a28-5687-11e7-9af3-d92a0ada7516.png\">\r\n<img width=\"1109\" alt=\"screenshot 2017-06-21 13 34 00\" src=\"https://user-images.githubusercontent.com/90871/27384524-11247cbe-5687-11e7-94bc-407a87da00b4.png\">\r\n","created_at":"2017-06-21T12:39:40Z","updated_at":"2017-06-23T14:03:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d8b290c45ca9594a8aa996ab7bea808b99d6943","assignee":null,"assignees":[],"requested_reviewers":[{"login":"kumar303","id":55398,"avatar_url":"https://avatars2.githubusercontent.com/u/55398?v=3","gravatar_id":"","url":"https://api.github.com/users/kumar303","html_url":"https://github.com/kumar303","followers_url":"https://api.github.com/users/kumar303/followers","following_url":"https://api.github.com/users/kumar303/following{/other_user}","gists_url":"https://api.github.com/users/kumar303/gists{/gist_id}","starred_url":"https://api.github.com/users/kumar303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kumar303/subscriptions","organizations_url":"https://api.github.com/users/kumar303/orgs","repos_url":"https://api.github.com/users/kumar303/repos","events_url":"https://api.github.com/users/kumar303/events{/privacy}","received_events_url":"https://api.github.com/users/kumar303/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/2618/commits","review_comments_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/2618/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/2618/comments","statuses_url":"https://api.github.com/repos/mozilla/addons-frontend/statuses/0f41a6eeeab1d00ae527d73d992fc299b103bc2a","head":{"label":"mozilla:search-desktop-2560","ref":"search-desktop-2560","sha":"0f41a6eeeab1d00ae527d73d992fc299b103bc2a","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars1.githubusercontent.com/u/131524?v=3","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,"name":"addons-frontend","full_name":"mozilla/addons-frontend","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars1.githubusercontent.com/u/131524?v=3","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":"2017-06-15T15:08:48Z","pushed_at":"2017-06-23T14:02:17Z","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":258773,"stargazers_count":35,"watchers_count":35,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":267,"forks":37,"open_issues":267,"watchers":35,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"0820874e13c87d629d57a58ed8a7cae4af1b1db3","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars1.githubusercontent.com/u/131524?v=3","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,"name":"addons-frontend","full_name":"mozilla/addons-frontend","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars1.githubusercontent.com/u/131524?v=3","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":"2017-06-15T15:08:48Z","pushed_at":"2017-06-23T14:02:17Z","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":258773,"stargazers_count":35,"watchers_count":35,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":267,"forks":37,"open_issues":267,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/2618"},"html":{"href":"https://github.com/mozilla/addons-frontend/pull/2618"},"issue":{"href":"https://api.github.com/repos/mozilla/addons-frontend/issues/2618"},"comments":{"href":"https://api.github.com/repos/mozilla/addons-frontend/issues/2618/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/2618/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/2618/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/addons-frontend/statuses/0f41a6eeeab1d00ae527d73d992fc299b103bc2a"}}}}
{"actor":{"display_login":"tofumatt"}}