iOS 2.4.0 - Colour accents and theming
This commit is contained in:
@@ -2,6 +2,7 @@ import SwiftUI
|
||||
|
||||
struct CalendarView: View {
|
||||
@EnvironmentObject var dataManager: ClimbingDataManager
|
||||
@EnvironmentObject var themeManager: ThemeManager
|
||||
let sessions: [ClimbSession]
|
||||
@Binding var selectedMonth: Date
|
||||
@Binding var selectedDate: Date?
|
||||
@@ -68,7 +69,7 @@ struct CalendarView: View {
|
||||
Image(systemName: "chevron.left")
|
||||
.font(.title2)
|
||||
.fontWeight(.semibold)
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
}
|
||||
.frame(width: 44, height: 44)
|
||||
|
||||
@@ -84,7 +85,7 @@ struct CalendarView: View {
|
||||
Image(systemName: "chevron.right")
|
||||
.font(.title2)
|
||||
.fontWeight(.semibold)
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
}
|
||||
.frame(width: 44, height: 44)
|
||||
}
|
||||
@@ -97,10 +98,10 @@ struct CalendarView: View {
|
||||
Text("Today")
|
||||
.font(.subheadline)
|
||||
.fontWeight(.semibold)
|
||||
.foregroundColor(.white)
|
||||
.foregroundColor(themeManager.contrastingTextColor)
|
||||
.padding(.horizontal, 20)
|
||||
.padding(.vertical, 8)
|
||||
.background(Color.blue)
|
||||
.background(themeManager.accentColor)
|
||||
.clipShape(Capsule())
|
||||
}
|
||||
}
|
||||
@@ -209,6 +210,7 @@ struct CalendarDayCell: View {
|
||||
let isToday: Bool
|
||||
let isInCurrentMonth: Bool
|
||||
let onTap: () -> Void
|
||||
@EnvironmentObject var themeManager: ThemeManager
|
||||
|
||||
var dayNumber: String {
|
||||
let formatter = DateFormatter()
|
||||
@@ -224,9 +226,9 @@ struct CalendarDayCell: View {
|
||||
.fontWeight(sessions.isEmpty ? .regular : .medium)
|
||||
.foregroundColor(
|
||||
isSelected
|
||||
? .white
|
||||
? themeManager.contrastingTextColor
|
||||
: isToday
|
||||
? .blue
|
||||
? themeManager.accentColor
|
||||
: !isInCurrentMonth
|
||||
? .secondary.opacity(0.3)
|
||||
: sessions.isEmpty ? .secondary : .primary
|
||||
@@ -234,7 +236,7 @@ struct CalendarDayCell: View {
|
||||
|
||||
if !sessions.isEmpty {
|
||||
Circle()
|
||||
.fill(isSelected ? .white : .blue)
|
||||
.fill(isSelected ? themeManager.contrastingTextColor : themeManager.accentColor)
|
||||
.frame(width: 4, height: 4)
|
||||
} else {
|
||||
Spacer()
|
||||
@@ -247,13 +249,13 @@ struct CalendarDayCell: View {
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 6)
|
||||
.fill(
|
||||
isSelected ? Color.blue : isToday ? Color.blue.opacity(0.1) : Color.clear
|
||||
isSelected ? themeManager.accentColor : isToday ? themeManager.accentColor.opacity(0.1) : Color.clear
|
||||
)
|
||||
)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 6)
|
||||
.stroke(
|
||||
isToday && !isSelected ? Color.blue.opacity(0.3) : Color.clear, lineWidth: 1
|
||||
isToday && !isSelected ? themeManager.accentColor.opacity(0.3) : Color.clear, lineWidth: 1
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user