diff --git a/src/components/Registration.css b/src/components/Registration.css index cda4e0f..beed58f 100644 --- a/src/components/Registration.css +++ b/src/components/Registration.css @@ -6,4 +6,11 @@ width: 80vw; height: 50px; background-color: rgb(187, 218, 174); +} + +.user-creation { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; } \ No newline at end of file diff --git a/src/components/Registration.js b/src/components/Registration.js index b127362..f3efe43 100644 --- a/src/components/Registration.js +++ b/src/components/Registration.js @@ -8,6 +8,7 @@ function Registration() { const [userId, setUserId] = useState("2808202300103ROOBHO"); const [counter, setCounter] = useState(0); const [message, setMessage] = useState(""); + const [name, setName] = useState(""); const createUser = () => { setMessage(""); @@ -29,7 +30,7 @@ function Registration() { "gender": "Male", "house": "42", "maritalStatus": "Single", - "name": "Web", + "name": name ? name : "Web", "phoneNumber": "9123456789", "pinCode": "560060", "registeredBy": "admin", @@ -55,8 +56,16 @@ function Registration() { }); } + const onNameChange = (event) => { + setName(event.target.value); + } + return ( -
+
+
createUser()}>Create User