Make onboarding added dishes list scrollable to keep Finish button stable

This commit is contained in:
alexandrev-tibco
2026-02-26 11:08:30 +01:00
parent 9f4cf7484d
commit ae40ec6f09
@@ -127,37 +127,42 @@ struct FirstDishesStepView: View {
.foregroundColor(.mealMoodTextSecondary) .foregroundColor(.mealMoodTextSecondary)
.padding(.horizontal, 24) .padding(.horizontal, 24)
ForEach(Array(viewModel.addedDishes.enumerated()), id: \.offset) { index, dish in ScrollView {
HStack { LazyVStack(spacing: 8) {
Image(systemName: "checkmark.circle.fill") ForEach(Array(viewModel.addedDishes.enumerated()), id: \.offset) { index, dish in
.foregroundColor(.mealMoodSuccess) HStack {
Image(systemName: "checkmark.circle.fill")
.foregroundColor(.mealMoodSuccess)
Text(dish.name) Text(dish.name)
.font(.mealMoodBody) .font(.mealMoodBody)
.foregroundColor(.mealMoodTextPrimary) .foregroundColor(.mealMoodTextPrimary)
// Show tag pills // Show tag pills
HStack(spacing: 4) { HStack(spacing: 4) {
ForEach(availableTags.filter { dish.tagIds.contains($0.id) }.prefix(2)) { tag in ForEach(availableTags.filter { dish.tagIds.contains($0.id) }.prefix(2)) { tag in
TagPill(name: tag.localizedName(language: language), color: tag.color) TagPill(name: tag.localizedName(language: language), color: tag.color)
}
}
Spacer()
Button {
viewModel.removeDish(at: index)
} label: {
Image(systemName: "trash")
.font(.system(size: 14))
.foregroundColor(.mealMoodError)
}
} }
} .padding(12)
.background(Color.mealMoodSurface)
Spacer() .cornerRadius(12)
Button {
viewModel.removeDish(at: index)
} label: {
Image(systemName: "trash")
.font(.system(size: 14))
.foregroundColor(.mealMoodError)
} }
} }
.padding(12)
.background(Color.mealMoodSurface)
.cornerRadius(12)
.padding(.horizontal, 24)
} }
.frame(maxHeight: 190)
.padding(.horizontal, 24)
} }
} }