From 0fe8bbf10636491f231acaffed7324ec7693e0b2 Mon Sep 17 00:00:00 2001 From: feruz Date: Mon, 23 Dec 2019 10:12:47 +0200 Subject: [PATCH] new user notification empty message --- .../notification/view/notificationStyles.js | 3 + .../notification/view/notificationView.js | 72 ++++++++++--------- src/config/locales/en-US.json | 3 +- .../notification/screen/notificationScreen.js | 2 +- 4 files changed, 46 insertions(+), 34 deletions(-) diff --git a/src/components/notification/view/notificationStyles.js b/src/components/notification/view/notificationStyles.js index 4751439fe..536990dbe 100644 --- a/src/components/notification/view/notificationStyles.js +++ b/src/components/notification/view/notificationStyles.js @@ -21,4 +21,7 @@ export default EStyleSheet.create({ listContentContainer: { paddingBottom: 60, }, + text: { + padding: 10, + }, }); diff --git a/src/components/notification/view/notificationView.js b/src/components/notification/view/notificationView.js index 8ab683346..357d8ebc5 100644 --- a/src/components/notification/view/notificationView.js +++ b/src/components/notification/view/notificationView.js @@ -1,6 +1,6 @@ /* eslint-disable react/jsx-wrap-multilines */ import React, { PureComponent, Fragment } from 'react'; -import { View, FlatList, ActivityIndicator, RefreshControl } from 'react-native'; +import { View, FlatList, ActivityIndicator, RefreshControl, Text } from 'react-native'; import { injectIntl } from 'react-intl'; // Constants @@ -177,38 +177,46 @@ class NotificationView extends PureComponent { onRightIconPress={readAllNotification} /> - {({ isDarkTheme }) => ( - getActivities()} - keyExtractor={item => item.title} - onEndReached={() => getActivities(null, selectedFilter, true)} - ListFooterComponent={this._renderFooterLoading} - ListEmptyComponent={} - contentContainerStyle={styles.listContentContainer} - refreshControl={ - - } - renderItem={({ item, index }) => ( - - + _notifications && _notifications.length > 0 ? ( + getActivities()} + keyExtractor={item => item.title} + onEndReached={() => getActivities(null, selectedFilter, true)} + ListFooterComponent={this._renderFooterLoading} + ListEmptyComponent={} + contentContainerStyle={styles.listContentContainer} + refreshControl={ + - {this._renderList(item.notifications)} - - )} - /> - )} + } + renderItem={({ item, index }) => ( + + + {this._renderList(item.notifications)} + + )} + /> + ) : ( + + {intl.formatMessage({ + id: 'notification.noactivity', + })} + + ) + } ); diff --git a/src/config/locales/en-US.json b/src/config/locales/en-US.json index 7c26872ed..02b4c74ae 100644 --- a/src/config/locales/en-US.json +++ b/src/config/locales/en-US.json @@ -124,7 +124,8 @@ "activities": "All", "replies": "Replies", "mentions": "Mentions", - "reblogs": "Reblogs" + "reblogs": "Reblogs", + "noactivity": "No new activity found" }, "leaderboard": { "daily": "DAILY", diff --git a/src/screens/notification/screen/notificationScreen.js b/src/screens/notification/screen/notificationScreen.js index 82777208b..74aff39e7 100644 --- a/src/screens/notification/screen/notificationScreen.js +++ b/src/screens/notification/screen/notificationScreen.js @@ -1,4 +1,4 @@ -import React, { PureComponent, Fragment } from 'react'; +import React, { Fragment } from 'react'; import { View, SafeAreaView } from 'react-native'; import ScrollableTabView from 'react-native-scrollable-tab-view'; import { injectIntl } from 'react-intl';