File tree Expand file tree Collapse file tree 1 file changed +4
-17
lines changed
EatHub/EatHub/Modules/Favorite Expand file tree Collapse file tree 1 file changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ struct FavoriteView: View {
23
23
. onAppear {
24
24
viewModel. refreshFavorites ( )
25
25
}
26
+ . navigationTitle ( viewModel. title)
27
+ . navigationBarTitleDisplayMode ( . large)
26
28
. navigationDestination ( for: RecipeViewModel . self) { recipeViewModel in
27
29
let input = DetailsViewModuleInput (
28
30
id: recipeViewModel. id,
@@ -33,7 +35,6 @@ struct FavoriteView: View {
33
35
DetailsView ( viewModel: detailsViewModel)
34
36
}
35
37
}
36
- . navigationTitle ( viewModel. title)
37
38
}
38
39
}
39
40
@@ -49,37 +50,23 @@ private extension FavoriteView {
49
50
}
50
51
51
52
var nonScrollableEmptyState : some View {
52
- VStack ( alignment: . leading, spacing: 0 ) {
53
- favoritesTitle
54
- Spacer ( )
55
- HStack {
53
+ VStack ( alignment: . center) {
56
54
Spacer ( )
57
55
emptyPlaceholder
56
+ . padding ( . horizontal)
58
57
Spacer ( )
59
58
}
60
- Spacer ( )
61
- }
62
- . padding ( . horizontal)
63
- . background ( Color ( . systemGroupedBackground) )
64
59
}
65
60
66
61
var scrollableFavoritesList : some View {
67
62
ScrollView {
68
63
VStack ( alignment: . leading, spacing: 0 ) {
69
- favoritesTitle
70
64
favoritesList
71
65
}
72
66
. padding ( . horizontal)
73
67
}
74
68
}
75
69
76
- var favoritesTitle : some View {
77
- Text ( viewModel. title)
78
- . font ( . largeTitle)
79
- . bold ( )
80
- . padding ( [ . horizontal, . top] )
81
- }
82
-
83
70
var favoritesList : some View {
84
71
LazyVStack ( spacing: 8 ) {
85
72
ForEach ( viewModel. likedRecipes) { recipeViewModel in
You can’t perform that action at this time.
0 commit comments