UI stuff
This commit is contained in:
@@ -81,15 +81,13 @@ struct DayView: View {
|
||||
})
|
||||
}
|
||||
}
|
||||
.padding([.top])
|
||||
}
|
||||
|
||||
|
||||
// MARK: Views
|
||||
public var mainView: some View {
|
||||
VStack {
|
||||
settingsButtonView
|
||||
.padding(.top)
|
||||
|
||||
if viewModel.hasNoData {
|
||||
Spacer()
|
||||
EmptyHomeView(showVote: true, viewModel: viewModel)
|
||||
@@ -99,42 +97,22 @@ struct DayView: View {
|
||||
headerView
|
||||
|
||||
listView
|
||||
.padding(.top, 5)
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding([.leading, .trailing])
|
||||
.background(
|
||||
theme.currentTheme.bg
|
||||
.edgesIgnoringSafeArea(.all)
|
||||
)
|
||||
.onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in
|
||||
PersistenceController.shared.fillInMissingDates()
|
||||
viewModel.updateData()
|
||||
}
|
||||
}
|
||||
|
||||
private var settingsButtonView: some View {
|
||||
HStack {
|
||||
Spacer()
|
||||
Button(action: {
|
||||
showingSheet.toggle()
|
||||
}, label: {
|
||||
Image(systemName: "gear")
|
||||
.foregroundColor(Color(UIColor.darkGray))
|
||||
.font(.system(size: 20))
|
||||
}).padding(.trailing)
|
||||
}
|
||||
}
|
||||
|
||||
private var headerView: some View {
|
||||
VStack {
|
||||
if ShowBasedOnVoteLogics.isMissingCurrentVote(onboardingData: UserDefaultsStore.getOnboarding()) {
|
||||
AddMoodHeaderView(addItemHeaderClosure: { (mood, date) in
|
||||
viewModel.add(mood: mood, forDate: date, entryType: .header)
|
||||
})
|
||||
.frame(height: DayViewConstants.maxHeaderHeight)
|
||||
.frame(minWidth: 0, maxWidth: .infinity)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user