diff --git a/BestList.tsx b/BestList.tsx index 1133ad0..eef96b8 100644 --- a/BestList.tsx +++ b/BestList.tsx @@ -13,7 +13,7 @@ import Set from './set'; import {useSettings} from './use-settings'; export default function BestList() { - const [bests, setBests] = useState([]); + const [bests, setBests] = useState(); const [search, setSearch] = useState(''); const navigation = useNavigation>(); const {settings} = useSettings(); @@ -59,17 +59,18 @@ export default function BestList() { return ( - - } - renderItem={renderItem} - data={bests} - /> + {bests?.length === 0 ? ( + + ) : ( + + )} ); } diff --git a/PlanList.tsx b/PlanList.tsx index ccf3c1b..06d1561 100644 --- a/PlanList.tsx +++ b/PlanList.tsx @@ -15,7 +15,7 @@ import PlanItem from './PlanItem'; export default function PlanList() { const [search, setSearch] = useState(''); - const [plans, setPlans] = useState([]); + const [plans, setPlans] = useState(); const navigation = useNavigation>(); const refresh = useCallback(async () => { @@ -47,18 +47,19 @@ export default function PlanList() { return ( - set.id?.toString() || ''} - ListEmptyComponent={ - - } - /> + {plans?.length === 0 ? ( + + ) : ( + set.id?.toString() || ''} + /> + )} ); } diff --git a/SetList.tsx b/SetList.tsx index d6fadf0..55423c3 100644 --- a/SetList.tsx +++ b/SetList.tsx @@ -87,19 +87,20 @@ export default function SetList() { return ( - - } - renderItem={renderItem} - keyExtractor={s => s.id!.toString()} - onEndReached={next} - /> + {sets?.length === 0 ? ( + + ) : ( + s.id!.toString()} + onEndReached={next} + /> + )} ); } diff --git a/WorkoutList.tsx b/WorkoutList.tsx index 85bfadb..41dca82 100644 --- a/WorkoutList.tsx +++ b/WorkoutList.tsx @@ -80,19 +80,20 @@ export default function WorkoutList() { return ( - - } - renderItem={renderItem} - keyExtractor={w => w.name} - onEndReached={next} - /> + {workouts?.length === 0 ? ( + + ) : ( + w.name} + onEndReached={next} + /> + )} ); }