add view in settings that shows current i cloud status
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
import CloudKitSyncMonitor
|
||||||
|
|
||||||
struct SettingsView: View {
|
struct SettingsView: View {
|
||||||
@Environment(\.dismiss) var dismiss
|
@Environment(\.dismiss) var dismiss
|
||||||
@@ -17,6 +18,7 @@ struct SettingsView: View {
|
|||||||
|
|
||||||
@State private var showSpecialThanks = false
|
@State private var showSpecialThanks = false
|
||||||
@State private var showWhyBGMode = false
|
@State private var showWhyBGMode = false
|
||||||
|
@ObservedObject var syncMonitor = SyncMonitor.shared
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
@@ -31,6 +33,7 @@ struct SettingsView: View {
|
|||||||
showOnboardingButton
|
showOnboardingButton
|
||||||
whyBackgroundMode
|
whyBackgroundMode
|
||||||
specialThanksCell
|
specialThanksCell
|
||||||
|
cloudKitStatus
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
.padding()
|
.padding()
|
||||||
@@ -188,6 +191,20 @@ struct SettingsView: View {
|
|||||||
.fixedSize(horizontal: false, vertical: true)
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))
|
.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 {
|
struct SettingsView_Previews: PreviewProvider {
|
||||||
|
|||||||
Reference in New Issue
Block a user