aboutsummaryrefslogtreecommitdiff
path: root/src/screens
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-05-04 13:32:01 -0400
committerGitHub <noreply@github.com>2021-05-04 13:32:01 -0400
commit9d3fdd9324d03e2f2bafbe2b0fe9f18607bfdbd4 (patch)
treedbe76b5c6f65867bdc414694e6d19dcd88056803 /src/screens
parent1441ef007549f24a292317f1e67c0de63cacbd2b (diff)
parent355829d9983b839db342881011cc3fe9ff3792f4 (diff)
Merge pull request #396 from ankit-thanekar007/tma-822-empty-inbox
[TMA-822] Empty Inbox Graphic
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/chat/ChatListScreen.tsx4
-rw-r--r--src/screens/main/NotificationsScreen.tsx4
-rw-r--r--src/screens/main/notification/EmptyNotificationView.tsx48
3 files changed, 6 insertions, 50 deletions
diff --git a/src/screens/chat/ChatListScreen.tsx b/src/screens/chat/ChatListScreen.tsx
index d2cfcb5d..1df5c2da 100644
--- a/src/screens/chat/ChatListScreen.tsx
+++ b/src/screens/chat/ChatListScreen.tsx
@@ -9,6 +9,7 @@ import {TabsGradient} from '../../components';
import {ChannelPreview, MessagesHeader} from '../../components/messages';
import {MainStackParams} from '../../routes';
import {RootState} from '../../store/rootReducer';
+import EmptyContentView from '../../components/common/EmptyContentView';
import {
LocalAttachmentType,
LocalChannelType,
@@ -99,6 +100,9 @@ const ChatListScreen: React.FC<ChatListScreenProps> = () => {
sort={{last_message_at: -1}}
maxUnreadCount={99}
Preview={ChannelPreview}
+ EmptyStateIndicator={() => {
+ return <EmptyContentView viewType={'ChatList'} />;
+ }}
/>
</View>
</Chat>
diff --git a/src/screens/main/NotificationsScreen.tsx b/src/screens/main/NotificationsScreen.tsx
index 3efd9af8..9fbc4cfe 100644
--- a/src/screens/main/NotificationsScreen.tsx
+++ b/src/screens/main/NotificationsScreen.tsx
@@ -28,7 +28,7 @@ import {
import {RootState} from '../../store/rootReducer';
import {NotificationType, ScreenType} from '../../types';
import {getDateAge, normalize, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils';
-import EmptyNotificationView from './notification/EmptyNotificationView';
+import EmptyContentView from '../../components/common/EmptyContentView';
const NotificationsScreen: React.FC = () => {
const {newNotificationReceived} = useSelector(
@@ -304,7 +304,7 @@ const NotificationsScreen: React.FC = () => {
extraData={requestLimit}
ListEmptyComponent={
<View style={styles.emptyViewContainer}>
- <EmptyNotificationView />
+ <EmptyContentView viewType={'Notification'} />
</View>
}
/>
diff --git a/src/screens/main/notification/EmptyNotificationView.tsx b/src/screens/main/notification/EmptyNotificationView.tsx
deleted file mode 100644
index f43cfb2a..00000000
--- a/src/screens/main/notification/EmptyNotificationView.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import React from 'react';
-import {Image, Text, StyleSheet, View} from 'react-native';
-import LinearGradient from 'react-native-linear-gradient';
-import {UP_TO_DATE, NO_NEW_NOTIFICATIONS} from '../../../constants/strings';
-import {NOTIFICATION_GRADIENT} from '../../../constants/constants';
-import {SCREEN_HEIGHT, normalize} from '../../../utils';
-const EmptyNotificationView: React.FC = () => {
- return (
- <View style={styles.container}>
- <LinearGradient
- style={styles.backgroundLinearView}
- useAngle={true}
- angle={180}
- colors={NOTIFICATION_GRADIENT}>
- <Image
- source={require('../../../assets/images/empty_notifications.png')}
- />
- </LinearGradient>
- <View style={styles.topMargin}>
- <Text style={styles.upperTextStyle}>{UP_TO_DATE}</Text>
- </View>
- <View>
- <Text style={styles.bottomTextStyle}>{NO_NEW_NOTIFICATIONS}</Text>
- </View>
- </View>
- );
-};
-
-const styles = StyleSheet.create({
- container: {alignItems: 'center'},
- topMargin: {marginTop: SCREEN_HEIGHT * 0.025},
- upperTextStyle: {
- fontWeight: '700',
- fontSize: normalize(23),
- lineHeight: normalize(40),
- },
- bottomTextStyle: {
- color: '#2D3B45',
- fontWeight: '600',
- fontSize: normalize(20),
- lineHeight: normalize(40),
- },
- backgroundLinearView: {
- borderRadius: 135.5,
- },
-});
-
-export default EmptyNotificationView;