mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-27 15:37:34 +03:00
added close when scroll feature for wallet comments and posts on profile tab
This commit is contained in:
parent
8a5aba31ae
commit
ba314972dd
@ -316,9 +316,11 @@ class PostsView extends Component {
|
||||
|
||||
_handleOnScroll = event => {
|
||||
const { scrollOffsetY } = this.state;
|
||||
const { handleOnScroll } = this.props;
|
||||
const currentOffset = event.nativeEvent.contentOffset.y;
|
||||
this.setState({ scrollOffsetY: currentOffset });
|
||||
|
||||
if (handleOnScroll) handleOnScroll();
|
||||
this.setState({ scrollOffsetY: currentOffset });
|
||||
this.setState({ isShowFilterBar: scrollOffsetY > currentOffset || scrollOffsetY <= 0 });
|
||||
};
|
||||
|
||||
|
@ -137,7 +137,7 @@ class WalletContainer extends Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { currentAccount, selectedUser, isDarkTheme } = this.props;
|
||||
const { currentAccount, selectedUser, isDarkTheme, handleOnScroll } = this.props;
|
||||
const { walletData, isClaiming, isRefreshing } = this.state;
|
||||
|
||||
return (
|
||||
@ -150,6 +150,7 @@ class WalletContainer extends Component {
|
||||
handleOnWalletRefresh={this._handleOnWalletRefresh}
|
||||
isRefreshing={isRefreshing}
|
||||
isDarkTheme={isDarkTheme}
|
||||
handleOnScroll={handleOnScroll}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* eslint-disable react/jsx-wrap-multilines */
|
||||
import React, { PureComponent, Fragment } from 'react';
|
||||
import { View, Text, ScrollView, RefreshControl } from 'react-native';
|
||||
import { injectIntl } from 'react-intl';
|
||||
@ -53,10 +54,13 @@ class WalletView extends PureComponent {
|
||||
selectedUsername,
|
||||
walletData,
|
||||
isDarkTheme,
|
||||
handleOnScroll,
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<ScrollView
|
||||
onScroll={handleOnScroll && handleOnScroll}
|
||||
style={styles.scrollView}
|
||||
refreshControl={
|
||||
<RefreshControl
|
||||
refreshing={isRefreshing}
|
||||
@ -67,7 +71,6 @@ class WalletView extends PureComponent {
|
||||
colors={['#fff']}
|
||||
/>
|
||||
}
|
||||
style={styles.scrollView}
|
||||
>
|
||||
{!walletData ? (
|
||||
<Fragment>
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* eslint-disable react/jsx-wrap-multilines */
|
||||
import React, { PureComponent } from 'react';
|
||||
import { View, Text, FlatList, ActivityIndicator } from 'react-native';
|
||||
import { View, Text, FlatList } from 'react-native';
|
||||
import { injectIntl } from 'react-intl';
|
||||
|
||||
// Constants
|
||||
|
@ -207,7 +207,7 @@ class ProfileScreen extends PureComponent {
|
||||
getFor="blog"
|
||||
tag={username}
|
||||
key={username}
|
||||
handleOnScroll={this._handleOnScroll}
|
||||
handleOnScroll={isSummaryOpen ? this._handleOnScroll : null}
|
||||
forceLoadPost={forceLoadPost}
|
||||
changeForceLoadPostState={changeForceLoadPostState}
|
||||
/>
|
||||
@ -225,7 +225,7 @@ class ProfileScreen extends PureComponent {
|
||||
style={styles.commentsTabBar}
|
||||
>
|
||||
{comments && comments.length > 0 ? (
|
||||
<ScrollView>
|
||||
<ScrollView onScroll={this._handleOnScroll}>
|
||||
<Comments isProfilePreview comments={comments} fetchPost={getReplies} />
|
||||
</ScrollView>
|
||||
) : (
|
||||
@ -253,6 +253,7 @@ class ProfileScreen extends PureComponent {
|
||||
<Wallet
|
||||
setEstimatedWalletValue={this._setEstimatedWalletValue}
|
||||
selectedUser={selectedUser}
|
||||
handleOnScroll={isSummaryOpen ? this._handleOnScroll : null}
|
||||
/>
|
||||
) : (
|
||||
<WalletDetailsPlaceHolder />
|
||||
|
Loading…
Reference in New Issue
Block a user