fixing layout error

This commit is contained in:
balzack 2022-10-24 00:16:32 -07:00
parent f41b4fccba
commit 889e6b4cc7
3 changed files with 26 additions and 12 deletions

View File

@ -85,12 +85,19 @@ export function Cards({ openRegistry, openContact }) {
<Text style={styles.newtext}>New</Text> <Text style={styles.newtext}>New</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<FlatList style={styles.cards} { state.cards.length == 0 && (
data={state.cards} <View style={styles.notfound}>
initialNumToRender={25} <Text style={styles.notfoundtext}>No Contacts Found</Text>
renderItem={({ item }) => <CardItem item={item} openContact={openContact} />} </View>
keyExtractor={item => item.cardId} )}
/> { state.cards.length != 0 && (
<FlatList style={styles.cards}
data={state.cards}
initialNumToRender={25}
renderItem={({ item }) => <CardItem item={item} openContact={openContact} />}
keyExtractor={item => item.cardId}
/>
)}
</> </>
)} )}
{ !state.tabbed && ( { !state.tabbed && (

View File

@ -45,8 +45,8 @@ export function ChannelsBody({ state, actions, openConversation }) {
return ( return (
<> <>
{ state.channels.length == 0 && ( { state.channels.length == 0 && (
<View style={styles.channels}> <View style={styles.notfound}>
<Text style={styles.notfound}>No Topics Found</Text> <Text style={styles.notfoundtext}>No Topics Found</Text>
</View> </View>
)} )}
{ state.channels.length > 0 && ( { state.channels.length > 0 && (
@ -114,8 +114,8 @@ export function Channels({ openConversation }) {
</SafeAreaView> </SafeAreaView>
<SafeAreaView style={styles.channels} edges={['left']}> <SafeAreaView style={styles.channels} edges={['left']}>
{ state.channels.length == 0 && ( { state.channels.length == 0 && (
<View style={styles.channels}> <View style={styles.notfound}>
<Text style={styles.notfound}>No Topics Found</Text> <Text style={styles.notfoundtext}>No Topics Found</Text>
</View> </View>
)} )}
{ state.channels.length != 0 && ( { state.channels.length != 0 && (

View File

@ -57,6 +57,15 @@ export const styles = StyleSheet.create({
flexShrink: 1, flexShrink: 1,
}, },
notfound: { notfound: {
flexShrink: 1,
flexGrow: 1,
width: '100%',
paddingLeft: 16,
paddingRight: 16,
alignItems: 'center',
justifyContent: 'center',
},
notfoundtext: {
fontSize: 20, fontSize: 20,
color: Colors.grey, color: Colors.grey,
}, },
@ -66,8 +75,6 @@ export const styles = StyleSheet.create({
width: '100%', width: '100%',
paddingLeft: 16, paddingLeft: 16,
paddingRight: 16, paddingRight: 16,
alignItems: 'center',
justifyContent: 'center',
}, },
addbottom: { addbottom: {
backgroundColor: Colors.primary, backgroundColor: Colors.primary,