- ToggleRow: fix cramped layout — proper horizontal + vertical card padding - ConnectionStore: add allowCellularBackup, useTailscaleWhenRemote, tailscaleHost - LANMonitor: add isOnCellular (NWPath cellular interface), isTailscaleActive (detects utun interface with 100.x.x.x CGNAT address), openTailscaleApp() - BackupEngine: gate backup on cellular setting; resolveHost() switches to tailscaleHost when not on trusted LAN and Tailscale tunnel is active - SettingsView: CONNECTIVITY section (cellular toggle + live status), REMOTE ACCESS section (Tailscale toggle, host field, status dot, Open button) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
37 lines
1001 B
Swift
37 lines
1001 B
Swift
import SwiftUI
|
|
|
|
struct ToggleRow: View {
|
|
let icon: String
|
|
let title: String
|
|
var subtitle: String? = nil
|
|
@Binding var isOn: Bool
|
|
|
|
var body: some View {
|
|
HStack(spacing: 12) {
|
|
Image(systemName: icon)
|
|
.font(.system(size: 14, weight: .medium))
|
|
.foregroundStyle(AppTheme.inkSecondary)
|
|
.frame(width: 20)
|
|
|
|
VStack(alignment: .leading, spacing: 1) {
|
|
Text(title)
|
|
.font(AppTheme.body())
|
|
.foregroundStyle(AppTheme.ink)
|
|
if let subtitle {
|
|
Text(subtitle)
|
|
.font(AppTheme.caption())
|
|
.foregroundStyle(AppTheme.inkTertiary)
|
|
}
|
|
}
|
|
|
|
Spacer()
|
|
|
|
Toggle("", isOn: $isOn)
|
|
.labelsHidden()
|
|
.tint(AppTheme.ink)
|
|
}
|
|
.padding(.horizontal, AppTheme.cardPad)
|
|
.padding(.vertical, 12)
|
|
}
|
|
}
|