Merge pull request #394 from esteemapp/bugfix/android-feed

Fixed feed issue on Android
This commit is contained in:
uğur erdal 2019-01-10 17:30:09 +03:00 committed by GitHub
commit 3f012908f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 32 deletions

View File

@ -6,7 +6,6 @@ import NoPost from './view/noPost/noPostView';
import PostCardPlaceHolder from './view/placeHolder/postCardPlaceHolderView';
import PostPlaceHolder from './view/placeHolder/postPlaceHolderView';
import ProfileSummaryPlaceHolder from './view/placeHolder/profileSummaryPlaceHolder';
import RefreshControl from './view/refreshControl/refreshControlView';
import StickyBar from './view/stickyBar/stickyBarView';
import Tag from './view/tag/tagView';
import TextWithIcon from './view/textWithIcon/textWithIconView';
@ -24,7 +23,6 @@ export {
PostCardPlaceHolder,
PostPlaceHolder,
ProfileSummaryPlaceHolder,
RefreshControl,
StickyBar,
Tag,
TextWithIcon,

View File

@ -1,20 +0,0 @@
import React from 'react';
import { connect } from 'react-redux';
import { RefreshControl } from 'react-native';
const RefreshControlView = ({ refreshing, onRefresh, isDarkTheme }) => (
<RefreshControl
refreshing={refreshing}
onRefresh={onRefresh}
progressBackgroundColor="#357CE6"
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
titleColor="#fff"
colors={['#fff']}
/>
);
const mapStateToProps = state => ({
currentAccount: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(RefreshControlView);

View File

@ -1,5 +1,5 @@
import React, { Component, Fragment } from 'react';
import { FlatList, View, ActivityIndicator } from 'react-native';
import { FlatList, View, ActivityIndicator, RefreshControl } from 'react-native';
import { injectIntl } from 'react-intl';
import { withNavigation } from 'react-navigation';
@ -9,7 +9,7 @@ import { getPostsSummary } from '../../../providers/steem/dsteem';
// COMPONENTS
import { PostCard } from '../../postCard';
import { FilterBar } from '../../filterBar';
import { PostCardPlaceHolder, NoPost, RefreshControl } from '../../basicUIElements';
import { PostCardPlaceHolder, NoPost } from '../../basicUIElements';
import { POPULAR_FILTERS, PROFILE_FILTERS } from '../../../constants/options/filters';
// Styles
@ -229,7 +229,6 @@ class PostsView extends Component {
posts,
isPostsLoading,
isHideImage,
selectedFilterIndex,
isNoPost,
} = this.state;
const {
@ -286,9 +285,16 @@ class PostsView extends Component {
initialNumToRender={10}
ListFooterComponent={this._renderFooter}
onScrollBeginDrag={() => this._handleOnScrollStart()}
refreshControl={
<RefreshControl refreshing={refreshing} onRefresh={this._handleOnRefreshPosts} />
}
refreshControl={(
<RefreshControl
refreshing={refreshing}
onRefresh={this._handleOnRefreshPosts}
progressBackgroundColor="#357CE6"
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
titleColor="#fff"
colors={['#fff']}
/>
)}
ref={(ref) => {
this.flatList = ref;
}}

View File

@ -109,7 +109,7 @@ class WalletContainer extends Component {
};
render() {
const { currentAccount, selectedUser } = this.props;
const { currentAccount, selectedUser, isDarkTheme } = this.props;
const { walletData, claiming, isRefreshing } = this.state;
return (
@ -121,6 +121,7 @@ class WalletContainer extends Component {
claiming={claiming}
handleOnWalletRefresh={this._handleOnWalletRefresh}
isRefreshing={isRefreshing}
isDarkTheme={isDarkTheme}
/>
);
}
@ -129,6 +130,7 @@ class WalletContainer extends Component {
const mapStateToProps = state => ({
currentAccount: state.account.currentAccount,
pinCode: state.account.pin,
isDarkTheme: state.application.isDarkTheme,
});
export default injectIntl(connect(mapStateToProps)(WalletContainer));

View File

@ -52,13 +52,21 @@ class WalletView extends PureComponent {
isRefreshing,
selectedUsername,
walletData,
isDarkTheme,
} = this.props;
return (
<ScrollView
refreshControl={
<RefreshControl refreshing={isRefreshing} onRefresh={handleOnWalletRefresh} />
}
refreshControl={(
<RefreshControl
refreshing={isRefreshing}
onRefresh={handleOnWalletRefresh}
progressBackgroundColor="#357CE6"
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
titleColor="#fff"
colors={['#fff']}
/>
)}
style={styles.scrollView}
>
{!walletData ? (