diff options
Diffstat (limited to 'iosApp/iosApp/Devices/DeviceRow.swift')
-rw-r--r-- | iosApp/iosApp/Devices/DeviceRow.swift | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/iosApp/iosApp/Devices/DeviceRow.swift b/iosApp/iosApp/Devices/DeviceRow.swift index 4553a4b..0439fff 100644 --- a/iosApp/iosApp/Devices/DeviceRow.swift +++ b/iosApp/iosApp/Devices/DeviceRow.swift @@ -25,6 +25,7 @@ struct DeviceRow: View { case details case reports case commands + case close } var callback: (Action) -> () var isCell: Bool = true @@ -37,6 +38,7 @@ struct DeviceRow: View { /* MARK: - Device icon */ let category = Marker.companion.categoryToMarkerType(category: unit.device.category) Image(MarkerTransformations.markerTypeToImageName(markerType: category)) + .sizeToFitSquare(sideLength: 40.0) .padding(5.0) getSharedContent() @@ -98,6 +100,16 @@ struct DeviceRow: View { /* MARK: - Device name */ Text(unit.device.name) Spacer() + + /* MARK: - Close button */ + if !isCell { + Button { + callback(.close) + } label: { + Image(systemName: "xmark") + .foregroundColor(.secondary) + } + } } .padding(.bottom, 5.0) @@ -160,9 +172,9 @@ struct DeviceRow: View { Label("details", systemImage: "info.circle") } - let reports = Button { callback(.reports) } label: { - Label("reports", systemImage: "clock") - } + //let reports = Button { callback(.reports) } label: { + // Label("reports", systemImage: "clock") + //} let commands = Button { callback(.commands) } label: { Label("commands", systemImage: "paperplane") @@ -170,12 +182,12 @@ struct DeviceRow: View { if isCell { commands - reports + // reports details } else { Group { details - reports + // reports commands } .frame(maxWidth: .infinity) |