diff --git a/Shared/views/ContentView.swift b/Shared/views/ContentView.swift index d055806..2b6598a 100644 --- a/Shared/views/ContentView.swift +++ b/Shared/views/ContentView.swift @@ -183,6 +183,28 @@ struct ContentView: View { } } + private var headerView: some View { + VStack { + if viewModel.shouldShowVotingHeader() { + AddMoodHeaderView(addItemHeaderClosure: { (mood, date) in + withAnimation { + viewModel.add(mood: mood, forDate: date) + } + }) + .frame(height: 180) + .frame(minWidth: 0, maxWidth: .infinity) + } else { + HeaderStatsView(fakeData: false, backDays: 30) + .frame(height: 180) + // should match backDays above + Text(String(format: String(localized: "content_view_header_title"), 30)) + .font(.body) + .foregroundColor(Color(UIColor.systemGray)) + .frame(maxWidth: .infinity, alignment: .center) + } + } + } + private var mainView: some View { ZStack { @@ -190,27 +212,12 @@ struct ContentView: View { VStack{ settingsButtonView - if viewModel.shouldShowVotingHeader() { - AddMoodHeaderView(addItemHeaderClosure: { (mood, date) in - withAnimation { - viewModel.add(mood: mood, forDate: date) - } - }) - .frame(height: 180) - .frame(minWidth: 0, maxWidth: .infinity) - } else { - HeaderStatsView(fakeData: false, backDays: 30) - .frame(height: 180) - // should match backDays above - Text(String(format: String(localized: "content_view_header_title"), 30)) - .font(.body) - .foregroundColor(Color(UIColor.systemGray)) - .frame(maxWidth: .infinity, alignment: .center) - } + + headerView + listView - .padding(.bottom) } - .padding(.top, 50) + .padding(.bottom) } } }