{"action":"created","comment":{"url":"https://api.github.com/repos/treebohotels/leaf-ui/pulls/comments/184625649","pull_request_review_id":115860240,"id":184625649,"diff_hunk":"@@ -0,0 +1,93 @@\n+import React, { Component } from 'react';\n+import PropTypes from 'prop-types';\n+import styled from 'styled-components';\n+import Text from '../../Text/web';\n+\n+let index = 0;\n+const getUniqueId = () => {\n+  index += 1;\n+  return `__LEAF_UI__more-or-less-input-${index}`;\n+};\n+\n+const MoreOrLessContainer = styled(\n+  ({\n+    id,\n+    initialHeight,\n+    labelForMore,\n+    labelForLess,\n+    ...props\n+  }) => <div {...props} />,\n+)`\n+  > div {\n+    height: ${(props) => props.initialHeight};\n+    overflow: hidden;\n+  }\n+\n+  > label::before {\n+    content: '${(props) => props.labelForMore}';\n+  }\n+\n+  #${(props) => props.id} {\n+    display: none;\n+\n+    &:checked {\n+      + div {\n+        height: auto;\n+      }\n+\n+      ~ label::before {\n+        content: '${(props) => props.labelForLess}';\n+      }\n+    }\n+  }\n+`;\n+\n+class MoreOrLess extends Component {\n+  constructor(props) {\n+    super(props);\n+    this.id = getUniqueId();\n+  }\n+\n+  render() {\n+    const {\n+      initialHeight,\n+      labelForMore,\n+      labelForLess,\n+      children,\n+      ...props\n+    } = this.props;\n+\n+    return (\n+      <MoreOrLessContainer\n+        id={this.id}\n+        initialHeight={initialHeight}\n+        labelForMore={labelForMore}\n+        labelForLess={labelForLess}\n+        {...props}\n+      >\n+        <input type=\"checkbox\" id={this.id} />\n+        <div>{children}</div>\n+        <Text\n+          component=\"label\"\n+          htmlFor={this.id}\n+          color=\"blue\"\n+          size=\"s\"\n+        />\n+      </MoreOrLessContainer>\n+    );\n+  }\n+}\n+\n+MoreOrLess.propTypes = {\n+  initialHeight: PropTypes.string.isRequired,\n+  children: PropTypes.node.isRequired,","path":"src/MoreOrLess/web/MoreOrLess.js","position":83,"original_position":83,"commit_id":"8cf9942f342d8fcc5f01945bd1cb8e96ada6488a","original_commit_id":"8cf9942f342d8fcc5f01945bd1cb8e96ada6488a","user":{"login":"lakshyaranganath","id":7546892,"avatar_url":"https://avatars0.githubusercontent.com/u/7546892?v=4","gravatar_id":"","url":"https://api.github.com/users/lakshyaranganath","html_url":"https://github.com/lakshyaranganath","followers_url":"https://api.github.com/users/lakshyaranganath/followers","following_url":"https://api.github.com/users/lakshyaranganath/following{/other_user}","gists_url":"https://api.github.com/users/lakshyaranganath/gists{/gist_id}","starred_url":"https://api.github.com/users/lakshyaranganath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lakshyaranganath/subscriptions","organizations_url":"https://api.github.com/users/lakshyaranganath/orgs","repos_url":"https://api.github.com/users/lakshyaranganath/repos","events_url":"https://api.github.com/users/lakshyaranganath/events{/privacy}","received_events_url":"https://api.github.com/users/lakshyaranganath/received_events","type":"User","site_admin":false},"body":"children are always optional, incase of conditional rendering, children are undefined, so they can't be required.","created_at":"2018-04-27T08:39:29Z","updated_at":"2018-04-27T08:39:30Z","html_url":"https://github.com/treebohotels/leaf-ui/pull/49#discussion_r184625649","pull_request_url":"https://api.github.com/repos/treebohotels/leaf-ui/pulls/49","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/treebohotels/leaf-ui/pulls/comments/184625649"},"html":{"href":"https://github.com/treebohotels/leaf-ui/pull/49#discussion_r184625649"},"pull_request":{"href":"https://api.github.com/repos/treebohotels/leaf-ui/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/treebohotels/leaf-ui/pulls/49","id":184347622,"html_url":"https://github.com/treebohotels/leaf-ui/pull/49","diff_url":"https://github.com/treebohotels/leaf-ui/pull/49.diff","patch_url":"https://github.com/treebohotels/leaf-ui/pull/49.patch","issue_url":"https://api.github.com/repos/treebohotels/leaf-ui/issues/49","number":49,"state":"open","locked":false,"title":"feat(MoreOrLess): add more/less component","user":{"login":"kamleshchandnani","id":11384858,"avatar_url":"https://avatars3.githubusercontent.com/u/11384858?v=4","gravatar_id":"","url":"https://api.github.com/users/kamleshchandnani","html_url":"https://github.com/kamleshchandnani","followers_url":"https://api.github.com/users/kamleshchandnani/followers","following_url":"https://api.github.com/users/kamleshchandnani/following{/other_user}","gists_url":"https://api.github.com/users/kamleshchandnani/gists{/gist_id}","starred_url":"https://api.github.com/users/kamleshchandnani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kamleshchandnani/subscriptions","organizations_url":"https://api.github.com/users/kamleshchandnani/orgs","repos_url":"https://api.github.com/users/kamleshchandnani/repos","events_url":"https://api.github.com/users/kamleshchandnani/events{/privacy}","received_events_url":"https://api.github.com/users/kamleshchandnani/received_events","type":"User","site_admin":false},"body":"More/Less enables to hide lengthy content after a certain height and gives user the option to see\r\nthe entire content with a toggle","created_at":"2018-04-26T13:52:32Z","updated_at":"2018-04-27T08:39:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e4efe7c37d0c99c65e739e89463d522fbb240293","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/treebohotels/leaf-ui/pulls/49/commits","review_comments_url":"https://api.github.com/repos/treebohotels/leaf-ui/pulls/49/comments","review_comment_url":"https://api.github.com/repos/treebohotels/leaf-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/treebohotels/leaf-ui/issues/49/comments","statuses_url":"https://api.github.com/repos/treebohotels/leaf-ui/statuses/8cf9942f342d8fcc5f01945bd1cb8e96ada6488a","head":{"label":"treebohotels:feat/MoreOrLess/web","ref":"feat/MoreOrLess/web","sha":"8cf9942f342d8fcc5f01945bd1cb8e96ada6488a","user":{"login":"treebohotels","id":28801037,"avatar_url":"https://avatars2.githubusercontent.com/u/28801037?v=4","gravatar_id":"","url":"https://api.github.com/users/treebohotels","html_url":"https://github.com/treebohotels","followers_url":"https://api.github.com/users/treebohotels/followers","following_url":"https://api.github.com/users/treebohotels/following{/other_user}","gists_url":"https://api.github.com/users/treebohotels/gists{/gist_id}","starred_url":"https://api.github.com/users/treebohotels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/treebohotels/subscriptions","organizations_url":"https://api.github.com/users/treebohotels/orgs","repos_url":"https://api.github.com/users/treebohotels/repos","events_url":"https://api.github.com/users/treebohotels/events{/privacy}","received_events_url":"https://api.github.com/users/treebohotels/received_events","type":"Organization","site_admin":false},"repo":{"id":110652978,"name":"leaf-ui","full_name":"treebohotels/leaf-ui","owner":{"login":"treebohotels","id":28801037,"avatar_url":"https://avatars2.githubusercontent.com/u/28801037?v=4","gravatar_id":"","url":"https://api.github.com/users/treebohotels","html_url":"https://github.com/treebohotels","followers_url":"https://api.github.com/users/treebohotels/followers","following_url":"https://api.github.com/users/treebohotels/following{/other_user}","gists_url":"https://api.github.com/users/treebohotels/gists{/gist_id}","starred_url":"https://api.github.com/users/treebohotels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/treebohotels/subscriptions","organizations_url":"https://api.github.com/users/treebohotels/orgs","repos_url":"https://api.github.com/users/treebohotels/repos","events_url":"https://api.github.com/users/treebohotels/events{/privacy}","received_events_url":"https://api.github.com/users/treebohotels/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/treebohotels/leaf-ui","description":"🍃 Leaf-UI: A react component library built using styled-components","fork":false,"url":"https://api.github.com/repos/treebohotels/leaf-ui","forks_url":"https://api.github.com/repos/treebohotels/leaf-ui/forks","keys_url":"https://api.github.com/repos/treebohotels/leaf-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/treebohotels/leaf-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/treebohotels/leaf-ui/teams","hooks_url":"https://api.github.com/repos/treebohotels/leaf-ui/hooks","issue_events_url":"https://api.github.com/repos/treebohotels/leaf-ui/issues/events{/number}","events_url":"https://api.github.com/repos/treebohotels/leaf-ui/events","assignees_url":"https://api.github.com/repos/treebohotels/leaf-ui/assignees{/user}","branches_url":"https://api.github.com/repos/treebohotels/leaf-ui/branches{/branch}","tags_url":"https://api.github.com/repos/treebohotels/leaf-ui/tags","blobs_url":"https://api.github.com/repos/treebohotels/leaf-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/treebohotels/leaf-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/treebohotels/leaf-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/treebohotels/leaf-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/treebohotels/leaf-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/treebohotels/leaf-ui/languages","stargazers_url":"https://api.github.com/repos/treebohotels/leaf-ui/stargazers","contributors_url":"https://api.github.com/repos/treebohotels/leaf-ui/contributors","subscribers_url":"https://api.github.com/repos/treebohotels/leaf-ui/subscribers","subscription_url":"https://api.github.com/repos/treebohotels/leaf-ui/subscription","commits_url":"https://api.github.com/repos/treebohotels/leaf-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/treebohotels/leaf-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/treebohotels/leaf-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/treebohotels/leaf-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/treebohotels/leaf-ui/contents/{+path}","compare_url":"https://api.github.com/repos/treebohotels/leaf-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/treebohotels/leaf-ui/merges","archive_url":"https://api.github.com/repos/treebohotels/leaf-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/treebohotels/leaf-ui/downloads","issues_url":"https://api.github.com/repos/treebohotels/leaf-ui/issues{/number}","pulls_url":"https://api.github.com/repos/treebohotels/leaf-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/treebohotels/leaf-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/treebohotels/leaf-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/treebohotels/leaf-ui/labels{/name}","releases_url":"https://api.github.com/repos/treebohotels/leaf-ui/releases{/id}","deployments_url":"https://api.github.com/repos/treebohotels/leaf-ui/deployments","created_at":"2017-11-14T07:00:05Z","updated_at":"2018-04-27T06:58:56Z","pushed_at":"2018-04-27T06:41:32Z","git_url":"git://github.com/treebohotels/leaf-ui.git","ssh_url":"git@github.com:treebohotels/leaf-ui.git","clone_url":"https://github.com/treebohotels/leaf-ui.git","svn_url":"https://github.com/treebohotels/leaf-ui","homepage":"https://leaf-ui.treebo.com/","size":3487,"stargazers_count":16,"watchers_count":16,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":2,"open_issues":6,"watchers":16,"default_branch":"master"}},"base":{"label":"treebohotels:master","ref":"master","sha":"21c281d1822deba83c13bacb268c58dd0683d2b3","user":{"login":"treebohotels","id":28801037,"avatar_url":"https://avatars2.githubusercontent.com/u/28801037?v=4","gravatar_id":"","url":"https://api.github.com/users/treebohotels","html_url":"https://github.com/treebohotels","followers_url":"https://api.github.com/users/treebohotels/followers","following_url":"https://api.github.com/users/treebohotels/following{/other_user}","gists_url":"https://api.github.com/users/treebohotels/gists{/gist_id}","starred_url":"https://api.github.com/users/treebohotels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/treebohotels/subscriptions","organizations_url":"https://api.github.com/users/treebohotels/orgs","repos_url":"https://api.github.com/users/treebohotels/repos","events_url":"https://api.github.com/users/treebohotels/events{/privacy}","received_events_url":"https://api.github.com/users/treebohotels/received_events","type":"Organization","site_admin":false},"repo":{"id":110652978,"name":"leaf-ui","full_name":"treebohotels/leaf-ui","owner":{"login":"treebohotels","id":28801037,"avatar_url":"https://avatars2.githubusercontent.com/u/28801037?v=4","gravatar_id":"","url":"https://api.github.com/users/treebohotels","html_url":"https://github.com/treebohotels","followers_url":"https://api.github.com/users/treebohotels/followers","following_url":"https://api.github.com/users/treebohotels/following{/other_user}","gists_url":"https://api.github.com/users/treebohotels/gists{/gist_id}","starred_url":"https://api.github.com/users/treebohotels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/treebohotels/subscriptions","organizations_url":"https://api.github.com/users/treebohotels/orgs","repos_url":"https://api.github.com/users/treebohotels/repos","events_url":"https://api.github.com/users/treebohotels/events{/privacy}","received_events_url":"https://api.github.com/users/treebohotels/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/treebohotels/leaf-ui","description":"🍃 Leaf-UI: A react component library built using styled-components","fork":false,"url":"https://api.github.com/repos/treebohotels/leaf-ui","forks_url":"https://api.github.com/repos/treebohotels/leaf-ui/forks","keys_url":"https://api.github.com/repos/treebohotels/leaf-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/treebohotels/leaf-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/treebohotels/leaf-ui/teams","hooks_url":"https://api.github.com/repos/treebohotels/leaf-ui/hooks","issue_events_url":"https://api.github.com/repos/treebohotels/leaf-ui/issues/events{/number}","events_url":"https://api.github.com/repos/treebohotels/leaf-ui/events","assignees_url":"https://api.github.com/repos/treebohotels/leaf-ui/assignees{/user}","branches_url":"https://api.github.com/repos/treebohotels/leaf-ui/branches{/branch}","tags_url":"https://api.github.com/repos/treebohotels/leaf-ui/tags","blobs_url":"https://api.github.com/repos/treebohotels/leaf-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/treebohotels/leaf-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/treebohotels/leaf-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/treebohotels/leaf-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/treebohotels/leaf-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/treebohotels/leaf-ui/languages","stargazers_url":"https://api.github.com/repos/treebohotels/leaf-ui/stargazers","contributors_url":"https://api.github.com/repos/treebohotels/leaf-ui/contributors","subscribers_url":"https://api.github.com/repos/treebohotels/leaf-ui/subscribers","subscription_url":"https://api.github.com/repos/treebohotels/leaf-ui/subscription","commits_url":"https://api.github.com/repos/treebohotels/leaf-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/treebohotels/leaf-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/treebohotels/leaf-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/treebohotels/leaf-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/treebohotels/leaf-ui/contents/{+path}","compare_url":"https://api.github.com/repos/treebohotels/leaf-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/treebohotels/leaf-ui/merges","archive_url":"https://api.github.com/repos/treebohotels/leaf-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/treebohotels/leaf-ui/downloads","issues_url":"https://api.github.com/repos/treebohotels/leaf-ui/issues{/number}","pulls_url":"https://api.github.com/repos/treebohotels/leaf-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/treebohotels/leaf-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/treebohotels/leaf-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/treebohotels/leaf-ui/labels{/name}","releases_url":"https://api.github.com/repos/treebohotels/leaf-ui/releases{/id}","deployments_url":"https://api.github.com/repos/treebohotels/leaf-ui/deployments","created_at":"2017-11-14T07:00:05Z","updated_at":"2018-04-27T06:58:56Z","pushed_at":"2018-04-27T06:41:32Z","git_url":"git://github.com/treebohotels/leaf-ui.git","ssh_url":"git@github.com:treebohotels/leaf-ui.git","clone_url":"https://github.com/treebohotels/leaf-ui.git","svn_url":"https://github.com/treebohotels/leaf-ui","homepage":"https://leaf-ui.treebo.com/","size":3487,"stargazers_count":16,"watchers_count":16,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":2,"open_issues":6,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/treebohotels/leaf-ui/pulls/49"},"html":{"href":"https://github.com/treebohotels/leaf-ui/pull/49"},"issue":{"href":"https://api.github.com/repos/treebohotels/leaf-ui/issues/49"},"comments":{"href":"https://api.github.com/repos/treebohotels/leaf-ui/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/treebohotels/leaf-ui/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/treebohotels/leaf-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/treebohotels/leaf-ui/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/treebohotels/leaf-ui/statuses/8cf9942f342d8fcc5f01945bd1cb8e96ada6488a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lakshyaranganath"}}