Skip to content

Commit 4f6e0f3

Browse files
fix: MFA management View UI fix
1 parent c53cfcf commit 4f6e0f3

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/MFAManagementView.swift

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// limitations under the License.
1414

1515
import FirebaseAuth
16+
import FirebaseCore
1617
import SwiftUI
1718

1819
extension MultiFactorInfo: Identifiable {
@@ -96,10 +97,16 @@ extension MFAManagementView: View {
9697
.multilineTextAlignment(.center)
9798
.padding(.horizontal)
9899

99-
Button("Set Up Two-Factor Authentication") {
100+
Button {
100101
navigateToEnrollment()
102+
} label: {
103+
Text("Set Up Two-Factor Authentication")
104+
.padding(.vertical, 8)
105+
.frame(maxWidth: .infinity)
101106
}
102107
.buttonStyle(.borderedProminent)
108+
.padding([.top, .bottom], 8)
109+
.frame(maxWidth: .infinity)
103110
.accessibilityIdentifier("setup-mfa-button")
104111
}
105112
} else {
@@ -119,14 +126,17 @@ extension MFAManagementView: View {
119126
Button("Add Another Method") {
120127
navigateToEnrollment()
121128
}
122-
.buttonStyle(.bordered)
123-
.padding(.horizontal)
129+
.padding([.top, .bottom], 8)
130+
.frame(maxWidth: .infinity)
131+
.buttonStyle(.borderedProminent)
124132
.accessibilityIdentifier("add-mfa-method-button")
125133
}
126134
}
127135

128136
Spacer()
129137
}
138+
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
139+
.safeAreaPadding()
130140
.onAppear {
131141
loadEnrolledFactors()
132142
}
@@ -199,6 +209,9 @@ private extension DateFormatter {
199209
}
200210

201211
#Preview {
202-
MFAManagementView()
203-
.environment(AuthService())
212+
FirebaseOptions.dummyConfigurationForPreview()
213+
return NavigationStack {
214+
MFAManagementView()
215+
.environment(AuthService())
216+
}
204217
}

0 commit comments

Comments
 (0)