From 36879b63267a8be5192f2343dbc613ea0b66358b Mon Sep 17 00:00:00 2001 From: Pritimay Sarkar Date: Sun, 10 Sep 2023 09:50:35 +0530 Subject: [PATCH] registration name --- src/components/Registration.css | 7 +++++++ src/components/Registration.js | 13 +++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) 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