{"action":"created","comment":{"url":"https://api.github.com/repos/andela/learning-map-front/pulls/comments/137078800","pull_request_review_id":60700129,"id":137078800,"diff_hunk":"@@ -11,9 +13,29 @@ const loadContributionsSuccess = (contributions): interfaces.IContributionsActio\n   return { type: types.LOAD_CONTRIBUTIONS_SUCCESS, contributions };\n };\n \n+export const toggleBookmark = (userId, contribution, isBookmarked) => {\n+  return ((dispatch, getState) => {\n+    const state = getState();\n+    const id = contribution.id;\n+    if (isBookmarked) {\n+      return http.delete(`${config.API_BASE_URL}/contributions/bookmarks/${id}`)\n+        .then((contributions) => {\n+          dispatch(loadContributions());\n+          dispatch(loadBookmarks());\n+        });\n+    } else {\n+      return http.post(`${config.API_BASE_URL}/contributions/${id}/bookmarks`, {resourceType: 'contribution'})","path":"src/actions/ContributionsAction.ts","position":24,"original_position":24,"commit_id":"4a15d1ccf827025a33eb89160c2ecbfe8fa83eec","original_commit_id":"4a15d1ccf827025a33eb89160c2ecbfe8fa83eec","user":{"login":"andela-uofoegbu","id":24937777,"avatar_url":"https://avatars1.githubusercontent.com/u/24937777?v=4","gravatar_id":"","url":"https://api.github.com/users/andela-uofoegbu","html_url":"https://github.com/andela-uofoegbu","followers_url":"https://api.github.com/users/andela-uofoegbu/followers","following_url":"https://api.github.com/users/andela-uofoegbu/following{/other_user}","gists_url":"https://api.github.com/users/andela-uofoegbu/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-uofoegbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-uofoegbu/subscriptions","organizations_url":"https://api.github.com/users/andela-uofoegbu/orgs","repos_url":"https://api.github.com/users/andela-uofoegbu/repos","events_url":"https://api.github.com/users/andela-uofoegbu/events{/privacy}","received_events_url":"https://api.github.com/users/andela-uofoegbu/received_events","type":"User","site_admin":false},"body":"I noticed the endpoint for `post` is different from the `delete` endpoint\r\nI thought the whole point of a toggle is to hit the same endpoint using a `PATCH` request or something similar.\r\n I think the logic here to check if it's been bookmarked before should be backend implementation.","created_at":"2017-09-05T18:36:30Z","updated_at":"2017-09-05T18:36:30Z","html_url":"https://github.com/andela/learning-map-front/pull/51#discussion_r137078800","pull_request_url":"https://api.github.com/repos/andela/learning-map-front/pulls/51","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/andela/learning-map-front/pulls/comments/137078800"},"html":{"href":"https://github.com/andela/learning-map-front/pull/51#discussion_r137078800"},"pull_request":{"href":"https://api.github.com/repos/andela/learning-map-front/pulls/51"}}},"pull_request":{"url":"https://api.github.com/repos/andela/learning-map-front/pulls/51","id":137829109,"html_url":"https://github.com/andela/learning-map-front/pull/51","diff_url":"https://github.com/andela/learning-map-front/pull/51.diff","patch_url":"https://github.com/andela/learning-map-front/pull/51.patch","issue_url":"https://api.github.com/repos/andela/learning-map-front/issues/51","number":51,"state":"open","locked":false,"title":"#150001988 Create sidebar, toggle and display contribution bookmarks","user":{"login":"andela-aolasode","id":25608624,"avatar_url":"https://avatars2.githubusercontent.com/u/25608624?v=4","gravatar_id":"","url":"https://api.github.com/users/andela-aolasode","html_url":"https://github.com/andela-aolasode","followers_url":"https://api.github.com/users/andela-aolasode/followers","following_url":"https://api.github.com/users/andela-aolasode/following{/other_user}","gists_url":"https://api.github.com/users/andela-aolasode/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-aolasode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-aolasode/subscriptions","organizations_url":"https://api.github.com/users/andela-aolasode/orgs","repos_url":"https://api.github.com/users/andela-aolasode/repos","events_url":"https://api.github.com/users/andela-aolasode/events{/privacy}","received_events_url":"https://api.github.com/users/andela-aolasode/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\nAllows user to view sidebar and toggle the bookmarking of contributions and displays bookmark on the side bar.\r\n\r\n#### Description of Task to be completed? \r\n- Create the sidebar component\r\n- Create App Wide Menus on the sidebar\r\n- Create bookmark section that display all user's bookmarks\r\n- Create bookmark component that toggles the bookmarking of a contribution\r\n- Restructure routing such that the Navbar and Sidebar appears on all pages\r\n- Ensure Navbar and Sidebar are sticky such that scrolling of page content does not move them\r\n\r\n#### How should this be manually tested?\r\nAfter cloning the repo\r\n\r\n- Run yarn install\r\n- Run yarn start\r\n- Access the landing page via localhost:3000 and click on the LOGIN TO CONTRIBUTE button.\r\n- On the dashboard click on the hamburger icon to display the sidebar and its contents.\r\n- Click the bookmark icon on each contribution card to toggle bookmark and see it appear and disappear on the sidebar.\r\n- Scroll the page to see the Navbar and Sidebar remain in position\r\n- Click the add contribution button to move another page to see the Navbar and Sidebar there.\r\n\r\n#### Any background context you want to provide?\r\n- There was no sidebar\r\n- Contributions were not bookmarkable\r\n- Navbar has to be included on each page\r\n\r\n#### What are the relevant pivotal tracker stories?\r\n[#150001966](https://www.pivotaltracker.com/story/show/150001966)\r\n[#150001988](https://www.pivotaltracker.com/story/show/150001988)\r\n[#150473913](https://www.pivotaltracker.com/story/show/150473913)\r\n\r\n#### Screenshots (if appropriate)\r\n![image](https://user-images.githubusercontent.com/25608624/29749067-f5a2fa0a-8b1b-11e7-885b-4ecca409f256.png)\r\n![image](https://user-images.githubusercontent.com/25608624/29749069-0693eaf4-8b1c-11e7-829d-d8e24fa94343.png)\r\n![image](https://user-images.githubusercontent.com/25608624/29749070-0da58956-8b1c-11e7-9e6f-92d76cf59573.png)\r\n![image](https://user-images.githubusercontent.com/25608624/29749072-19352a4c-8b1c-11e7-8b99-15c2b98f6285.png)\r\n<img width=\"1277\" alt=\"screen shot 2017-08-27 at 10 52 33 am\" src=\"https://user-images.githubusercontent.com/25608624/29749088-5a1298f6-8b1c-11e7-8f9c-3539a3b89861.png\">\r\n<img width=\"1280\" alt=\"screen shot 2017-08-27 at 10 53 11 am\" src=\"https://user-images.githubusercontent.com/25608624/29749090-73870178-8b1c-11e7-8deb-d8f200a71daf.png\">\r\n<img width=\"1280\" alt=\"screen shot 2017-08-27 at 10 53 41 am\" src=\"https://user-images.githubusercontent.com/25608624/29749091-7c0d0176-8b1c-11e7-8a37-f3f88a4fd86a.png\">\r\n<img width=\"1273\" alt=\"screen shot 2017-08-27 at 11 26 51 am\" src=\"https://user-images.githubusercontent.com/25608624/29749094-81d729ba-8b1c-11e7-9e71-e6a2240e03b2.png\">\r\n","created_at":"2017-08-27T10:40:49Z","updated_at":"2017-09-05T18:36:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75eac8b69ab11467fe5395a454cb9a1a26f47d57","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela/learning-map-front/pulls/51/commits","review_comments_url":"https://api.github.com/repos/andela/learning-map-front/pulls/51/comments","review_comment_url":"https://api.github.com/repos/andela/learning-map-front/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/learning-map-front/issues/51/comments","statuses_url":"https://api.github.com/repos/andela/learning-map-front/statuses/4a15d1ccf827025a33eb89160c2ecbfe8fa83eec","head":{"label":"andela:ft-contribution-bookmarks-sidebar","ref":"ft-contribution-bookmarks-sidebar","sha":"4a15d1ccf827025a33eb89160c2ecbfe8fa83eec","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":94885920,"name":"learning-map-front","full_name":"andela/learning-map-front","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/learning-map-front","description":null,"fork":false,"url":"https://api.github.com/repos/andela/learning-map-front","forks_url":"https://api.github.com/repos/andela/learning-map-front/forks","keys_url":"https://api.github.com/repos/andela/learning-map-front/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/learning-map-front/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/learning-map-front/teams","hooks_url":"https://api.github.com/repos/andela/learning-map-front/hooks","issue_events_url":"https://api.github.com/repos/andela/learning-map-front/issues/events{/number}","events_url":"https://api.github.com/repos/andela/learning-map-front/events","assignees_url":"https://api.github.com/repos/andela/learning-map-front/assignees{/user}","branches_url":"https://api.github.com/repos/andela/learning-map-front/branches{/branch}","tags_url":"https://api.github.com/repos/andela/learning-map-front/tags","blobs_url":"https://api.github.com/repos/andela/learning-map-front/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/learning-map-front/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/learning-map-front/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/learning-map-front/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/learning-map-front/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/learning-map-front/languages","stargazers_url":"https://api.github.com/repos/andela/learning-map-front/stargazers","contributors_url":"https://api.github.com/repos/andela/learning-map-front/contributors","subscribers_url":"https://api.github.com/repos/andela/learning-map-front/subscribers","subscription_url":"https://api.github.com/repos/andela/learning-map-front/subscription","commits_url":"https://api.github.com/repos/andela/learning-map-front/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/learning-map-front/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/learning-map-front/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/learning-map-front/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/learning-map-front/contents/{+path}","compare_url":"https://api.github.com/repos/andela/learning-map-front/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/learning-map-front/merges","archive_url":"https://api.github.com/repos/andela/learning-map-front/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/learning-map-front/downloads","issues_url":"https://api.github.com/repos/andela/learning-map-front/issues{/number}","pulls_url":"https://api.github.com/repos/andela/learning-map-front/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/learning-map-front/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/learning-map-front/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/learning-map-front/labels{/name}","releases_url":"https://api.github.com/repos/andela/learning-map-front/releases{/id}","deployments_url":"https://api.github.com/repos/andela/learning-map-front/deployments","created_at":"2017-06-20T11:51:43Z","updated_at":"2017-07-27T14:47:36Z","pushed_at":"2017-09-05T18:11:03Z","git_url":"git://github.com/andela/learning-map-front.git","ssh_url":"git@github.com:andela/learning-map-front.git","clone_url":"https://github.com/andela/learning-map-front.git","svn_url":"https://github.com/andela/learning-map-front","homepage":null,"size":5283,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":12,"forks":1,"open_issues":12,"watchers":0,"default_branch":"develop"}},"base":{"label":"andela:develop","ref":"develop","sha":"65e319f5eee2e91318610c843b12f8f557b9780f","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":94885920,"name":"learning-map-front","full_name":"andela/learning-map-front","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/learning-map-front","description":null,"fork":false,"url":"https://api.github.com/repos/andela/learning-map-front","forks_url":"https://api.github.com/repos/andela/learning-map-front/forks","keys_url":"https://api.github.com/repos/andela/learning-map-front/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/learning-map-front/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/learning-map-front/teams","hooks_url":"https://api.github.com/repos/andela/learning-map-front/hooks","issue_events_url":"https://api.github.com/repos/andela/learning-map-front/issues/events{/number}","events_url":"https://api.github.com/repos/andela/learning-map-front/events","assignees_url":"https://api.github.com/repos/andela/learning-map-front/assignees{/user}","branches_url":"https://api.github.com/repos/andela/learning-map-front/branches{/branch}","tags_url":"https://api.github.com/repos/andela/learning-map-front/tags","blobs_url":"https://api.github.com/repos/andela/learning-map-front/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/learning-map-front/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/learning-map-front/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/learning-map-front/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/learning-map-front/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/learning-map-front/languages","stargazers_url":"https://api.github.com/repos/andela/learning-map-front/stargazers","contributors_url":"https://api.github.com/repos/andela/learning-map-front/contributors","subscribers_url":"https://api.github.com/repos/andela/learning-map-front/subscribers","subscription_url":"https://api.github.com/repos/andela/learning-map-front/subscription","commits_url":"https://api.github.com/repos/andela/learning-map-front/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/learning-map-front/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/learning-map-front/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/learning-map-front/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/learning-map-front/contents/{+path}","compare_url":"https://api.github.com/repos/andela/learning-map-front/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/learning-map-front/merges","archive_url":"https://api.github.com/repos/andela/learning-map-front/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/learning-map-front/downloads","issues_url":"https://api.github.com/repos/andela/learning-map-front/issues{/number}","pulls_url":"https://api.github.com/repos/andela/learning-map-front/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/learning-map-front/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/learning-map-front/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/learning-map-front/labels{/name}","releases_url":"https://api.github.com/repos/andela/learning-map-front/releases{/id}","deployments_url":"https://api.github.com/repos/andela/learning-map-front/deployments","created_at":"2017-06-20T11:51:43Z","updated_at":"2017-07-27T14:47:36Z","pushed_at":"2017-09-05T18:11:03Z","git_url":"git://github.com/andela/learning-map-front.git","ssh_url":"git@github.com:andela/learning-map-front.git","clone_url":"https://github.com/andela/learning-map-front.git","svn_url":"https://github.com/andela/learning-map-front","homepage":null,"size":5283,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":12,"forks":1,"open_issues":12,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/learning-map-front/pulls/51"},"html":{"href":"https://github.com/andela/learning-map-front/pull/51"},"issue":{"href":"https://api.github.com/repos/andela/learning-map-front/issues/51"},"comments":{"href":"https://api.github.com/repos/andela/learning-map-front/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/learning-map-front/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/learning-map-front/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/learning-map-front/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/andela/learning-map-front/statuses/4a15d1ccf827025a33eb89160c2ecbfe8fa83eec"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"andela-uofoegbu"}}