created apple request

This commit is contained in:
ue 2018-12-11 23:26:38 +03:00
parent 1b8d3bdb9f
commit eccee09f6b
3 changed files with 26 additions and 4 deletions

View File

@ -55,6 +55,7 @@ class PostsContainer extends Component {
const mapStateToProps = state => ({
currentAccount: state.account.currentAccount,
isLoggedIn: state.application.isLoggedIn,
isLoginDone: state.application.isLoginDone,
isCollapsePostButtonOpen: state.ui.isCollapsePostButton,
});

View File

@ -25,6 +25,7 @@ class PostsView extends Component {
isLoading: false,
isPostsLoading: false,
isHideImage: false,
selectedFilterIndex: 0,
};
}
@ -111,7 +112,10 @@ class PostsView extends Component {
};
_handleOnDropdownSelect = (index) => {
this.setState({ isPostsLoading: true });
this.setState({
isPostsLoading: true,
selectedFilterIndex: index,
});
this._loadPosts(filters[index]);
};
@ -128,9 +132,11 @@ class PostsView extends Component {
render() {
const {
refreshing, posts, isPostsLoading, isHideImage,
refreshing, posts, isPostsLoading, isHideImage, selectedFilterIndex,
} = this.state;
const { filterOptions, intl } = this.props;
const {
filterOptions, intl, isLoggedIn, getFor, isLoginDone,
} = this.props;
return (
<Fragment>
@ -146,6 +152,18 @@ class PostsView extends Component {
onRightIconPress={this._onRightIconPress}
/>
)}
<Fragment>
{filters[selectedFilterIndex] === 'feed'
&& getFor === 'feed'
&& !isLoggedIn
&& isLoginDone && (
<NoPost
defaultText={intl.formatMessage({
id: 'profile.login_to_see',
})}
/>
)}
</Fragment>
{posts && posts.length > 0 && !isPostsLoading ? (
<FlatList
data={posts}

View File

@ -34,9 +34,11 @@ class HomeScreen extends PureComponent {
'PAYOUT',
];
let tag;
let initialPage;
if (isLoginDone && !isLoggedIn) {
tag = 'esteemapp';
// tag = 'esteemapp';
initialPage = 1;
}
return (
@ -46,6 +48,7 @@ class HomeScreen extends PureComponent {
<View style={styles.container}>
<ScrollableTabView
style={styles.tabView}
initialPage={isLoginDone && !isLoggedIn ? 1 : 0}
renderTabBar={() => (
<TabBar
style={styles.tabbar}