Skip to content

Commit

Permalink
fix: 🐛 Edit and delete buttons now working on web
Browse files Browse the repository at this point in the history
  • Loading branch information
YeyoM committed May 24, 2024
1 parent d216fc0 commit fedc575
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions components/EditingRoutineExerciseList.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,20 @@ export default function EditingRoutineExerciseList({
</View>
</View>
<View style={styles.buttonsContainer}>
<Pressable style={styles.editButton}>
<Pressable
style={styles.editButton}
onPress={() => {
if (item.key.includes("lift")) {
navigation.navigate("Edit Exercise", {
exercise: item.exercise,
});
} else {
navigation.navigate("Edit Cardio Exercise", {
exercise: item.exercise,
});
}
}}
>
<Ionicons
name="create-outline"
size={16}
Expand All @@ -174,7 +187,16 @@ export default function EditingRoutineExerciseList({
/>
<Text style={{ color: "white", fontSize: 14 }}>Edit</Text>
</Pressable>
<Pressable style={styles.deleteButton}>
<Pressable
style={styles.deleteButton}
onPress={() => {
if (item.key.includes("lift")) {
deleteExercise(item.exercise.exerciseId, item.day);
} else {
deleteCardioExercise(item.exercise.exerciseName, item.day);
}
}}
>
<Ionicons
name="trash-outline"
size={16}
Expand Down

0 comments on commit fedc575

Please sign in to comment.