add min size to macos email login view frame

This commit is contained in:
Satindar Dhillon 2022-10-12 13:33:59 -07:00
parent b3310c61c7
commit cd1b62b85b
3 changed files with 28 additions and 18 deletions

View file

@ -42,24 +42,34 @@ struct EmailAuthView: View {
}
}
var body: some View {
NavigationView {
ZStack {
Color.appBackground.edgesIgnoringSafeArea(.all)
primaryContent
.frame(maxWidth: 300)
#if os(iOS)
.navigationBarTitleDisplayMode(.inline)
#endif
.toolbar {
ToolbarItem(placement: .barTrailing) {
Button(
action: { presentationMode.wrappedValue.dismiss() },
label: { Image(systemName: "xmark").foregroundColor(.appGrayTextContrast) }
)
}
var innerBody: some View {
ZStack {
Color.appBackground.edgesIgnoringSafeArea(.all)
primaryContent
.frame(maxWidth: 300)
#if os(iOS)
.navigationBarTitleDisplayMode(.inline)
#endif
.toolbar {
ToolbarItem(placement: .barTrailing) {
Button(
action: { presentationMode.wrappedValue.dismiss() },
label: { Image(systemName: "xmark").foregroundColor(.appGrayTextContrast) }
)
}
}
}
}
var body: some View {
#if os(iOS)
NavigationView {
innerBody
}
#else
innerBody
.frame(minWidth: 400, minHeight: 400)
.buttonStyle(PlainButtonStyle())
#endif
}
}

View file

@ -44,7 +44,7 @@ struct EmailLoginFormView: View {
VStack(spacing: 28) {
ScrollView(showsIndicators: false) {
if horizontalSizeClass == .regular {
Spacer(minLength: 150)
Spacer(minLength: isMacApp ? 50 : 150)
}
VStack {
VStack(alignment: .leading, spacing: 6) {

View file

@ -86,7 +86,7 @@ struct EmailSignupFormView: View {
VStack(spacing: 28) {
ScrollView(showsIndicators: false) {
if horizontalSizeClass == .regular {
Spacer(minLength: 150)
Spacer(minLength: isMacApp ? 50 : 150)
}
VStack {
// Email