@@ -36,44 +36,46 @@ struct RegistrationView: View {
36
36
37
37
var body : some View {
38
38
NavigationView {
39
- Form {
40
- // User name input section
41
- Section ( header: Text ( " Name " ) ) {
42
- TextField ( " First Name " , text: $firstName)
43
- . disableAutocorrection ( true )
44
- TextField ( " Last Name " , text: $lastName)
45
- . disableAutocorrection ( true )
46
- }
47
-
48
- // User credentials input section
49
- Section ( header: Text ( " Credentials " ) ) {
50
- TextField ( " Username " , text: $userName)
51
- . disableAutocorrection ( true )
52
- TextField ( " Email " , text: $email)
53
- . keyboardType ( . emailAddress)
54
- . disableAutocorrection ( true )
55
- SecureField ( " Password " , text: $password)
56
- . disableAutocorrection ( true )
57
- SecureField ( " Confirm Password " , text: $confirmPassword)
58
- . disableAutocorrection ( true )
59
- }
60
-
61
- // Submit button and navigation to login view
62
- Section {
63
- Button ( action: registerUser) {
64
- Text ( " Submit " )
39
+ VStack {
40
+ Form {
41
+ // User name input section
42
+ Section ( header: Text ( " Name " ) ) {
43
+ TextField ( " First Name " , text: $firstName)
44
+ . disableAutocorrection ( true )
45
+ TextField ( " Last Name " , text: $lastName)
46
+ . disableAutocorrection ( true )
47
+ }
48
+
49
+ // User credentials input section
50
+ Section ( header: Text ( " Credentials " ) ) {
51
+ TextField ( " Username " , text: $userName)
52
+ . disableAutocorrection ( true )
53
+ TextField ( " Email " , text: $email)
54
+ . keyboardType ( . emailAddress)
55
+ . disableAutocorrection ( true )
56
+ SecureField ( " Password " , text: $password)
57
+ . disableAutocorrection ( true )
58
+ SecureField ( " Confirm Password " , text: $confirmPassword)
59
+ . disableAutocorrection ( true )
65
60
}
66
-
67
- NavigationLink ( destination: LoginView ( isAuthenticated: $isAuthenticated) ) {
68
- Text ( " Already have an account? Login " )
61
+
62
+ // Submit button and navigation to login view
63
+ Section {
64
+ Button ( action: registerUser) {
65
+ Text ( " Submit " )
66
+ }
67
+
68
+ NavigationLink ( destination: LoginView ( isAuthenticated: $isAuthenticated) ) {
69
+ Text ( " Already have an account? Login " )
70
+ }
69
71
}
70
72
}
73
+ //.navigationBarTitle("Registration")
74
+ . alert ( isPresented: $showingAlert) {
75
+ Alert ( title: Text ( " Registration Status " ) , message: Text ( alertMessage) , dismissButton: . default( Text ( " OK " ) ) )
76
+ }
71
77
}
72
- . navigationBarTitle ( " Registration " )
73
- . alert ( isPresented: $showingAlert) {
74
- Alert ( title: Text ( " Registration Status " ) , message: Text ( alertMessage) , dismissButton: . default( Text ( " OK " ) ) )
75
- }
76
- }
78
+ } . navigationBarBackButtonHidden ( true )
77
79
}
78
80
79
81
/// Function to handle user registration
0 commit comments