UNPKG

react-native-modern-elements

Version:

A modern, customizable UI component library for React Native

33 lines (32 loc) 1.22 kB
import React from "react"; import { ActivityIndicator, Text, View } from "react-native"; const ListFooter = ({ loadingMore, dataLength, totalResult, hasMore, }) => { if (loadingMore && dataLength < totalResult) { return React.createElement(ActivityIndicator, { size: "large", style: { paddingBottom: 50 } }); } // if (dataLength >= totalResult) { // return ( // <View style={{ padding: 10, alignItems: "center" }}> // <Text>No more data</Text> // </View> // ); // } if (!hasMore && !loadingMore) { return (React.createElement(View, { style: { padding: 10, alignItems: "center", paddingBottom: 50, } }, React.createElement(Text, { style: { color: "black", fontStyle: "italic", paddingHorizontal: 20, // px-5 -> 5 * 4 = 20 paddingVertical: 8, // py-2 -> 2 * 4 = 8 borderRadius: 10, fontWeight: "700", // font-bold opacity: 0.6, } }, "No more data"))); } return null; }; export default ListFooter;