no votes screen

This commit is contained in:
Trey t
2022-01-26 14:02:50 -06:00
parent 25843185f9
commit 3739bc1aa1
4 changed files with 73 additions and 17 deletions

View File

@@ -205,6 +205,32 @@ struct ContentView: View {
}
}
private var emptyView: some View {
ZStack {
Color(UIColor.systemBackground)
VStack {
Text(String(localized: "content_view_empty_title"))
.font(.title)
.foregroundColor(Color(UIColor.label))
.padding()
Text(String(localized: "content_view_empty_title"))
.font(.body)
.foregroundColor(Color(UIColor.label))
.padding()
AddMoodHeaderView(addItemHeaderClosure: { (mood, date) in
withAnimation {
viewModel.add(mood: mood, forDate: date)
}
}, overrideDay: viewModel.shouldShowVotingHeader() ? .Today : .Previous)
}
}
.fixedSize(horizontal: false, vertical: true)
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))
.padding()
}
private var mainView: some View {
ZStack {
@@ -213,10 +239,14 @@ struct ContentView: View {
VStack{
settingsButtonView
.padding(.top, 50)
headerView
listView
if viewModel.hasNoData {
Spacer()
emptyView
Spacer()
} else {
headerView
listView
}
}
.padding(.bottom)
}