Commit 0b1ab12f authored by Sebastian Trebunak's avatar Sebastian Trebunak
Browse files

add empty list item for notifiactions

parent cd8ad707
import React, { PureComponent } from "react";
import { FlatList } from "react-native";
import NotificationListItem from "./NotificationListItem";
import NotificationListEmptyItem from "./NotificationListEmptyItem";
export default class NotificationScreen extends PureComponent {
_keyExtractor = item => `notification-${item.id}`;
......@@ -14,6 +15,7 @@ export default class NotificationScreen extends PureComponent {
initialNumToRender={6}
renderItem={this._renderItem}
ItemSeparatorComponent={NotificationListItem.Divider}
ListEmptyComponent={<NotificationListEmptyItem />}
data={this.props.data}
/>
);
......
import React, { PureComponent } from "react";
import { ListItem, Icon } from "react-native-elements";
import { StyleSheet } from "react-native";
import { iOSColors } from "react-native-typography";
class NotificationListEmptyItem extends PureComponent {
render() {
return (
<ListItem
title="Notifikácie sú prázdne"
onPress={this._onPress}
leftAvatar={
<Icon
type="feather"
name="folder"
color="white"
size={15}
containerStyle={styles.avatarContainer}
/>
}
/>
);
}
}
const styles = StyleSheet.create({
avatarContainer: {
display: "flex",
alignItems: "center",
justifyContent: "center",
height: 36,
width: 36,
borderRadius: 18,
backgroundColor: iOSColors.blue
}
});
export default NotificationListEmptyItem;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment