{"action":"created","comment":{"url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/pulls/comments/43869172","id":43869172,"diff_hunk":"@@ -0,0 +1,174 @@\n+import React from 'react';\n+\n+export default class WinTeaser extends React.Component {\n+  static get propTypes() {\n+    return {\n+      teaserId: React.PropTypes.string.isRequired,\n+      image: React.PropTypes.object,\n+      section: React.PropTypes.string,\n+      flyTitle: React.PropTypes.string,\n+      title: React.PropTypes.string.isRequired,\n+      type: React.PropTypes.string,\n+      dateTime: React.PropTypes.instanceOf(Date),\n+      dateFormat: React.PropTypes.instanceOf(Function),\n+      text: React.PropTypes.string,\n+      link: React.PropTypes.object,\n+      itemType: React.PropTypes.string,\n+      itemProp: React.PropTypes.string,\n+    };\n+  }\n+  static get defaultProps() {\n+    return {\n+      itemType: 'http://schema.org/Article',\n+      itemProp: 'article',\n+      dateFormat: (date) => {\n+        // Sep 19th 2015, 9:49\n+        function addPostFix(day) {\n+          const daystr = day.toString();\n+          const lastChar = daystr.charAt(daystr.length - 1);\n+          let postFix = '';\n+          switch (lastChar) {\n+            case '1':\n+              postFix = 'st';\n+              break;\n+            case '2':\n+              postFix = 'nd';\n+              break;\n+            case '3':\n+              postFix = 'rd';\n+              break;\n+            default:\n+              postFix = 'th';\n+              break;\n+          }\n+          return `${day}${postFix}`;\n+        }\n+        const shortMonthList = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n+        'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ];\n+        let minutes = date.getMinutes() < 10 ? '0' : '';\n+        minutes += date.getMinutes();\n+        return `${shortMonthList[date.getMonth()]}\n+                ${addPostFix(date.getDay())}\n+                ${date.getFullYear()},\n+                ${date.getHours()}:${minutes}`;\n+      },\n+    };\n+  }\n+  render() {\n+    const teaserContent = [];\n+    const groups = [];\n+    const imageContent = [];\n+    if (this.props.type === 'hero') {\n+      imageContent.push((\n+        <div className=\"teaser__group-image\">\n+          <img {...this.props.image}\n+            itemProp=\"image\"\n+            className=\"teaser__img\"\n+            key={`teaser__img_${this.props.teaserId}`}\n+          />\n+          <div className=\"teaser__image-text-container\">\n+          <h1\n+            className=\"teaser__title\"\n+            itemProp=\"headline\"\n+            key={`teaser__title_${this.props.teaserId}`}\n+          >{this.props.title}\n+          </h1>\n+          <div\n+            className=\"teaser__text\"\n+            itemProp=\"description\"\n+            key={`teaser__text_${this.props.teaserId}`}\n+            /* eslint-disable react/no-danger */\n+            dangerouslySetInnerHTML={{\n+              '__html': this.props.text,\n+            }}\n+          />\n+          </div>\n+        </div>\n+      ));\n+      if (this.props.dateTime) {\n+        teaserContent.push((\n+          <time\n+            className=\"teaser__datetime\"\n+            itemProp=\"dateCreated\"\n+            dateTime={this.props.dateTime}\n+            key={`teaser__datetime_${this.props.teaserId}`}\n+          >{this.props.dateFormat(this.props.dateTime)}</time>\n+        ));\n+      }\n+      if (this.props.section) {\n+        teaserContent.push((\n+          <h3\n+            className=\"teaser__section\"\n+            itemProp=\"section\"\n+            key={`teaser__section_${this.props.teaserId}`}\n+          >{this.props.section}</h3>\n+        ));\n+      }\n+    } else if (this.props.type === 'default') {\n+      imageContent.push((\n+        <div className=\"teaser__group-image\">\n+          <img {...this.props.image}\n+            itemProp=\"image\"\n+            className=\"teaser__img\"\n+            key={`teaser__img_${this.props.teaserId}`}\n+          />\n+          <div className=\"teaser__image-text-container\">\n+          <h1\n+            className=\"teaser__title\"\n+            itemProp=\"headline\"\n+            key={`teaser__title_${this.props.teaserId}`}\n+          >{this.props.title}\n+          </h1>\n+          </div>\n+        </div>\n+      ));\n+      if (this.props.text) {\n+        teaserContent.push((\n+          <div\n+            className=\"teaser__text\"\n+            itemProp=\"description\"\n+            key={`teaser__text_${this.props.teaserId}`}\n+            /* eslint-disable react/no-danger */\n+            dangerouslySetInnerHTML={{\n+              '__html': this.props.text,\n+            }}\n+          />\n+        ));\n+      }\n+      if (this.props.dateTime) {\n+        teaserContent.push((\n+          <time\n+            className=\"teaser__datetime\"\n+            itemProp=\"dateCreated\"\n+            dateTime={this.props.dateTime}\n+            key={`teaser__datetime_${this.props.teaserId}`}\n+          >{this.props.dateFormat(this.props.dateTime)}</time>\n+        ));\n+      }\n+      if (this.props.section) {\n+        teaserContent.push((\n+          <h3\n+            className=\"teaser__section\"\n+            itemProp=\"section\"\n+            key={`teaser__section_${this.props.teaserId}`}\n+          >{this.props.section}</h3>\n+        ));\n+      }\n+    }\n+    groups.push(<div className=\"teaser__group-text\">{teaserContent}</div>);\n+    let content = {};\n+    content = (\n+      <a {...this.props.link}\n+        className=\"teaser__link\"\n+        itemProp=\"url\"\n+      >{imageContent}\n+      {groups}</a>);\n+    return (\n+      <article\n+        className={this.props.type + '__teaser'}","path":"index.es6","position":168,"original_position":168,"commit_id":"04bfe20c4ca97b20be76df64107663fc1e1abdd3","original_commit_id":"04bfe20c4ca97b20be76df64107663fc1e1abdd3","user":{"login":"sebinsua","id":152098,"avatar_url":"https://avatars.githubusercontent.com/u/152098?v=3","gravatar_id":"","url":"https://api.github.com/users/sebinsua","html_url":"https://github.com/sebinsua","followers_url":"https://api.github.com/users/sebinsua/followers","following_url":"https://api.github.com/users/sebinsua/following{/other_user}","gists_url":"https://api.github.com/users/sebinsua/gists{/gist_id}","starred_url":"https://api.github.com/users/sebinsua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebinsua/subscriptions","organizations_url":"https://api.github.com/users/sebinsua/orgs","repos_url":"https://api.github.com/users/sebinsua/repos","events_url":"https://api.github.com/users/sebinsua/events{/privacy}","received_events_url":"https://api.github.com/users/sebinsua/received_events","type":"User","site_admin":false},"body":"Ah, nice. I gave up before googling.","created_at":"2015-11-04T11:26:03Z","updated_at":"2015-11-04T11:26:03Z","html_url":"https://github.com/the-economist-editorial/component-win-teaser/pull/1#discussion_r43869172","pull_request_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/pulls/comments/43869172"},"html":{"href":"https://github.com/the-economist-editorial/component-win-teaser/pull/1#discussion_r43869172"},"pull_request":{"href":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/pulls/1","id":49671111,"html_url":"https://github.com/the-economist-editorial/component-win-teaser/pull/1","diff_url":"https://github.com/the-economist-editorial/component-win-teaser/pull/1.diff","patch_url":"https://github.com/the-economist-editorial/component-win-teaser/pull/1.patch","issue_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/issues/1","number":1,"state":"open","locked":false,"title":"World In teaser component","user":{"login":"russEco","id":4679852,"avatar_url":"https://avatars.githubusercontent.com/u/4679852?v=3","gravatar_id":"","url":"https://api.github.com/users/russEco","html_url":"https://github.com/russEco","followers_url":"https://api.github.com/users/russEco/followers","following_url":"https://api.github.com/users/russEco/following{/other_user}","gists_url":"https://api.github.com/users/russEco/gists{/gist_id}","starred_url":"https://api.github.com/users/russEco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russEco/subscriptions","organizations_url":"https://api.github.com/users/russEco/orgs","repos_url":"https://api.github.com/users/russEco/repos","events_url":"https://api.github.com/users/russEco/events{/privacy}","received_events_url":"https://api.github.com/users/russEco/received_events","type":"User","site_admin":false},"body":"This is basically an edited version of the revamps teams component-teaser\r\n\r\nEdit of the render method was needed to change the structure of the html to suit the designs for the World in 2016.\r\n\r\nRequires https://github.com/the-economist-editorial/component-font-officina as a dependancy  ","created_at":"2015-11-04T10:28:23Z","updated_at":"2015-11-04T11:26:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9947aee9f8300751211f240f57ce04ddd8dd9c80","assignee":{"login":"sebinsua","id":152098,"avatar_url":"https://avatars.githubusercontent.com/u/152098?v=3","gravatar_id":"","url":"https://api.github.com/users/sebinsua","html_url":"https://github.com/sebinsua","followers_url":"https://api.github.com/users/sebinsua/followers","following_url":"https://api.github.com/users/sebinsua/following{/other_user}","gists_url":"https://api.github.com/users/sebinsua/gists{/gist_id}","starred_url":"https://api.github.com/users/sebinsua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebinsua/subscriptions","organizations_url":"https://api.github.com/users/sebinsua/orgs","repos_url":"https://api.github.com/users/sebinsua/repos","events_url":"https://api.github.com/users/sebinsua/events{/privacy}","received_events_url":"https://api.github.com/users/sebinsua/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/pulls/1/commits","review_comments_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/pulls/1/comments","review_comment_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/issues/1/comments","statuses_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/statuses/04bfe20c4ca97b20be76df64107663fc1e1abdd3","head":{"label":"russEco:master","ref":"master","sha":"04bfe20c4ca97b20be76df64107663fc1e1abdd3","user":{"login":"russEco","id":4679852,"avatar_url":"https://avatars.githubusercontent.com/u/4679852?v=3","gravatar_id":"","url":"https://api.github.com/users/russEco","html_url":"https://github.com/russEco","followers_url":"https://api.github.com/users/russEco/followers","following_url":"https://api.github.com/users/russEco/following{/other_user}","gists_url":"https://api.github.com/users/russEco/gists{/gist_id}","starred_url":"https://api.github.com/users/russEco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russEco/subscriptions","organizations_url":"https://api.github.com/users/russEco/orgs","repos_url":"https://api.github.com/users/russEco/repos","events_url":"https://api.github.com/users/russEco/events{/privacy}","received_events_url":"https://api.github.com/users/russEco/received_events","type":"User","site_admin":false},"repo":{"id":45481875,"name":"component-win-teaser","full_name":"russEco/component-win-teaser","owner":{"login":"russEco","id":4679852,"avatar_url":"https://avatars.githubusercontent.com/u/4679852?v=3","gravatar_id":"","url":"https://api.github.com/users/russEco","html_url":"https://github.com/russEco","followers_url":"https://api.github.com/users/russEco/followers","following_url":"https://api.github.com/users/russEco/following{/other_user}","gists_url":"https://api.github.com/users/russEco/gists{/gist_id}","starred_url":"https://api.github.com/users/russEco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russEco/subscriptions","organizations_url":"https://api.github.com/users/russEco/orgs","repos_url":"https://api.github.com/users/russEco/repos","events_url":"https://api.github.com/users/russEco/events{/privacy}","received_events_url":"https://api.github.com/users/russEco/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/russEco/component-win-teaser","description":"teaser component for World In 2016","fork":true,"url":"https://api.github.com/repos/russEco/component-win-teaser","forks_url":"https://api.github.com/repos/russEco/component-win-teaser/forks","keys_url":"https://api.github.com/repos/russEco/component-win-teaser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/russEco/component-win-teaser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/russEco/component-win-teaser/teams","hooks_url":"https://api.github.com/repos/russEco/component-win-teaser/hooks","issue_events_url":"https://api.github.com/repos/russEco/component-win-teaser/issues/events{/number}","events_url":"https://api.github.com/repos/russEco/component-win-teaser/events","assignees_url":"https://api.github.com/repos/russEco/component-win-teaser/assignees{/user}","branches_url":"https://api.github.com/repos/russEco/component-win-teaser/branches{/branch}","tags_url":"https://api.github.com/repos/russEco/component-win-teaser/tags","blobs_url":"https://api.github.com/repos/russEco/component-win-teaser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/russEco/component-win-teaser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/russEco/component-win-teaser/git/refs{/sha}","trees_url":"https://api.github.com/repos/russEco/component-win-teaser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/russEco/component-win-teaser/statuses/{sha}","languages_url":"https://api.github.com/repos/russEco/component-win-teaser/languages","stargazers_url":"https://api.github.com/repos/russEco/component-win-teaser/stargazers","contributors_url":"https://api.github.com/repos/russEco/component-win-teaser/contributors","subscribers_url":"https://api.github.com/repos/russEco/component-win-teaser/subscribers","subscription_url":"https://api.github.com/repos/russEco/component-win-teaser/subscription","commits_url":"https://api.github.com/repos/russEco/component-win-teaser/commits{/sha}","git_commits_url":"https://api.github.com/repos/russEco/component-win-teaser/git/commits{/sha}","comments_url":"https://api.github.com/repos/russEco/component-win-teaser/comments{/number}","issue_comment_url":"https://api.github.com/repos/russEco/component-win-teaser/issues/comments{/number}","contents_url":"https://api.github.com/repos/russEco/component-win-teaser/contents/{+path}","compare_url":"https://api.github.com/repos/russEco/component-win-teaser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/russEco/component-win-teaser/merges","archive_url":"https://api.github.com/repos/russEco/component-win-teaser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/russEco/component-win-teaser/downloads","issues_url":"https://api.github.com/repos/russEco/component-win-teaser/issues{/number}","pulls_url":"https://api.github.com/repos/russEco/component-win-teaser/pulls{/number}","milestones_url":"https://api.github.com/repos/russEco/component-win-teaser/milestones{/number}","notifications_url":"https://api.github.com/repos/russEco/component-win-teaser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/russEco/component-win-teaser/labels{/name}","releases_url":"https://api.github.com/repos/russEco/component-win-teaser/releases{/id}","created_at":"2015-11-03T17:04:14Z","updated_at":"2015-11-03T17:38:12Z","pushed_at":"2015-11-03T17:39:32Z","git_url":"git://github.com/russEco/component-win-teaser.git","ssh_url":"git@github.com:russEco/component-win-teaser.git","clone_url":"https://github.com/russEco/component-win-teaser.git","svn_url":"https://github.com/russEco/component-win-teaser","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"the-economist-editorial:master","ref":"master","sha":"507b56583ab2495aaef9fa6c5a16ed9aa6651626","user":{"login":"the-economist-editorial","id":5329285,"avatar_url":"https://avatars.githubusercontent.com/u/5329285?v=3","gravatar_id":"","url":"https://api.github.com/users/the-economist-editorial","html_url":"https://github.com/the-economist-editorial","followers_url":"https://api.github.com/users/the-economist-editorial/followers","following_url":"https://api.github.com/users/the-economist-editorial/following{/other_user}","gists_url":"https://api.github.com/users/the-economist-editorial/gists{/gist_id}","starred_url":"https://api.github.com/users/the-economist-editorial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/the-economist-editorial/subscriptions","organizations_url":"https://api.github.com/users/the-economist-editorial/orgs","repos_url":"https://api.github.com/users/the-economist-editorial/repos","events_url":"https://api.github.com/users/the-economist-editorial/events{/privacy}","received_events_url":"https://api.github.com/users/the-economist-editorial/received_events","type":"Organization","site_admin":false},"repo":{"id":45481737,"name":"component-win-teaser","full_name":"the-economist-editorial/component-win-teaser","owner":{"login":"the-economist-editorial","id":5329285,"avatar_url":"https://avatars.githubusercontent.com/u/5329285?v=3","gravatar_id":"","url":"https://api.github.com/users/the-economist-editorial","html_url":"https://github.com/the-economist-editorial","followers_url":"https://api.github.com/users/the-economist-editorial/followers","following_url":"https://api.github.com/users/the-economist-editorial/following{/other_user}","gists_url":"https://api.github.com/users/the-economist-editorial/gists{/gist_id}","starred_url":"https://api.github.com/users/the-economist-editorial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/the-economist-editorial/subscriptions","organizations_url":"https://api.github.com/users/the-economist-editorial/orgs","repos_url":"https://api.github.com/users/the-economist-editorial/repos","events_url":"https://api.github.com/users/the-economist-editorial/events{/privacy}","received_events_url":"https://api.github.com/users/the-economist-editorial/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/the-economist-editorial/component-win-teaser","description":"teaser component for World In 2016","fork":false,"url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser","forks_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/forks","keys_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/teams","hooks_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/hooks","issue_events_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/issues/events{/number}","events_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/events","assignees_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/assignees{/user}","branches_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/branches{/branch}","tags_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/tags","blobs_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/git/refs{/sha}","trees_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/statuses/{sha}","languages_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/languages","stargazers_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/stargazers","contributors_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/contributors","subscribers_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/subscribers","subscription_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/subscription","commits_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/commits{/sha}","git_commits_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/git/commits{/sha}","comments_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/comments{/number}","issue_comment_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/issues/comments{/number}","contents_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/contents/{+path}","compare_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/merges","archive_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/downloads","issues_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/issues{/number}","pulls_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/pulls{/number}","milestones_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/milestones{/number}","notifications_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/labels{/name}","releases_url":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/releases{/id}","created_at":"2015-11-03T17:02:07Z","updated_at":"2015-11-03T17:02:07Z","pushed_at":"2015-11-04T10:28:23Z","git_url":"git://github.com/the-economist-editorial/component-win-teaser.git","ssh_url":"git@github.com:the-economist-editorial/component-win-teaser.git","clone_url":"https://github.com/the-economist-editorial/component-win-teaser.git","svn_url":"https://github.com/the-economist-editorial/component-win-teaser","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/pulls/1"},"html":{"href":"https://github.com/the-economist-editorial/component-win-teaser/pull/1"},"issue":{"href":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/issues/1"},"comments":{"href":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/the-economist-editorial/component-win-teaser/statuses/04bfe20c4ca97b20be76df64107663fc1e1abdd3"}}}}