Skip to content

Commit d0653db

Browse files
#0: Доработки экрана избранного
1 parent b41f910 commit d0653db

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

EatHub/EatHub/Modules/Favorite/FavoriteView.swift

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ struct FavoriteView: View {
2323
.onAppear {
2424
viewModel.refreshFavorites()
2525
}
26+
.navigationTitle(viewModel.title)
27+
.navigationBarTitleDisplayMode(.large)
2628
.navigationDestination(for: RecipeViewModel.self) { recipeViewModel in
2729
let input = DetailsViewModuleInput(
2830
id: recipeViewModel.id,
@@ -33,7 +35,6 @@ struct FavoriteView: View {
3335
DetailsView(viewModel: detailsViewModel)
3436
}
3537
}
36-
.navigationTitle(viewModel.title)
3738
}
3839
}
3940

@@ -49,37 +50,23 @@ private extension FavoriteView {
4950
}
5051

5152
var nonScrollableEmptyState: some View {
52-
VStack(alignment: .leading, spacing: 0) {
53-
favoritesTitle
54-
Spacer()
55-
HStack {
53+
VStack(alignment: .center) {
5654
Spacer()
5755
emptyPlaceholder
56+
.padding(.horizontal)
5857
Spacer()
5958
}
60-
Spacer()
61-
}
62-
.padding(.horizontal)
63-
.background(Color(.systemGroupedBackground))
6459
}
6560

6661
var scrollableFavoritesList: some View {
6762
ScrollView {
6863
VStack(alignment: .leading, spacing: 0) {
69-
favoritesTitle
7064
favoritesList
7165
}
7266
.padding(.horizontal)
7367
}
7468
}
7569

76-
var favoritesTitle: some View {
77-
Text(viewModel.title)
78-
.font(.largeTitle)
79-
.bold()
80-
.padding([.horizontal, .top])
81-
}
82-
8370
var favoritesList: some View {
8471
LazyVStack(spacing: 8) {
8572
ForEach(viewModel.likedRecipes) { recipeViewModel in

0 commit comments

Comments
 (0)