Wait for data before displaying workouts on plans

Closes #92
This commit is contained in:
Brandon Presley 2022-10-16 17:20:13 +13:00
parent c05a76ed1a
commit ae947d5405
1 changed files with 23 additions and 20 deletions

View File

@ -166,26 +166,29 @@ export default function StartPlan() {
innerRef={unitRef}
/>
)}
<FlatList
data={workouts}
renderItem={({item, index}) => (
<List.Item
title={item}
description={getDescription(item)}
onPress={() => select(index)}
left={() => (
<View style={{alignItems: 'center', justifyContent: 'center'}}>
<RadioButton
onPress={() => select(index)}
value={index.toString()}
status={selected === index ? 'checked' : 'unchecked'}
color={color}
/>
</View>
)}
/>
)}
/>
{counts && distinctSets && (
<FlatList
data={workouts}
renderItem={({item, index}) => (
<List.Item
title={item}
description={getDescription(item)}
onPress={() => select(index)}
left={() => (
<View
style={{alignItems: 'center', justifyContent: 'center'}}>
<RadioButton
onPress={() => select(index)}
value={index.toString()}
status={selected === index ? 'checked' : 'unchecked'}
color={color}
/>
</View>
)}
/>
)}
/>
)}
</View>
<Button mode="contained" icon="save" onPress={handleSubmit}>
Save