From cde2485a60b62967310bbace0187c0fc0590c867 Mon Sep 17 00:00:00 2001 From: Pritimay Sarkar Date: Mon, 28 Aug 2023 18:23:39 +0530 Subject: [PATCH] show user id after user registration --- src/components/Registration.css | 9 +++++++++ src/components/Registration.js | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/Registration.css b/src/components/Registration.css index e69de29..cda4e0f 100644 --- a/src/components/Registration.css +++ b/src/components/Registration.css @@ -0,0 +1,9 @@ +.message { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + width: 80vw; + height: 50px; + background-color: rgb(187, 218, 174); +} \ No newline at end of file diff --git a/src/components/Registration.js b/src/components/Registration.js index 040cbce..36ea229 100644 --- a/src/components/Registration.js +++ b/src/components/Registration.js @@ -2,13 +2,15 @@ import React, { useState } from 'react'; import moment from 'moment'; import axios from 'axios'; -import './ExportData.css'; +import './Registration.css'; function Registration() { const [userId, setUserId] = useState("2808202300103ROOBHO"); const [counter, setCounter] = useState(0); + const [message, setMessage] = useState(""); const createUser = () => { + setMessage(""); const id = moment().unix() + counter + "ROOBHO"; setCounter(counter + 1); axios({ @@ -49,7 +51,7 @@ function Registration() { }) .then(response => response.data) .then((data) => { - console.log(data); + setMessage(`${id} is being created`); }); } @@ -58,6 +60,7 @@ function Registration() {
createUser()}>Create User
+
{message &&
{message}
}
); }