fix: issue #148 - for onboarding first ask to rate today / tomorrow then the next screen shoudl be time. if the user select today make the default time 9pm, if hte user selects tomorrow default time is 9am
Automated fix by Tony CI v3. Refs #148 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -65,7 +65,10 @@ struct OnboardingDay: View {
|
||||
example: "e.g. Tue reminder → Rate Tue",
|
||||
icon: "sun.max.fill",
|
||||
isSelected: onboardingData.inputDay == .Today,
|
||||
action: { onboardingData.inputDay = .Today },
|
||||
action: {
|
||||
onboardingData.inputDay = .Today
|
||||
onboardingData.date = defaultTime(hour: 21)
|
||||
},
|
||||
testID: AccessibilityID.Onboarding.dayToday
|
||||
)
|
||||
|
||||
@@ -75,7 +78,10 @@ struct OnboardingDay: View {
|
||||
example: "e.g. Tue reminder → Rate Mon",
|
||||
icon: "moon.fill",
|
||||
isSelected: onboardingData.inputDay == .Previous,
|
||||
action: { onboardingData.inputDay = .Previous },
|
||||
action: {
|
||||
onboardingData.inputDay = .Previous
|
||||
onboardingData.date = defaultTime(hour: 9)
|
||||
},
|
||||
testID: AccessibilityID.Onboarding.dayYesterday
|
||||
)
|
||||
}
|
||||
@@ -107,6 +113,13 @@ struct OnboardingDay: View {
|
||||
)
|
||||
.accessibilityIdentifier(AccessibilityID.Onboarding.dayScreen)
|
||||
}
|
||||
|
||||
private func defaultTime(hour: Int) -> Date {
|
||||
var components = Calendar.current.dateComponents([.year, .month, .day], from: Date())
|
||||
components.hour = hour
|
||||
components.minute = 0
|
||||
return Calendar.current.date(from: components) ?? Date()
|
||||
}
|
||||
}
|
||||
|
||||
struct DayOptionCard: View {
|
||||
|
||||
Reference in New Issue
Block a user