Skip to content
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

Pull down to refresh implemented #132

Merged
merged 32 commits into from Jul 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f455e30
Merge pull request #1 from gitpoint/master
SammyIsra Jul 17, 2017
9e091a8
Added react-native-cli to avoid onboarding issues in the future
SammyIsra Jul 20, 2017
f52e2f6
Pull down to refresh implemented in profile page
SammyIsra Jul 20, 2017
90c8d76
Pull down to refresh implemented in Repository page. Closes #103.
SammyIsra Jul 20, 2017
8e285b4
Merge branch 'master' into master
SammyIsra Jul 20, 2017
5eb2b51
Fixed some merge issues
SammyIsra Jul 20, 2017
870ea3c
Fixing some more merging issues
SammyIsra Jul 20, 2017
9a86228
Forgot to add myself as a contributor.
SammyIsra Jul 20, 2017
08548e5
Fetching user data and fetching repository data have been moved into …
SammyIsra Jul 21, 2017
e02fe90
Merge branch 'master' into master
SammyIsra Jul 22, 2017
f308a7b
Fixed some merge issues.
SammyIsra Jul 22, 2017
36d8cf7
Renamed the function that fetches the information to be a bit more de…
SammyIsra Jul 22, 2017
5d7736b
Merge branch 'master' into master
SammyIsra Jul 22, 2017
088dc12
Again, fixing my own merge issues. Doing it here with code highlight …
SammyIsra Jul 23, 2017
9d97a3a
Merge branch 'master' into master
SammyIsra Jul 24, 2017
7c11120
Fixed some merge issues, _again_
SammyIsra Jul 24, 2017
f8506e7
Added pull to refresh to the non auth profile screen. Other minor imp…
SammyIsra Jul 24, 2017
438a87f
Fixing indentation inside of `<ScrollView />`
SammyIsra Jul 24, 2017
f7da7a5
Removing extra newline
SammyIsra Jul 24, 2017
899d028
Adding a newline between our components and vendor components.
SammyIsra Jul 24, 2017
a17a572
Added myself as a contributor. Code and Bug Reports
SammyIsra Jul 24, 2017
88eee32
Valid NPM versions need to include three parts (x.y.z)
SammyIsra Jul 27, 2017
15d685b
Removed the double ScrollView. Parallax can now take in refreshContro…
SammyIsra Jul 27, 2017
ec7c9ef
Pull down to refresh now in Issue/PR page (comment list)
SammyIsra Jul 27, 2017
f484cd8
Merge branch 'master' into master
SammyIsra Jul 27, 2017
442690c
Fixed some merging issues and yarn lockfile
SammyIsra Jul 27, 2017
203cc2b
Organizations are now refreshable
SammyIsra Jul 27, 2017
f6ed3ba
Better behavior on the AuthUser pull to refresh
SammyIsra Jul 27, 2017
02c5e67
Even better experience when refreshing AuthProfile. Now we have a fla…
SammyIsra Jul 27, 2017
3e907f9
Refreshing on Issues (specifically) works again
SammyIsra Jul 28, 2017
5d639c1
Merge branch 'master' into master
SammyIsra Jul 28, 2017
66ad3e3
Used '!!' instead of '|| false' as per suggestion
SammyIsra Jul 28, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions .all-contributorsrc
Expand Up @@ -183,6 +183,16 @@
"code"
]
},
{
"login": "SammyIsra",
"name": "Sammy Israwi",
"avatar_url": "https://avatars0.githubusercontent.com/u/8962228?v=4",
"profile": "https://github.com/SammyIsra",
"contributions": [
"code",
"bug"
]
},
{
"login": "RogerAbyss",
"name": "Chao Ren",
Expand Down
8 changes: 4 additions & 4 deletions README.md
@@ -1,6 +1,6 @@
<h1 align="center"> GitPoint </h1> <br>
<p align="center">
 <a href="https://gitpoint.co/">
<a href="https://gitpoint.co/">
<img alt="GitPoint" title="GitPoint" src="http://i.imgur.com/VShxJHs.png" width="450">
</a>
</p>
Expand All @@ -17,8 +17,8 @@

## Introduction

[![Build Status](https://img.shields.io/travis/gitpoint/git-point/master.svg?style=flat-square)](https://travis-ci.org/gitpoint/git-point)
[![All Contributors](https://img.shields.io/badge/all_contributors-19-orange.svg?style=flat-square)](#contributors)
[![Build Status](https://img.shields.io/travis/gitpoint/git-point.svg?style=flat-square)](https://travis-ci.org/gitpoint/git-point)
[![All Contributors](https://img.shields.io/badge/all_contributors-20-orange.svg?style=flat-square)](#contributors)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![Gitter chat](https://img.shields.io/badge/chat-on_gitter-008080.svg?style=flat-square)](https://gitter.im/git-point)

Expand Down Expand Up @@ -67,5 +67,5 @@ Please take a look at the [contributing guidelines](./CONTRIBUTING.md) for a det
| [<img src="https://avatars0.githubusercontent.com/u/12476932?v=3" width="100px;"/><br /><sub>Houssein Djirdeh</sub>](https://houssein.me)<br />[💬](#question-housseindjirdeh "Answering Questions") [💻](https://github.com/gitpoint/git-point/commits?author=housseindjirdeh "Code") [🎨](#design-housseindjirdeh "Design") [📖](https://github.com/gitpoint/git-point/commits?author=housseindjirdeh "Documentation") [👀](#review-housseindjirdeh "Reviewed Pull Requests") | [<img src="https://avatars2.githubusercontent.com/u/16705071?v=3" width="100px;"/><br /><sub>gejose</sub>](https://github.com/gejose)<br />[💻](https://github.com/gitpoint/git-point/commits?author=gejose "Code") | [<img src="https://avatars3.githubusercontent.com/u/14151327?v=3" width="100px;"/><br /><sub>rmevans9</sub>](https://github.com/rmevans9)<br />[💻](https://github.com/gitpoint/git-point/commits?author=rmevans9 "Code") | [<img src="https://avatars1.githubusercontent.com/u/4408379?v=3" width="100px;"/><br /><sub>Alexey Pyltsyn</sub>](http://lex111.ru)<br />[💻](https://github.com/gitpoint/git-point/commits?author=lex111 "Code") [🐛](https://github.com/gitpoint/git-point/issues?q=author%3Alex111 "Bug reports") | [<img src="https://avatars2.githubusercontent.com/u/10660468?v=3" width="100px;"/><br /><sub>Jason Etcovitch</sub>](https://jasonet.co)<br />[💻](https://github.com/gitpoint/git-point/commits?author=JasonEtco "Code") | [<img src="https://avatars1.githubusercontent.com/u/1166143?v=3" width="100px;"/><br /><sub>Hosmel Quintana</sub>](http://hosmelq.com)<br />[💻](https://github.com/gitpoint/git-point/commits?author=hosmelq "Code") | [<img src="https://avatars0.githubusercontent.com/u/464978?v=3" width="100px;"/><br /><sub>Alejandro Ñáñez Ortiz</sub>](http://co.linkedin.com/in/alejandronanez/)<br />[💻](https://github.com/gitpoint/git-point/commits?author=alejandronanez "Code") [👀](#review-alejandronanez "Reviewed Pull Requests") |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [<img src="https://avatars3.githubusercontent.com/u/3055294?v=3" width="100px;"/><br /><sub>Patrick Wang</sub>](https://patw.me)<br />[💻](https://github.com/gitpoint/git-point/commits?author=patw0929 "Code") [🐛](https://github.com/gitpoint/git-point/issues?q=author%3Apatw0929 "Bug reports") | [<img src="https://avatars5.githubusercontent.com/u/627794?v=4" width="100px;"/><br /><sub>Mike Kavouras</sub>](https://github.com/mikekavouras)<br />[💻](https://github.com/gitpoint/git-point/commits?author=mikekavouras "Code") [🐛](https://github.com/gitpoint/git-point/issues?q=author%3Amikekavouras "Bug reports") | [<img src="https://avatars4.githubusercontent.com/u/4848554?v=4" width="100px;"/><br /><sub>Peter Lazar</sub>](https://github.com/peterlazar1993)<br />[💻](https://github.com/gitpoint/git-point/commits?author=peterlazar1993 "Code") | [<img src="https://avatars6.githubusercontent.com/u/5106887?v=4" width="100px;"/><br /><sub>June Domingo</sub>](https://github.com/junedomingo)<br />[💻](https://github.com/gitpoint/git-point/commits?author=junedomingo "Code") [🐛](https://github.com/gitpoint/git-point/issues?q=author%3Ajunedomingo "Bug reports") | [<img src="https://avatars7.githubusercontent.com/u/9287184?v=4" width="100px;"/><br /><sub>Antoine</sub>](http://www.jaaccelere.com)<br />[💻](https://github.com/gitpoint/git-point/commits?author=Antoine38660 "Code") [🐛](https://github.com/gitpoint/git-point/issues?q=author%3AAntoine38660 "Bug reports") | [<img src="https://avatars6.githubusercontent.com/u/13142418?v=4" width="100px;"/><br /><sub>Wang Shidong</sub>](https://wsdjeg.github.io)<br />[💻](https://github.com/gitpoint/git-point/commits?author=wsdjeg "Code") | [<img src="https://avatars4.githubusercontent.com/u/2190589?v=4" width="100px;"/><br /><sub>Swapnil Joshi</sub>](http://swapnilmj.users.sourceforge.net/)<br />[💻](https://github.com/gitpoint/git-point/commits?author=swapnilmj "Code") |
| [<img src="https://avatars5.githubusercontent.com/u/408959?v=4" width="100px;"/><br /><sub>Rolf Koenders</sub>](https://github.com/RolfKoenders)<br />[💻](https://github.com/gitpoint/git-point/commits?author=RolfKoenders "Code") [🐛](https://github.com/gitpoint/git-point/issues?q=author%3ARolfKoenders "Bug reports") | [<img src="https://avatars1.githubusercontent.com/u/10191084?v=4" width="100px;"/><br /><sub>Andrew Dassonville</sub>](https://andrewda.me)<br />[💻](https://github.com/gitpoint/git-point/commits?author=andrewda "Code") [💬](#question-andrewda "Answering Questions") [🐛](https://github.com/gitpoint/git-point/issues?q=author%3Aandrewda "Bug reports") [👀](#review-andrewda "Reviewed Pull Requests") | [<img src="https://avatars0.githubusercontent.com/u/2076088?v=4" width="100px;"/><br /><sub>Anton</sub>](https://medium.com/@antondomashnev)<br />[💻](https://github.com/gitpoint/git-point/commits?author=Antondomashnev "Code") | [<img src="https://avatars0.githubusercontent.com/u/14795799?v=4" width="100px;"/><br /><sub>Xuezheng Ma</sub>](https://github.com/xuezhma)<br />[💻](https://github.com/gitpoint/git-point/commits?author=xuezhma "Code") | [<img src="https://avatars1.githubusercontent.com/u/8122587?v=4" width="100px;"/><br /><sub>Chao Ren</sub>](https://github.com/RogerAbyss)<br />[🐛](https://github.com/gitpoint/git-point/issues?q=author%3ARogerAbyss "Bug reports") [💻](https://github.com/gitpoint/git-point/commits?author=RogerAbyss "Code") |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a merge conflict gone wrong. These README changes shouldn't be here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(except appending your name to the bottom which is done automatically by yarn contributor:add)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I thought I had fixed it before... I ran the command before (when I first introduced the PR), but there were new contributors since then so I had to fix the list of contributors.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend just copy and pasting the README from master and just running the command again. Probably the easiest way to do it lol

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I think I may have broken the list... Do you think it would be best to reset this file to the one in git-point/master and then running the command yarn contributor:add again?

Copy link
Member

@andrewda andrewda Jul 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I sent that message before I realized you recommended that a minute before haha

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed!

| [<img src="https://avatars5.githubusercontent.com/u/408959?v=4" width="100px;"/><br /><sub>Rolf Koenders</sub>](https://github.com/RolfKoenders)<br />[💻](https://github.com/gitpoint/git-point/commits?author=RolfKoenders "Code") [🐛](https://github.com/gitpoint/git-point/issues?q=author%3ARolfKoenders "Bug reports") | [<img src="https://avatars1.githubusercontent.com/u/10191084?v=4" width="100px;"/><br /><sub>Andrew Dassonville</sub>](https://andrewda.me)<br />[💻](https://github.com/gitpoint/git-point/commits?author=andrewda "Code") [💬](#question-andrewda "Answering Questions") [🐛](https://github.com/gitpoint/git-point/issues?q=author%3Aandrewda "Bug reports") [👀](#review-andrewda "Reviewed Pull Requests") | [<img src="https://avatars0.githubusercontent.com/u/2076088?v=4" width="100px;"/><br /><sub>Anton</sub>](https://medium.com/@antondomashnev)<br />[💻](https://github.com/gitpoint/git-point/commits?author=Antondomashnev "Code") | [<img src="https://avatars0.githubusercontent.com/u/14795799?v=4" width="100px;"/><br /><sub>Xuezheng Ma</sub>](https://github.com/xuezhma)<br />[💻](https://github.com/gitpoint/git-point/commits?author=xuezhma "Code") | [<img src="https://avatars0.githubusercontent.com/u/8962228?v=4" width="100px;"/><br /><sub>Sammy Israwi</sub>](https://github.com/SammyIsra)<br />[💻](https://github.com/gitpoint/git-point/commits?author=SammyIsra "Code") [🐛](https://github.com/gitpoint/git-point/issues?q=author%3ASammyIsra "Bug reports") | [<img src="https://avatars1.githubusercontent.com/u/8122587?v=4" width="100px;"/><br /><sub>Chao Ren</sub>](https://github.com/RogerAbyss)<br />[🐛](https://github.com/gitpoint/git-point/issues?q=author%3ARogerAbyss "Bug reports") [💻](https://github.com/gitpoint/git-point/commits?author=RogerAbyss "Code") |
<!-- ALL-CONTRIBUTORS-LIST:END -->
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -99,6 +99,7 @@
"lint-staged": "^3.2.6",
"pre-commit": "^1.2.2",
"prettier": "^1.3.1",
"react-native-cli": "^2.0.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this in here? Maybe I just missed it, thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My machine was having problems with running yarn commands that called on react-native. The problem was with npm itself, and a workaround listed was to include react-native-cli as a dev dependency.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me then. =]

"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
Expand Down
3 changes: 3 additions & 0 deletions src/auth/auth.reducer.js
Expand Up @@ -12,6 +12,7 @@ const initialState = {
isAuthenticated: false,
accessToken: null,
user: {},
hasInitialUser: false,
orgs: [],
events: [],
isPendingUser: false,
Expand Down Expand Up @@ -50,6 +51,7 @@ export const authReducer = (state = initialState, action = {}) => {
case LOGOUT.SUCCESS:
return {
...initialState,
hasInitialUser: false,
};
case LOGOUT.FAILURE:
return {
Expand All @@ -67,6 +69,7 @@ export const authReducer = (state = initialState, action = {}) => {
...state,
user: action.payload,
isPendingUser: false,
hasInitialUser: true,
};
case GET_AUTH_USER.ERROR:
return {
Expand Down
108 changes: 65 additions & 43 deletions src/auth/screens/auth-profile.screen.js
@@ -1,6 +1,11 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { StyleSheet, Text, TouchableOpacity } from 'react-native';
import {
StyleSheet,
Text,
TouchableOpacity,
RefreshControl,
} from 'react-native';
import { ListItem } from 'react-native-elements';
import { NavigationActions } from 'react-navigation';
import codePush from 'react-native-code-push';
Expand All @@ -9,7 +14,6 @@ import {
ViewContainer,
UserProfile,
SectionList,
LoadingContainer,
ParallaxScroll,
UserListItem,
EntityInfo,
Expand All @@ -24,6 +28,7 @@ const mapStateToProps = state => ({
orgs: state.auth.orgs,
isPendingUser: state.auth.isPendingUser,
isPendingOrgs: state.auth.isPendingOrgs,
hasInitialUser: state.auth.hasInitialUser,
});

const mapDispatchToProps = dispatch => ({
Expand Down Expand Up @@ -86,6 +91,7 @@ class AuthProfile extends Component {
orgs: Array,
isPendingUser: boolean,
isPendingOrgs: boolean,
hasInitialUser: boolean,
navigation: Object,
};

Expand All @@ -94,8 +100,7 @@ class AuthProfile extends Component {
};

componentDidMount() {
this.props.getUserByDispatch();
this.props.getOrgsByDispatch();
this.refreshProfile();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

}

checkForUpdate = () => {
Expand All @@ -116,6 +121,11 @@ class AuthProfile extends Component {
}
};

refreshProfile = () => {
this.props.getUserByDispatch();
this.props.getOrgsByDispatch();
};

signOutUser() {
const { signOutByDispatch, navigation } = this.props;

Expand All @@ -134,36 +144,50 @@ class AuthProfile extends Component {
}

render() {
const { user, orgs, isPendingUser, isPendingOrgs, navigation } = this.props;
const {
user,
orgs,
isPendingUser,
isPendingOrgs,
navigation,
hasInitialUser,
} = this.props;

const loading = isPendingUser || isPendingOrgs;

return (
<ViewContainer>
{loading && <LoadingContainer animating={loading} center />}

{!loading &&
<ParallaxScroll
renderContent={() =>
<UserProfile
type="user"
initialUser={user}
user={user}
navigation={navigation}
/>}
stickyTitle={user.login}
>
{user.bio &&
user.bio !== '' &&
<SectionList title="BIO">
<ListItem
subtitle={emojifyText(user.bio)}
subtitleStyle={styles.listSubTitle}
hideChevron
/>
</SectionList>}
<ParallaxScroll
renderContent={() =>
<UserProfile
type="user"
initialUser={hasInitialUser ? user : {}}
user={hasInitialUser ? user : {}}
navigation={navigation}
/>}
refreshControl={
<RefreshControl
refreshing={loading}
onRefresh={this.refreshProfile}
/>
}
stickyTitle={user.login}
>
{hasInitialUser &&
user.bio &&
user.bio !== '' &&
<SectionList title="BIO">
<ListItem
subtitle={emojifyText(user.bio)}
subtitleStyle={styles.listSubTitle}
hideChevron
/>
</SectionList>}

<EntityInfo entity={user} orgs={orgs} navigation={navigation} />
{!loading &&
<EntityInfo entity={user} orgs={orgs} navigation={navigation} />}

{!isPendingOrgs &&
<SectionList
title="ORGANIZATIONS"
noItems={orgs.length === 0}
Expand All @@ -186,8 +210,9 @@ class AuthProfile extends Component {
You may have to request approval for them.
</Text>
</Text>
</SectionList>
</SectionList>}

{!loading &&
<SectionList>
<ListItem
title="Privacy Policy"
Expand All @@ -201,20 +226,17 @@ class AuthProfile extends Component {
hideChevron
onPress={() => this.signOutUser()}
/>
</SectionList>

<TouchableOpacity
style={styles.update}
onPress={this.checkForUpdate}
>
<Text style={styles.updateText}>
GitPoint v{version}
</Text>
<Text style={[styles.updateText, styles.updateTextSub]}>
{this.state.updateText}
</Text>
</TouchableOpacity>
</ParallaxScroll>}
</SectionList>}

<TouchableOpacity style={styles.update} onPress={this.checkForUpdate}>
<Text style={styles.updateText}>
GitPoint v{version}
</Text>
<Text style={[styles.updateText, styles.updateTextSub]}>
{this.state.updateText}
</Text>
</TouchableOpacity>
</ParallaxScroll>
</ViewContainer>
);
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/parallax-scroll.component.js
Expand Up @@ -17,6 +17,7 @@ type Props = {
menuAction?: Function,
navigation: Object,
children?: React.Element<*>,
refreshControl?: React.Element<*>,
};

const styles = StyleSheet.create({
Expand Down Expand Up @@ -59,6 +60,7 @@ export const ParallaxScroll = ({
menuAction,
navigation,
children,
refreshControl,
}: Props) =>
<ParallaxScrollView
backgroundColor={colors.primaryDark}
Expand Down Expand Up @@ -102,6 +104,7 @@ export const ParallaxScroll = ({
/>
</View>}
</View>}
refreshControl={refreshControl}
>
{children}
</ParallaxScrollView>;
Expand All @@ -111,4 +114,5 @@ ParallaxScroll.defaultProps = {
showMenu: false,
menuAction: undefined,
children: null,
refreshControl: null,
};