Remove confusing add workout button from plan

This commit is contained in:
Brandon Presley 2022-11-16 18:48:16 +13:00
parent 008667c3a2
commit c9adaf59ff
1 changed files with 12 additions and 23 deletions

View File

@ -102,29 +102,15 @@ export default function EditPlan() {
)) ))
)} )}
</ScrollView> </ScrollView>
{names.length === 0 ? (
<Button <Button
disabled={workouts.length === 0 && days.length === 0} disabled={workouts.length === 0 && days.length === 0}
mode="contained" style={styles.button}
onPress={() => { mode="contained"
navigation.goBack() icon="save"
navigation.navigate('Workouts', { onPress={save}>
screen: 'EditWorkout', Save
params: {value: {name: ''}}, </Button>
})
}}>
Add workout
</Button>
) : (
<Button
disabled={workouts.length === 0 && days.length === 0}
style={{marginTop: MARGIN}}
mode="contained"
icon="save"
onPress={save}>
Save
</Button>
)}
</View> </View>
</> </>
) )
@ -135,4 +121,7 @@ const styles = StyleSheet.create({
fontSize: 20, fontSize: 20,
marginBottom: MARGIN, marginBottom: MARGIN,
}, },
button: {
margin: MARGIN * 2,
},
}) })