Add empty message to Home

This commit is contained in:
Brandon Presley 2022-07-07 17:20:27 +12:00
parent 06c4746b62
commit 6f8bc2cbc1
1 changed files with 14 additions and 3 deletions

View File

@ -1,7 +1,13 @@
import AsyncStorage from '@react-native-async-storage/async-storage';
import React, {useContext, useEffect, useState} from 'react';
import {FlatList, NativeModules, SafeAreaView, StyleSheet} from 'react-native';
import {AnimatedFAB, Searchbar} from 'react-native-paper';
import {
FlatList,
NativeModules,
SafeAreaView,
StyleSheet,
Text,
} from 'react-native';
import {AnimatedFAB, List, Searchbar} from 'react-native-paper';
import {DatabaseContext} from './App';
import EditSet from './EditSet';
@ -91,8 +97,13 @@ export default function Home() {
<SafeAreaView style={styles.container}>
<Searchbar placeholder="Search" value={search} onChangeText={setSearch} />
<FlatList
style={{height: 100}}
data={sets}
ListEmptyComponent={
<List.Item
title="No sets yet"
description="A set is a group of repetitions (or reps). For example, you might do a set of 8 reps on the Bench Press."
/>
}
renderItem={renderItem}
keyExtractor={set => set.id!.toString()}
onEndReached={next}