Complete rename across all bundle IDs, App Groups, CloudKit containers, StoreKit product IDs, data store filenames, URL schemes, logger subsystems, Swift identifiers, user-facing strings (7 languages), file names, directory names, Xcode project, schemes, assets, and documentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
57 lines
1.8 KiB
Swift
57 lines
1.8 KiB
Swift
//
|
|
// EmptyView.swift
|
|
// Reflect (iOS)
|
|
//
|
|
// Created by Trey Tartt on 2/10/22.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct EmptyHomeView: View {
|
|
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
|
|
|
private var textColor: Color { theme.currentTheme.labelColor }
|
|
|
|
let showVote: Bool
|
|
let viewModel: DayViewViewModel?
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
theme.currentTheme.secondaryBGColor
|
|
|
|
VStack {
|
|
if showVote {
|
|
AddMoodHeaderView(addItemHeaderClosure: { (mood, date) in
|
|
withAnimation {
|
|
viewModel?.add(mood: mood, forDate: date, entryType: .header)
|
|
}
|
|
})
|
|
} else {
|
|
VStack {
|
|
Spacer()
|
|
Text(String(localized: "view_no_data"))
|
|
.font(.title)
|
|
.padding()
|
|
.fixedSize(horizontal: false, vertical: true)
|
|
.foregroundColor(textColor)
|
|
.accessibilityIdentifier(AccessibilityID.DayView.emptyStateNoData)
|
|
Spacer()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.fixedSize(horizontal: false, vertical: true)
|
|
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
|
|
}
|
|
}
|
|
|
|
struct EmptyHomeView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
Group {
|
|
EmptyHomeView(showVote: true, viewModel: DayViewViewModel(addMonthStartWeekdayPadding: false))
|
|
|
|
EmptyHomeView(showVote: false, viewModel: nil)
|
|
}
|
|
}
|
|
}
|