diff --git a/ios/Tinkcil/ContentView.swift b/ios/Tinkcil/ContentView.swift index e3d3871..4abd353 100644 --- a/ios/Tinkcil/ContentView.swift +++ b/ios/Tinkcil/ContentView.swift @@ -215,7 +215,7 @@ struct ContentView: View { .foregroundStyle(.secondary) .lineLimit(1) } - } else { + } else if bleManager.discoveredDevices.isEmpty { HStack(spacing: 6) { Image(systemName: "antenna.radiowaves.left.and.right.slash") .font(.caption) @@ -225,6 +225,19 @@ struct ContentView: View { .foregroundStyle(.secondary) .lineLimit(1) } + } else { + HStack(spacing: 6) { + Image(systemName: "antenna.radiowaves.left.and.right") + .font(.caption) + .foregroundStyle(.secondary) + Text(bleManager.discoveredDevices.count == 1 + ? (bleManager.discoveredDevices[0].name ?? String(localized: "common_unknown")) + : "\(bleManager.discoveredDevices.count) devices found") + .font(.subheadline) + .foregroundStyle(.secondary) + .lineLimit(1) + .truncationMode(.tail) + } } } @@ -329,9 +342,10 @@ struct ContentView: View { Text(String(localized: "connection_scan_again")) } .font(.subheadline.weight(.medium)) + .foregroundStyle(.secondary) .frame(maxWidth: .infinity) .padding(.vertical, 10) - .background(Color.accentColor.opacity(0.1), in: RoundedRectangle(cornerRadius: 10)) + .background(Color.secondary.opacity(0.08), in: RoundedRectangle(cornerRadius: 10)) } .buttonStyle(.plain) } @@ -373,19 +387,25 @@ struct ContentView: View { Text(String(localized: "connection_scan_again")) } .font(.subheadline.weight(.medium)) + .foregroundStyle(.secondary) .frame(maxWidth: .infinity) .padding(.vertical, 10) - .background(Color.accentColor.opacity(0.1), in: RoundedRectangle(cornerRadius: 10)) + .background(Color.secondary.opacity(0.08), in: RoundedRectangle(cornerRadius: 10)) } .buttonStyle(.plain) } if bleManager.discoveredDevices.isEmpty && !bleManager.wasIntentionalDisconnect { - Button("Try Demo") { + Button { Haptics.light() bleManager.startDemoMode() + } label: { + Text("Try Demo") + .font(.subheadline) + .foregroundStyle(.secondary) + .frame(maxWidth: .infinity) + .padding(.vertical, 10) + .background(Color.secondary.opacity(0.05), in: RoundedRectangle(cornerRadius: 10)) } - .font(.subheadline) - .foregroundStyle(.secondary) .buttonStyle(.plain) } }