alert shows what entry your updating
This commit is contained in:
@@ -63,7 +63,8 @@ struct ContentView: View {
|
|||||||
needsOnboarding = false
|
needsOnboarding = false
|
||||||
viewModel.updateOnboardingData(onboardingData: onboardingData)
|
viewModel.updateOnboardingData(onboardingData: onboardingData)
|
||||||
})
|
})
|
||||||
}).alert(String(localized: "content_view_fill_in_missing_entry"), isPresented: $showUpdateEntryAlert) {
|
}).alert(updateTitleHeader(forEntry: selectedEntry),
|
||||||
|
isPresented: $showUpdateEntryAlert) {
|
||||||
ForEach(Mood.allValues) { mood in
|
ForEach(Mood.allValues) { mood in
|
||||||
Button(mood.strValue, action: {
|
Button(mood.strValue, action: {
|
||||||
if let selectedEntry = selectedEntry {
|
if let selectedEntry = selectedEntry {
|
||||||
@@ -89,6 +90,25 @@ struct ContentView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func updateTitleHeader(forEntry entry: MoodEntry?) -> String {
|
||||||
|
guard let entry = entry else {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
let components = Calendar.current.dateComponents([.day, .month, .year], from: entry.forDate!)
|
||||||
|
let day = components.day!
|
||||||
|
let month = components.month!
|
||||||
|
let year = components.year!
|
||||||
|
|
||||||
|
let monthName = monthName(fromMonthInt: month)
|
||||||
|
let weekday = weekdayName(fromDate:entry.forDate!)
|
||||||
|
let dayz = dayFormat(fromDate:entry.forDate!)
|
||||||
|
|
||||||
|
let string = weekday + " " + monthName + " " + dayz + " " + String(year)
|
||||||
|
|
||||||
|
return String(format: String(localized: "content_view_fill_in_missing_entry"), string)
|
||||||
|
}
|
||||||
|
|
||||||
private var settingsButtonView: some View {
|
private var settingsButtonView: some View {
|
||||||
HStack {
|
HStack {
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
"content_view_tab_main" = "Main";
|
"content_view_tab_main" = "Main";
|
||||||
"content_view_tab_filter" = "Filter";
|
"content_view_tab_filter" = "Filter";
|
||||||
"content_view_tab_stats" = "Stats";
|
"content_view_tab_stats" = "Stats";
|
||||||
"content_view_fill_in_missing_entry" = "Update entry";
|
"content_view_fill_in_missing_entry" = "Update %@";
|
||||||
"content_view_fill_in_missing_entry_cancel" = "Cancel";
|
"content_view_fill_in_missing_entry_cancel" = "Cancel";
|
||||||
"content_view_delete_entry" = "Delete this entry";
|
"content_view_delete_entry" = "Delete this entry";
|
||||||
"content_view_header_title" = "Past %d days";
|
"content_view_header_title" = "Past %d days";
|
||||||
|
|||||||
Reference in New Issue
Block a user