New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(*): status for following users/starring repos #260
Changes from 13 commits
22dee05
c29f3f7
056e2d2
a926245
245aa2a
0704248
01ae488
25caf94
4a24d64
b6a98bf
31ef527
32aed48
d869c61
b151500
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
// Hash: 01ae4880b9b4296907d680e9b909713c36c42491 | ||
// Link: https://github.com/gitpoint/git-point/pull/260 | ||
|
||
export const en = { | ||
auth: { | ||
login: { | ||
|
@@ -156,6 +159,9 @@ export const en = { | |
followingList: { | ||
title: 'Following', | ||
}, | ||
followYou: { | ||
title: 'Follows you', | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As part of trying to streamline translation updates, could you add a comment to the top of CC @machour There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And what if you add new phrases for translation into all language files? Then it will be clear what needs to be translated in other languages. In fact, we need to do this, because we get the situation that in the English version we have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just realised that we have France translation. I will add the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we make it fall back on the English translation if a phrase doesn't exist in a certain language? That would make everything a lot smoother IMO, and make it so we don't have to update every language in small PR's. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @housseindjirdeh no need to do that for the +1 on @andrewda request, we need a fallback to english and developers shouldn't have to touch translations files. It used to be the case with the previous system. @reyhansofian if you do touch the french file, here's the translation: "Vous suit". |
||
}, | ||
repository: { | ||
main: { | ||
|
@@ -185,6 +191,8 @@ export const en = { | |
starsTitle: 'Stars', | ||
forksTitle: 'Forks', | ||
forkedFromMessage: 'forked from', | ||
starred: 'Starred', | ||
watching: 'Watching', | ||
}, | ||
codeList: { | ||
title: 'Code', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,6 +161,9 @@ export const fr = { | |
followingList: { | ||
title: 'Following', | ||
}, | ||
followYou: { | ||
title: 'Vous suit', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
}, | ||
}, | ||
repository: { | ||
main: { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,13 +85,36 @@ export const checkFollowStatus = url => { | |
}; | ||
}; | ||
|
||
export const getFollowers = user => { | ||
return (dispatch, getState) => { | ||
const accessToken = getState().auth.accessToken; | ||
|
||
dispatch({ type: GET_FOLLOWERS.PENDING }); | ||
|
||
fetchUrl(`${USER_ENDPOINT(user.login)}/followers?per_page=100`, accessToken) | ||
.then(data => { | ||
dispatch({ | ||
type: GET_FOLLOWERS.SUCCESS, | ||
payload: data, | ||
}); | ||
}) | ||
.catch(error => { | ||
dispatch({ | ||
type: GET_FOLLOWERS.ERROR, | ||
payload: error, | ||
}); | ||
}); | ||
}; | ||
}; | ||
|
||
export const getUserInfo = user => { | ||
return dispatch => { | ||
return dispatch(getUser(user)).then(() => { | ||
dispatch(getOrgs(user)); | ||
dispatch( | ||
checkFollowStatus(`https://api.github.com/user/following/${user}`) | ||
); | ||
dispatch(getFollowers(user)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm assuming we fire this to get the list of followers as soon as a user navigates to the user profile screen so that we can determine whether we're following them correct? If that's the case, it's also currently being fired in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. exactly! I'll remove that action on |
||
}); | ||
}; | ||
}; | ||
|
@@ -149,28 +172,6 @@ export const getRepositories = user => { | |
}; | ||
}; | ||
|
||
export const getFollowers = user => { | ||
return (dispatch, getState) => { | ||
const accessToken = getState().auth.accessToken; | ||
|
||
dispatch({ type: GET_FOLLOWERS.PENDING }); | ||
|
||
fetchUrl(`${USER_ENDPOINT(user.login)}/followers?per_page=100`, accessToken) | ||
.then(data => { | ||
dispatch({ | ||
type: GET_FOLLOWERS.SUCCESS, | ||
payload: data, | ||
}); | ||
}) | ||
.catch(error => { | ||
dispatch({ | ||
type: GET_FOLLOWERS.ERROR, | ||
payload: error, | ||
}); | ||
}); | ||
}; | ||
}; | ||
|
||
export const getFollowing = user => { | ||
return (dispatch, getState) => { | ||
const accessToken = getState().auth.accessToken; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️