@@ -2,10 +2,12 @@ import Form from 'react-bootstrap/Form';
2
2
import Button from 'react-bootstrap/esm/Button' ;
3
3
import { useState } from 'react' ;
4
4
import LogoutNavBar from '../navbar/logoutnavbar' ;
5
+ import PlacesAutocomplete from '../locationpicker/auto' ;
5
6
6
7
export default function Registration ( props ) {
7
8
const [ status , setStatus ] = useState ( false ) ;
8
9
const [ otherStatus , setOtherStatus ] = useState ( false ) ;
10
+ const [ otherDisableStatus , setOtherDisableStatus ] = useState ( false ) ;
9
11
const [ validated , setValidated ] = useState ( false ) ;
10
12
const name = localStorage . getItem ( "userName" ) ;
11
13
@@ -44,44 +46,7 @@ export default function Registration(props) {
44
46
< div className = "row g-3" >
45
47
< div className = "col-12" >
46
48
< label className = "form-label mr-auto" htmlFor = "address" > Address</ label >
47
- < div className = "input-group mb-3" >
48
- < input type = "text" className = "form-control" id = "address" placeholder = "Get current location address" aria-label = "Address" aria-describedby = "Address" />
49
- < span className = "input-group-text" >
50
- < svg width = "1em" height = "1em" >
51
- < use xlinkHref = "#geo" > </ use >
52
- </ svg >
53
- </ span >
54
- </ div >
55
- < div className = "invalid-feedback" >
56
- Please enter your address.
57
- </ div >
58
- </ div >
59
- < div className = "col-md-5" >
60
- < label htmlFor = "country" className = "form-label" > Country</ label >
61
- < select className = "form-select" id = "country" required = "" >
62
- < option value = "" > Choose...</ option >
63
- < option > United States</ option >
64
- </ select >
65
- < div className = "invalid-feedback" >
66
- Please select a valid country.
67
- </ div >
68
- </ div >
69
- < div className = "col-md-4" >
70
- < label htmlFor = "state" className = "form-label" > State</ label >
71
- < select className = "form-select" id = "state" required = "" >
72
- < option value = "" > Choose...</ option >
73
- < option > California</ option >
74
- </ select >
75
- < div className = "invalid-feedback" >
76
- Please provide a valid state.
77
- </ div >
78
- </ div >
79
- < div className = "col-md-3" >
80
- < label htmlFor = "zip" className = "form-label" > Zip</ label >
81
- < input type = "text" className = "form-control" id = "zip" placeholder = "" required = "" />
82
- < div className = "invalid-feedback" >
83
- Zip code required.
84
- </ div >
49
+ < PlacesAutocomplete > </ PlacesAutocomplete >
85
50
</ div >
86
51
< div className = "col-md-5" >
87
52
< label htmlFor = "dob" className = "form-label" > Date of Birth</ label >
@@ -127,16 +92,19 @@ export default function Registration(props) {
127
92
< label className = "form-check-label" htmlFor = "neuroDiversity" > Neuro Diversity</ label >
128
93
</ div >
129
94
< div className = "form-check-inline" >
130
- < input id = "others" type = "checkbox" className = "form-check-input me-2" />
95
+ < input id = "others" type = "checkbox" className = "form-check-input me-2" onChange = { ( ) => { setOtherDisableStatus ( ! otherDisableStatus ) ; } } />
131
96
< label className = "form-check-label" htmlFor = "others" > Others</ label >
132
97
</ div >
133
98
</ div >
134
- < div className = "col-md-12 mb-4" >
135
- < input type = "text" className = "form-control" placeholder = "Show this input when Others is checked" required = "" />
136
- < div className = "invalid-feedback" >
137
- Other required
99
+
100
+ { otherDisableStatus &&
101
+ < div className = "col-md-12 mb-4" >
102
+ < input type = "text" className = "form-control" placeholder = "Please provide the details" required = "" />
103
+ < div className = "invalid-feedback" >
104
+ Other required
105
+ </ div >
138
106
</ div >
139
- </ div >
107
+ }
140
108
< label className = "form-label mt-4 mb-0 col-12 fw-bold" > Emergency Contact</ label >
141
109
< div className = "col-md-5" >
142
110
< label htmlFor = "a-name" className = "form-label" > Full Name < span className = "text-muted" > (Optional)</ span > </ label >
@@ -161,7 +129,6 @@ export default function Registration(props) {
161
129
id = "custom-switch"
162
130
label = "Do you wish to Volunteer"
163
131
onChange = { ( ) => { setStatus ( ! status ) ; } }
164
- //onChange={(e) => radioHandler(status)}
165
132
/>
166
133
</ div >
167
134
{
0 commit comments