Skip to content

Commit 2884002

Browse files
author
Sanajt Jana
committed
add 3rd mobile filed
1 parent 7353a15 commit 2884002

File tree

1 file changed

+29
-10
lines changed

1 file changed

+29
-10
lines changed

src/App.js

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,44 @@ import { useState, React } from "react";
33
const App = () => {
44
//name load state
55
const [nameValue, setnameValue] = useState("");
6-
const [NameView, setNameView] = useState("");
6+
const [NameView, setNameView] = useState(""); //button click state
77

88
//email load state
99
const [EmailValue, setEmailValue] = useState("");
10-
const [EmailView, setEmailView] = useState("");
10+
const [EmailView, setEmailView] = useState(""); //button click state
1111

12-
//name event fucn
13-
const nameFucn = (nameValue) => {
14-
setnameValue(nameValue.target.value);
12+
//mobile load state
13+
const [mobileValue, setmobileValue] = useState("");
14+
const [mobileView, setmobileView] = useState(""); //button click state
15+
16+
//name show fucn
17+
const nameFucn = (nameKeyValue) => {
18+
setnameValue(nameKeyValue.target.value);
19+
};
20+
21+
//email show fucn
22+
const emailFucn = (emailKeyValue) => {
23+
setEmailValue(emailKeyValue.target.value);
1524
};
1625

17-
//email event fucn
18-
const emailFucn = (emailValue) => {
19-
setEmailValue(emailValue.target.value);
26+
//mobile show fucn
27+
const mobileFucn = (mobileKeyValue) => {
28+
setmobileValue(mobileKeyValue.target.value);
2029
};
2130

2231
//button click fucn
2332
const onSubmit = () => {
2433
setNameView(nameValue);
2534
setEmailView(EmailValue);
35+
setmobileView(mobileValue);
2636
};
2737

2838
return (
2939
<>
30-
<div className="container text-center" style={{ paddingTop: "20%" }}>
40+
<div className="container text-center" style={{ paddingTop: "15%" }}>
3141
<h1>Hi, {NameView}</h1>
32-
<h6>{EmailView}</h6>
42+
<h5>{EmailView}</h5>
43+
<h6>{mobileView}</h6>
3344
<div className="pt-3 pb-3">
3445
<input
3546
type="text"
@@ -45,6 +56,14 @@ const App = () => {
4556
onChange={emailFucn}
4657
value={EmailValue}
4758
/>
59+
<br />
60+
<br />
61+
<input
62+
type="number"
63+
placeholder="Enter mobile"
64+
onChange={mobileFucn}
65+
value={mobileValue}
66+
/>
4867
</div>
4968
<button
5069
type="button"

0 commit comments

Comments
 (0)