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>
</TouchableOpacity>
</View>
<FlatList style={styles.cards}
data={state.cards}
initialNumToRender={25}
renderItem={({ item }) => <CardItem item={item} openContact={openContact} />}
keyExtractor={item => item.cardId}
/>
{ state.cards.length == 0 && (
<View style={styles.notfound}>
<Text style={styles.notfoundtext}>No Contacts Found</Text>
</View>
)}
{ 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 && (

View File

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

View File

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