diff --git a/Reflect/Localizable.xcstrings b/Reflect/Localizable.xcstrings index 2ed4ae7..823a18d 100644 --- a/Reflect/Localizable.xcstrings +++ b/Reflect/Localizable.xcstrings @@ -10571,6 +10571,18 @@ } } }, + "H: %lld° L: %lld°" : { + "comment" : "A pair of high and low temperatures displayed in degrees Celsius.", + "isCommentAutoGenerated" : true, + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "H: %1$lld° L: %2$lld°" + } + } + } + }, "Haptic Feedback" : { "comment" : "A label displayed above the toggle for haptic feedback.", "isCommentAutoGenerated" : true, diff --git a/Shared/Views/NoteEditorView.swift b/Shared/Views/NoteEditorView.swift index e7978d9..6948f20 100644 --- a/Shared/Views/NoteEditorView.swift +++ b/Shared/Views/NoteEditorView.swift @@ -193,12 +193,6 @@ struct EntryDetailView: View { // Notes section notesSection - // Weather section - if let weatherJSON = entry.weatherJSON, - let weatherData = WeatherData.decode(from: weatherJSON) { - weatherSection(weatherData) - } - // Photo section photoSection @@ -259,18 +253,40 @@ struct EntryDetailView: View { } private var dateHeader: some View { - VStack(spacing: 8) { - Text(entry.forDate, format: .dateTime.weekday(.wide)) - .font(.title2) - .fontWeight(.semibold) - .foregroundColor(textColor) + HStack { + VStack(alignment: .leading, spacing: 4) { + Text(entry.forDate, format: .dateTime.weekday(.wide)) + .font(.title2) + .fontWeight(.semibold) + .foregroundColor(textColor) - Text(entry.forDate, format: .dateTime.month(.wide).day().year()) - .font(.subheadline) - .foregroundStyle(.secondary) + Text(entry.forDate, format: .dateTime.month(.wide).day().year()) + .font(.subheadline) + .foregroundStyle(.secondary) + } + + Spacer() + + // Weather if available + if let weatherJSON = entry.weatherJSON, + let weather = WeatherData.decode(from: weatherJSON) { + HStack(spacing: 8) { + Image(systemName: weather.conditionSymbol) + .font(.title) + .foregroundStyle(.secondary) + VStack(alignment: .leading, spacing: 2) { + Text(weather.condition) + .font(.subheadline) + .foregroundStyle(.secondary) + Text("H: \(Int(round(weather.highTemperature)))° L: \(Int(round(weather.lowTemperature)))°") + .font(.caption) + .foregroundStyle(.tertiary) + } + } + } } - .frame(maxWidth: .infinity) - .padding(.vertical, 20) + .padding(.horizontal, 20) + .padding(.vertical, 16) .background( RoundedRectangle(cornerRadius: 16) .fill(Color(.systemBackground)) @@ -494,16 +510,6 @@ struct EntryDetailView: View { } } - private func weatherSection(_ weatherData: WeatherData) -> some View { - VStack(alignment: .leading, spacing: 12) { - Text("Weather") - .font(.headline) - .foregroundColor(textColor) - - WeatherCardView(weatherData: weatherData) - } - } - private var photoSection: some View { VStack(alignment: .leading, spacing: 12) { HStack {