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