add view in settings that shows current i cloud status

This commit is contained in:
Trey t
2022-01-24 10:35:26 -06:00
parent 24be0073ae
commit 389a7f7751

View File

@@ -6,6 +6,7 @@
//
import SwiftUI
import CloudKitSyncMonitor
struct SettingsView: View {
@Environment(\.dismiss) var dismiss
@@ -17,6 +18,7 @@ struct SettingsView: View {
@State private var showSpecialThanks = false
@State private var showWhyBGMode = false
@ObservedObject var syncMonitor = SyncMonitor.shared
var body: some View {
ZStack {
@@ -31,6 +33,7 @@ struct SettingsView: View {
showOnboardingButton
whyBackgroundMode
specialThanksCell
cloudKitStatus
Spacer()
}
.padding()
@@ -188,6 +191,20 @@ struct SettingsView: View {
.fixedSize(horizontal: false, vertical: true)
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))
}
private var cloudKitStatus: some View {
ZStack {
Color(UIColor.systemBackground)
VStack {
Image(systemName: syncMonitor.syncStateSummary.symbolName)
.foregroundColor(syncMonitor.syncStateSummary.symbolColor)
Text( syncMonitor.syncStateSummary.isBroken ? "cloudkit is broken" : "cloudkit is good")
}
.padding()
}
.fixedSize(horizontal: false, vertical: true)
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))
}
}
struct SettingsView_Previews: PreviewProvider {