From 005a5b59bedae3ccd2572421ef5811e99a0e6c30 Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Sat, 27 Aug 2016 01:44:41 +0100 Subject: [PATCH 1/2] 186 - Hide "Star on GitHub" --- src/js/actions/index.js | 21 +++++++++++++++++++++ src/js/components/login.js | 2 +- src/js/components/notifications.js | 3 ++- src/js/middleware/requests.js | 8 +++++++- src/js/reducers/settings.js | 17 +++++++++++++++-- src/js/store/configureStore.js | 13 ++++++++++--- src/js/utils/constants.js | 2 ++ 7 files changed, 58 insertions(+), 8 deletions(-) diff --git a/src/js/actions/index.js b/src/js/actions/index.js index c221fc66b..855c17ed2 100644 --- a/src/js/actions/index.js +++ b/src/js/actions/index.js @@ -115,6 +115,27 @@ export function markRepoNotifications(loginId, repoId, repoFullName) { }; +// Starred + +export const HAS_STARRED_REQUEST = 'HAS_STARRED_REQUEST'; +export const HAS_STARRED_SUCCESS = 'HAS_STARRED_SUCCESS'; +export const HAS_STARRED_FAILURE = 'HAS_STARRED_FAILURE'; +export function checkHasStarred() { + return { + [CALL_API]: { + endpoint: `https://api.github.com/user/starred/${Constants.REPO_SLUG}`, + method: 'GET', + headers: { + 'Accept': 'application/json', + 'Cache-Control': 'no-cache', + 'Content-Type': 'application/json' + }, + types: [HAS_STARRED_REQUEST, HAS_STARRED_SUCCESS, HAS_STARRED_FAILURE] + } + }; +}; + + // Search export const SEARCH_NOTIFICATIONS = 'SEARCH_NOTIFICATIONS'; diff --git a/src/js/components/login.js b/src/js/components/login.js index 09d4f9765..3d87b75e5 100644 --- a/src/js/components/login.js +++ b/src/js/components/login.js @@ -75,7 +75,7 @@ export class LoginPage extends React.Component { return (
-
+
GitHub Notifications
in your menu bar.