no votes screen
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user