fix: pin Connect button to bottom, dynamic protocol badge
- safeAreaInset pins Connect/Continue button to screen bottom, eliminating dead space below the form - UGreenCompatibilityBadge now takes selectedProtocol param: green dot + green SMB label when SMB selected, grey dot + grey SFTP label when SFTP selected Co-Authored-By: Kutesir <kutesir@provoc.ug> Co-Authored-By: Sentry <sentry@provoc.ug>
This commit is contained in:
@@ -35,8 +35,8 @@ struct ConnectView: View {
|
||||
}
|
||||
.shadow(color: AppTheme.ink.opacity(0.18), radius: 12, x: 0, y: 4)
|
||||
|
||||
// UGreen NAS compatibility badge
|
||||
UGreenCompatibilityBadge()
|
||||
// UGreen NAS compatibility badge — reacts to selected protocol
|
||||
UGreenCompatibilityBadge(selectedProtocol: vm.selectedProtocol)
|
||||
}
|
||||
.padding(.bottom, 24)
|
||||
.padding(.horizontal, AppTheme.hPad)
|
||||
@@ -236,7 +236,10 @@ struct ConnectView: View {
|
||||
.animation(.spring(response: 0.3, dampingFraction: 0.8), value: vm.isConnected)
|
||||
.padding(.bottom, 16)
|
||||
|
||||
// Connect / Continue button
|
||||
}
|
||||
}
|
||||
.safeAreaInset(edge: .bottom) {
|
||||
VStack(spacing: 0) {
|
||||
Button(action: {
|
||||
if vm.isConnected { navigateToDashboard = true }
|
||||
else { Task { await vm.verify() } }
|
||||
@@ -253,11 +256,12 @@ struct ConnectView: View {
|
||||
color: vm.isConnected ? AppTheme.positive : AppTheme.ink
|
||||
))
|
||||
.padding(.horizontal, AppTheme.hPad)
|
||||
.padding(.top, 12)
|
||||
.padding(.bottom, 32)
|
||||
.disabled(!vm.canConnect)
|
||||
.animation(.spring(response: 0.3, dampingFraction: 0.8), value: vm.isConnected)
|
||||
|
||||
Spacer().frame(height: 48)
|
||||
}
|
||||
.background(AppTheme.background)
|
||||
}
|
||||
}
|
||||
.navigationBarHidden(true)
|
||||
|
||||
Reference in New Issue
Block a user