- Fix LargeVotingView mood icons getting clipped at edges by using flexible HStack spacing with maxWidth: .infinity - Fix VotingView medium layout with smaller icons and even distribution - Add comprehensive #Preview macros for all widget states: - Vote widget: small/medium, voted/not voted, all mood states - Timeline widget: small/medium/large with various data states - Reduce icon sizes and padding to fit within widget bounds - Update accessibility labels and hints across views 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
101 lines
3.6 KiB
Swift
101 lines
3.6 KiB
Swift
//
|
|
// OnboardingWrapup.swift
|
|
// Feels (iOS)
|
|
//
|
|
// Created by Trey Tartt on 1/21/22.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct OnboardingWrapup: View {
|
|
@ObservedObject var onboardingData: OnboardingData
|
|
|
|
let completionClosure: ((OnboardingData) -> Void)
|
|
|
|
var formatter: DateFormatter {
|
|
let dateFormatter = DateFormatter()
|
|
dateFormatter.timeStyle = .short
|
|
return dateFormatter
|
|
}
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
GeometryReader { geometry in
|
|
VStack {
|
|
Spacer()
|
|
Image("great", bundle: .main)
|
|
.foregroundColor(Color(UIColor.darkText))
|
|
.opacity(0.04)
|
|
.scaleEffect(1.2, anchor: .trailing)
|
|
.accessibilityHidden(true)
|
|
Spacer()
|
|
}
|
|
|
|
VStack {
|
|
ScrollView {
|
|
|
|
Spacer()
|
|
|
|
Text(String(localized: "onboarding_wrap_up_1"))
|
|
.padding(.top)
|
|
.padding()
|
|
.font(.title)
|
|
.foregroundColor(Color(UIColor.white))
|
|
|
|
Text(formatter.string(from: onboardingData.date))
|
|
.font(.title)
|
|
.fontWeight(.bold)
|
|
.padding()
|
|
.foregroundColor(Color(UIColor.white))
|
|
|
|
Text(String(localized: "onboarding_wrap_up_3"))
|
|
.font(.title)
|
|
.padding()
|
|
.foregroundColor(Color(UIColor.white))
|
|
|
|
Text(onboardingData.inputDay.localizedValue)
|
|
.font(.title)
|
|
.fontWeight(.bold)
|
|
.padding()
|
|
.foregroundColor(Color(UIColor.white))
|
|
|
|
Button(action: {
|
|
EventLogger.log(event: "onboarding_complete")
|
|
EventLogger.log(event: "onboarding_complete_day_id",
|
|
withData: ["id": onboardingData.inputDay.rawValue])
|
|
completionClosure(onboardingData)
|
|
}, label: {
|
|
Text(String(localized: "onboarding_wrap_up_complete_button"))
|
|
.font(.title)
|
|
.fontWeight(.bold)
|
|
.foregroundColor(Color(hex: "31d158"))
|
|
.padding()
|
|
.background(RoundedRectangle(cornerRadius: 10).fill().foregroundColor(Color.white))
|
|
.cornerRadius(10)
|
|
})
|
|
.padding([.top], 65)
|
|
}
|
|
.multilineTextAlignment(.center)
|
|
}
|
|
.frame(maxWidth: geometry.size.width)
|
|
}
|
|
}
|
|
.background(Color(hex: "31d158"))
|
|
}
|
|
}
|
|
|
|
struct OnboardingWrapup_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
Group {
|
|
OnboardingWrapup(onboardingData: OnboardingData(), completionClosure: { _ in
|
|
|
|
})
|
|
|
|
OnboardingWrapup(onboardingData: OnboardingData(), completionClosure: { _ in
|
|
|
|
})
|
|
.preferredColorScheme(.dark)
|
|
}
|
|
}
|
|
}
|