Remove confusing add workout button from plan
This commit is contained in:
parent
008667c3a2
commit
c9adaf59ff
21
EditPlan.tsx
21
EditPlan.tsx
|
@ -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={() => {
|
|
||||||
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"
|
mode="contained"
|
||||||
icon="save"
|
icon="save"
|
||||||
onPress={save}>
|
onPress={save}>
|
||||||
Save
|
Save
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
|
||||||
</View>
|
</View>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
@ -135,4 +121,7 @@ const styles = StyleSheet.create({
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
marginBottom: MARGIN,
|
marginBottom: MARGIN,
|
||||||
},
|
},
|
||||||
|
button: {
|
||||||
|
margin: MARGIN * 2,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user