improve whats new

added a global getdevice icon thingy
This commit is contained in:
neon443
2025-05-12 21:07:51 +01:00
parent c82ce5fa17
commit c935d4b1f0
5 changed files with 43 additions and 38 deletions

View File

@@ -8,7 +8,8 @@
import SwiftUI
struct iCloudSettingsView: View {
@State var viewModel: EventViewModel
@ObservedObject var viewModel: EventViewModel
@ObservedObject var settingsModel: SettingsViewModel
@State var showPushAlert: Bool = false
@State var showPullAlert: Bool = false
@@ -18,19 +19,6 @@ struct iCloudSettingsView: View {
@Binding var localCountEqualToiCloud: Bool
@Binding var icloudCountEqualToLocal: Bool
let asi = ProcessInfo().isiOSAppOnMac
let model = UIDevice().model
var device: (sf: String, label: String) {
if asi {
return (sf: "laptopcomputer", label: "Computer")
} else if model == "iPhone" {
return (sf: model.lowercased(), label: model)
} else if model == "iPad" {
return (sf: model.lowercased(), label: model)
}
return (sf: "iphone", label: "iPhone")
}
var updateStatus: () -> Void
var body: some View {
@@ -107,7 +95,7 @@ struct iCloudSettingsView: View {
}
}
ZStack {
Image(systemName: device.sf)
Image(systemName: settingsModel.device.sf)
.resizable()
.scaledToFit()
.frame(width: 75, height: 75)
@@ -117,7 +105,7 @@ struct iCloudSettingsView: View {
.monospaced()
.bold()
}
Text(device.label)
Text(settingsModel.device.label)
}
Spacer()
}
@@ -196,6 +184,7 @@ struct iCloudSettingsView: View {
#Preview("iCloudSettingsView") {
iCloudSettingsView(
viewModel: dummyEventViewModel(),
settingsModel: dummySettingsViewModel(),
hasUbiquitous: .constant(true),
lastSyncWasSuccessful: .constant(true),
lastSyncWasNormalAgo: .constant(true),