From 98a31b59df5b51ea9488220d47bd7d60b3a268b9 Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Thu, 8 Apr 2021 17:11:28 -0700 Subject: minor styling and removed unused imports --- src/components/messages/ChannelPreview.tsx | 41 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'src/components/messages') 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> = (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%', }, }); -- cgit v1.2.3-70-g09d2