aboutsummaryrefslogtreecommitdiff
path: root/src/components/messages
diff options
context:
space:
mode:
authorShravya Ramesh <shravs1208@gmail.com>2021-04-08 17:11:28 -0700
committerShravya Ramesh <shravs1208@gmail.com>2021-04-08 17:11:28 -0700
commit98a31b59df5b51ea9488220d47bd7d60b3a268b9 (patch)
tree8a74ae256bc826d2338061fdd605db67c1ec350b /src/components/messages
parent3e5b961fd372efb6234af89176781114fa6f0625 (diff)
minor styling and removed unused imports
Diffstat (limited to 'src/components/messages')
-rw-r--r--src/components/messages/ChannelPreview.tsx41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/components/messages/ChannelPreview.tsx b/src/components/messages/ChannelPreview.tsx
index 8ec6060a..312f879a 100644
--- a/src/components/messages/ChannelPreview.tsx
+++ b/src/components/messages/ChannelPreview.tsx
@@ -2,10 +2,10 @@ import {useNavigation} from '@react-navigation/core';
import React, {useContext} from 'react';
import {Image, StyleSheet, Text, View} from 'react-native';
import {TouchableOpacity} from 'react-native-gesture-handler';
-import {useSelector, useStore} from 'react-redux';
+import {useStore} from 'react-redux';
+import {usernameRegex} from 'src/constants';
import {ChannelPreviewMessengerProps} from 'stream-chat-react-native';
import {ChatContext} from '../../App';
-import {RootState} from '../../store/rootReducer';
import {
LocalAttachmentType,
LocalChannelType,
@@ -15,20 +15,18 @@ import {
LocalReactionType,
LocalUserType,
} from '../../types';
-import {normalize, SCREEN_HEIGHT} from '../../utils';
+import {normalize, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils';
import {getMember, isOnline} from '../../utils/messages';
-const ChannelPreview: React.FC<
- ChannelPreviewMessengerProps<
- LocalAttachmentType,
- LocalChannelType,
- LocalCommandType,
- LocalEventType,
- LocalMessageType,
- LocalReactionType,
- LocalUserType
- >
-> = (props) => {
+const ChannelPreview: React.FC<ChannelPreviewMessengerProps<
+ LocalAttachmentType,
+ LocalChannelType,
+ LocalCommandType,
+ LocalEventType,
+ LocalMessageType,
+ LocalReactionType,
+ LocalUserType
+>> = (props) => {
const {setChannel} = useContext(ChatContext);
const state = useStore().getState();
const navigation = useNavigation();
@@ -78,14 +76,14 @@ const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row',
- height: Math.round(SCREEN_HEIGHT / 10),
+ height: Math.round(SCREEN_HEIGHT / 9),
+ width: Math.round(SCREEN_WIDTH * 0.85),
+ alignSelf: 'center',
alignItems: 'center',
- paddingHorizontal: '8%',
- paddingVertical: '5%',
},
avatar: {
- width: normalize(62),
- height: normalize(62),
+ width: normalize(60),
+ height: normalize(60),
borderRadius: normalize(62) / 2,
},
online: {
@@ -101,8 +99,7 @@ const styles = StyleSheet.create({
},
content: {
flex: 1,
- height: '100%',
- justifyContent: 'space-between',
+ height: '60%',
flexDirection: 'column',
marginLeft: '5%',
},
@@ -116,6 +113,7 @@ const styles = StyleSheet.create({
fontWeight: '500',
fontSize: normalize(12),
lineHeight: normalize(14),
+ paddingTop: '5%',
},
unread: {
fontWeight: '700',
@@ -126,6 +124,7 @@ const styles = StyleSheet.create({
width: normalize(10),
height: normalize(10),
borderRadius: normalize(10) / 2,
+ marginLeft: '5%',
},
});