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} innerRef={unitRef}
/> />
)} )}
<FlatList {counts && distinctSets && (
data={workouts} <FlatList
renderItem={({item, index}) => ( data={workouts}
<List.Item renderItem={({item, index}) => (
title={item} <List.Item
description={getDescription(item)} title={item}
onPress={() => select(index)} description={getDescription(item)}
left={() => ( onPress={() => select(index)}
<View style={{alignItems: 'center', justifyContent: 'center'}}> left={() => (
<RadioButton <View
onPress={() => select(index)} style={{alignItems: 'center', justifyContent: 'center'}}>
value={index.toString()} <RadioButton
status={selected === index ? 'checked' : 'unchecked'} onPress={() => select(index)}
color={color} value={index.toString()}
/> status={selected === index ? 'checked' : 'unchecked'}
</View> color={color}
)} />
/> </View>
)} )}
/> />
)}
/>
)}
</View> </View>
<Button mode="contained" icon="save" onPress={handleSubmit}> <Button mode="contained" icon="save" onPress={handleSubmit}>
Save Save