From 1a720ccfb680ecdb1022df00d2d5291e74707733 Mon Sep 17 00:00:00 2001 From: u-e Date: Tue, 15 Jan 2019 15:40:43 +0300 Subject: [PATCH 1/2] updated read all notification loading indicator --- .../filterBar/view/filterBarView.js | 16 +------- .../notification/view/notificationView.js | 40 +++++++++++++------ .../container/notificationContainer.js | 12 +++++- 3 files changed, 39 insertions(+), 29 deletions(-) diff --git a/src/components/filterBar/view/filterBarView.js b/src/components/filterBar/view/filterBarView.js index 9fea8edf1..1b1c7ddd9 100644 --- a/src/components/filterBar/view/filterBarView.js +++ b/src/components/filterBar/view/filterBarView.js @@ -7,7 +7,6 @@ import { DropdownButton } from '../../dropdownButton'; // Components import { LineBreak } from '../../basicUIElements'; -import { PulseAnimation } from '../../animations'; // Styles import styles from './filterBarStyles'; @@ -28,7 +27,6 @@ const FilterBarView = ({ rightIconName, rightIconType, selectedOptionIndex, - rightIconLoading, }) => ( {!isHide && ( @@ -41,7 +39,7 @@ const FilterBarView = ({ onSelect={onDropdownSelect} selectedOptionIndex={selectedOptionIndex} /> - {rightIconName && !rightIconLoading && ( + {rightIconName && ( onRightIconPress && onRightIconPress()} style={styles.rightIconWrapper} @@ -54,18 +52,6 @@ const FilterBarView = ({ /> )} - {rightIconName && rightIconLoading && ( - - - - )} )} diff --git a/src/components/notification/view/notificationView.js b/src/components/notification/view/notificationView.js index 8e62fd983..5347e3fcd 100644 --- a/src/components/notification/view/notificationView.js +++ b/src/components/notification/view/notificationView.js @@ -1,6 +1,6 @@ import React, { PureComponent, Fragment } from 'react'; import { - View, ScrollView, FlatList, ActivityIndicator, + View, ScrollView, FlatList, ActivityIndicator, RefreshControl, } from 'react-native'; import { injectIntl } from 'react-intl'; @@ -142,20 +142,26 @@ class NotificationView extends PureComponent { return 4; }; + _getActivityIndicator = () => ( + + + + ); + render() { const { - readAllNotification, getActivities, loading, readAllNotificationLoading, + readAllNotification, + getActivities, + loading, + readAllNotificationLoading, + isDarkTheme, } = this.props; const { filters, selectedFilter } = this.state; const _notifications = this._getNotificationsArrays(); if (_notifications.length === 0) { - return ( - - - - ); + return this._getActivityIndicator(); } return ( @@ -165,9 +171,9 @@ class NotificationView extends PureComponent { options={filters.map(item => item.value)} defaultText="ALL ACTIVITIES" onDropdownSelect={this._handleOnDropdownSelect} - rightIconName="ios-checkmark" + rightIconName="check" + rightIconType="MaterialIcons" onRightIconPress={readAllNotification} - rightIconLoading={readAllNotificationLoading} /> = e.nativeEvent.contentSize.height - paddingToBottom - && !loading + e.nativeEvent.contentOffset.y >= e.nativeEvent.contentSize.height - paddingToBottom + && !loading ) { getActivities(selectedFilter, true); } @@ -185,6 +190,17 @@ class NotificationView extends PureComponent { > null} + refreshControl={( + +)} renderItem={({ item, index }) => ( ({ - username: state.account.currentAccount.name, isLoggedIn: state.application.isLoggedIn, + isDarkTheme: state.application.isDarkTheme, + + username: state.account.currentAccount.name, activeBottomTab: state.ui.activeBottomTab, }); From e1a2ebfab7363cd03cc23e08a2e164e77c1d3e18 Mon Sep 17 00:00:00 2001 From: u-e Date: Tue, 15 Jan 2019 15:51:49 +0300 Subject: [PATCH 2/2] fixed change theme spining indicator issue --- .../notification/container/notificationContainer.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/screens/notification/container/notificationContainer.js b/src/screens/notification/container/notificationContainer.js index d85eef37b..b994328e4 100644 --- a/src/screens/notification/container/notificationContainer.js +++ b/src/screens/notification/container/notificationContainer.js @@ -22,6 +22,14 @@ class NotificationContainer extends Component { }; } + componentDidMount() { + const { username } = this.props; + + if (username) { + this._getAvtivities(); + } + } + componentWillReceiveProps(nextProps) { if (nextProps.activeBottomTab === ROUTES.TABBAR.NOTIFICATION) { if (nextProps.username) {