aboutsummaryrefslogtreecommitdiff
path: root/src/screens
diff options
context:
space:
mode:
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/chat/ChatListScreen.tsx4
-rw-r--r--src/screens/chat/ChatResultsCell.tsx10
-rw-r--r--src/screens/main/NotificationsScreen.tsx4
-rw-r--r--src/screens/main/notification/EmptyNotificationView.tsx48
-rw-r--r--src/screens/onboarding/OnboardingStepThree.tsx5
-rw-r--r--src/screens/profile/SocialMediaTaggs.tsx2
6 files changed, 10 insertions, 63 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/chat/ChatResultsCell.tsx b/src/screens/chat/ChatResultsCell.tsx
index e1eb97dd..14062810 100644
--- a/src/screens/chat/ChatResultsCell.tsx
+++ b/src/screens/chat/ChatResultsCell.tsx
@@ -1,13 +1,13 @@
import {useNavigation} from '@react-navigation/native';
import React, {useContext, useEffect, useState} from 'react';
-import {Alert, Image, StyleSheet, Text, View} from 'react-native';
+import {Alert, StyleSheet, Text, View} from 'react-native';
import {TouchableOpacity} from 'react-native-gesture-handler';
import {ChatContext} from '../../App';
+import {Avatar} from '../../components';
import {ERROR_FAILED_TO_CREATE_CHANNEL} from '../../constants/strings';
import {loadImageFromURL} from '../../services';
import {ProfilePreviewType, UserType} from '../../types';
import {createChannel, normalize, SCREEN_WIDTH} from '../../utils';
-import {defaultUserProfile} from '../../utils/users';
interface ChatResults {
profileData: ProfilePreviewType;
@@ -58,11 +58,7 @@ const ChatResultsCell: React.FC<ChatResults> = ({
<TouchableOpacity
onPress={createChannelIfNotPresentAndNavigate}
style={styles.cellContainer}>
- <Image
- defaultSource={defaultUserProfile()}
- source={{uri: avatar}}
- style={styles.imageContainer}
- />
+ <Avatar style={styles.imageContainer} uri={avatar} />
<View style={[styles.initialTextContainer, styles.multiText]}>
<Text style={styles.initialTextStyle}>{`@${username}`}</Text>
<Text style={styles.secondaryTextStyle}>
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;
diff --git a/src/screens/onboarding/OnboardingStepThree.tsx b/src/screens/onboarding/OnboardingStepThree.tsx
index 638f0889..34173b39 100644
--- a/src/screens/onboarding/OnboardingStepThree.tsx
+++ b/src/screens/onboarding/OnboardingStepThree.tsx
@@ -27,7 +27,6 @@ import {
ERROR_SELECT_CLASS_YEAR,
ERROR_SELECT_GENDER,
ERROR_SELECT_UNIVERSITY,
- ERROR_UPLOAD_SMALL_PROFILE_PIC,
} from '../../constants/strings';
import {OnboardingStackParams} from '../../routes/onboarding';
import {patchEditProfile} from '../../services';
@@ -160,10 +159,6 @@ const OnboardingStepThree: React.FC<OnboardingStepThreeProps> = ({
};
const handleSubmit = async () => {
- if (!form.smallPic) {
- Alert.alert(ERROR_UPLOAD_SMALL_PROFILE_PIC);
- return;
- }
if (form.classYear === -1) {
Alert.alert(ERROR_SELECT_CLASS_YEAR);
return;
diff --git a/src/screens/profile/SocialMediaTaggs.tsx b/src/screens/profile/SocialMediaTaggs.tsx
index 9186f187..52d20683 100644
--- a/src/screens/profile/SocialMediaTaggs.tsx
+++ b/src/screens/profile/SocialMediaTaggs.tsx
@@ -59,7 +59,7 @@ const SocialMediaTaggs: React.FC<SocialMediaTaggsProps> = ({
useEffect(() => {
navigation.setOptions({
headerTitle: () => {
- return <AvatarTitle avatar={avatar ?? null} />;
+ return <AvatarTitle avatar={avatar} />;
},
});
}, [avatar, navigation]);