Skip to content

Commit 87ac947

Browse files
committed
nested routes
1 parent ff20ba9 commit 87ac947

File tree

8 files changed

+280
-280
lines changed

8 files changed

+280
-280
lines changed

samples/auth-swiftui/AuthSwiftUIExample/Views/Email/EmailAuthView.swift

Lines changed: 0 additions & 104 deletions
This file was deleted.

samples/auth-swiftui/AuthSwiftUIExample/Views/Email/EmailResetPasswordView.swift

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,6 @@ struct EmailResetPasswordView: View {
6767
}
6868
}
6969
}
70-
71-
Button {
72-
state.onGoToSignIn()
73-
} label: {
74-
Text("Back to Sign In")
75-
.frame(maxWidth: .infinity)
76-
}
77-
.disabled(state.isLoading)
7870
}
7971
.navigationTitle("Reset Password")
8072
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
@@ -83,9 +75,22 @@ struct EmailResetPasswordView: View {
8375

8476
#Preview {
8577
NavigationStack {
86-
EmailAuthView { state in
87-
EmailResetPasswordView(state: state)
88-
}
78+
EmailResetPasswordView(state: EmailAuthContentState(
79+
isLoading: false,
80+
error: nil,
81+
email: .constant(""),
82+
password: .constant(""),
83+
confirmPassword: .constant(""),
84+
displayName: .constant(""),
85+
resetLinkSent: false,
86+
onSignInClick: {},
87+
onSignUpClick: {},
88+
onSendResetLinkClick: {},
89+
onGoToSignUp: {},
90+
onGoToSignIn: {},
91+
onGoToResetPassword: {},
92+
navigator: Navigator()
93+
))
8994
.safeAreaPadding()
9095
}
9196
}

samples/auth-swiftui/AuthSwiftUIExample/Views/Email/EmailSignInView.swift

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,22 @@ struct EmailSignInView: View {
7575

7676
#Preview {
7777
NavigationStack {
78-
EmailAuthView { state in
79-
EmailSignInView(state: state)
80-
}
78+
EmailSignInView(state: EmailAuthContentState(
79+
isLoading: false,
80+
error: nil,
81+
email: .constant(""),
82+
password: .constant(""),
83+
confirmPassword: .constant(""),
84+
displayName: .constant(""),
85+
resetLinkSent: false,
86+
onSignInClick: {},
87+
onSignUpClick: {},
88+
onSendResetLinkClick: {},
89+
onGoToSignUp: {},
90+
onGoToSignIn: {},
91+
onGoToResetPassword: {},
92+
navigator: Navigator()
93+
))
8194
.safeAreaPadding()
8295
}
8396
}

samples/auth-swiftui/AuthSwiftUIExample/Views/Email/EmailSignUpView.swift

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,6 @@ struct EmailSignUpView: View {
6868
.font(.caption)
6969
}
7070
}
71-
72-
Button {
73-
state.onGoToSignIn()
74-
} label: {
75-
Text("Already have an account? Sign In")
76-
.frame(maxWidth: .infinity)
77-
}
78-
.disabled(state.isLoading)
7971
}
8072
.navigationTitle("Create an account")
8173
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
@@ -84,9 +76,22 @@ struct EmailSignUpView: View {
8476

8577
#Preview {
8678
NavigationStack {
87-
EmailAuthView { state in
88-
EmailSignUpView(state: state)
89-
}
79+
EmailSignUpView(state: EmailAuthContentState(
80+
isLoading: false,
81+
error: nil,
82+
email: .constant(""),
83+
password: .constant(""),
84+
confirmPassword: .constant(""),
85+
displayName: .constant(""),
86+
resetLinkSent: false,
87+
onSignInClick: {},
88+
onSignUpClick: {},
89+
onSendResetLinkClick: {},
90+
onGoToSignUp: {},
91+
onGoToSignIn: {},
92+
onGoToResetPassword: {},
93+
navigator: Navigator()
94+
))
9095
.safeAreaPadding()
9196
}
9297
}

0 commit comments

Comments
 (0)