new user notification empty message

This commit is contained in:
feruz 2019-12-23 10:12:47 +02:00
parent 5ad81c0a9c
commit 0fe8bbf106
4 changed files with 46 additions and 34 deletions

View File

@ -21,4 +21,7 @@ export default EStyleSheet.create({
listContentContainer: { listContentContainer: {
paddingBottom: 60, paddingBottom: 60,
}, },
text: {
padding: 10,
},
}); });

View File

@ -1,6 +1,6 @@
/* eslint-disable react/jsx-wrap-multilines */ /* eslint-disable react/jsx-wrap-multilines */
import React, { PureComponent, Fragment } from 'react'; 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'; import { injectIntl } from 'react-intl';
// Constants // Constants
@ -177,38 +177,46 @@ class NotificationView extends PureComponent {
onRightIconPress={readAllNotification} onRightIconPress={readAllNotification}
/> />
<ThemeContainer> <ThemeContainer>
{({ isDarkTheme }) => ( {({ isDarkTheme }) =>
<FlatList _notifications && _notifications.length > 0 ? (
data={_notifications} <FlatList
refreshing={isNotificationRefreshing} data={_notifications}
onRefresh={() => getActivities()} refreshing={isNotificationRefreshing}
keyExtractor={item => item.title} onRefresh={() => getActivities()}
onEndReached={() => getActivities(null, selectedFilter, true)} keyExtractor={item => item.title}
ListFooterComponent={this._renderFooterLoading} onEndReached={() => getActivities(null, selectedFilter, true)}
ListEmptyComponent={<ListPlaceHolder />} ListFooterComponent={this._renderFooterLoading}
contentContainerStyle={styles.listContentContainer} ListEmptyComponent={<ListPlaceHolder />}
refreshControl={ contentContainerStyle={styles.listContentContainer}
<RefreshControl refreshControl={
refreshing={isNotificationRefreshing} <RefreshControl
progressBackgroundColor="#357CE6" refreshing={isNotificationRefreshing}
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'} progressBackgroundColor="#357CE6"
titleColor="#fff" tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
colors={['#fff']} titleColor="#fff"
/> colors={['#fff']}
}
renderItem={({ item, index }) => (
<Fragment>
<ContainerHeader
hasSeperator={index !== 0}
isBoldTitle
title={item.title}
key={item.title}
/> />
{this._renderList(item.notifications)} }
</Fragment> renderItem={({ item, index }) => (
)} <Fragment>
/> <ContainerHeader
)} hasSeperator={index !== 0}
isBoldTitle
title={item.title}
key={item.title}
/>
{this._renderList(item.notifications)}
</Fragment>
)}
/>
) : (
<Text style={styles.text}>
{intl.formatMessage({
id: 'notification.noactivity',
})}
</Text>
)
}
</ThemeContainer> </ThemeContainer>
</View> </View>
); );

View File

@ -124,7 +124,8 @@
"activities": "All", "activities": "All",
"replies": "Replies", "replies": "Replies",
"mentions": "Mentions", "mentions": "Mentions",
"reblogs": "Reblogs" "reblogs": "Reblogs",
"noactivity": "No new activity found"
}, },
"leaderboard": { "leaderboard": {
"daily": "DAILY", "daily": "DAILY",

View File

@ -1,4 +1,4 @@
import React, { PureComponent, Fragment } from 'react'; import React, { Fragment } from 'react';
import { View, SafeAreaView } from 'react-native'; import { View, SafeAreaView } from 'react-native';
import ScrollableTabView from 'react-native-scrollable-tab-view'; import ScrollableTabView from 'react-native-scrollable-tab-view';
import { injectIntl } from 'react-intl'; import { injectIntl } from 'react-intl';