Skip to content

Commit 794b289

Browse files
author
Sanajt Jana
committed
first init
1 parent 8c75ce7 commit 794b289

File tree

4 files changed

+47
-25
lines changed

4 files changed

+47
-25
lines changed

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"@testing-library/jest-dom": "^5.14.1",
77
"@testing-library/react": "^11.2.7",
88
"@testing-library/user-event": "^12.8.3",
9+
"bootstrap": "^5.0.1",
910
"react": "^17.0.2",
1011
"react-dom": "^17.0.2",
1112
"react-scripts": "4.0.3",

src/App.js

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,40 @@
1-
import logo from './logo.svg';
2-
import './App.css';
1+
import { useState, React } from "react";
2+
3+
const App = () => {
4+
const [Text, setText] = useState("");
5+
const [FullName, setFullName] = useState("");
6+
7+
const textEvent = (fieldValue) => {
8+
setText(fieldValue.target.value);
9+
};
10+
11+
const onSubmit = () => {
12+
setFullName(Text);
13+
};
314

4-
function App() {
515
return (
6-
<div className="App">
7-
<header className="App-header">
8-
<img src={logo} className="App-logo" alt="logo" />
9-
<p>
10-
Edit <code>src/App.js</code> and save to reload.
11-
</p>
12-
<a
13-
className="App-link"
14-
href="https://reactjs.org"
15-
target="_blank"
16-
rel="noopener noreferrer"
16+
<>
17+
<div className="container text-center pt-5">
18+
<h1>Hi, {FullName}</h1>
19+
<div className="pt-3 pb-3">
20+
<input
21+
type="text"
22+
placeholder="Enter your name"
23+
onChange={textEvent}
24+
value={Text}
25+
/>
26+
</div>
27+
<button
28+
type="button"
29+
value=""
30+
className="btn btn-primary"
31+
onClick={onSubmit}
1732
>
18-
Learn React
19-
</a>
20-
</header>
21-
</div>
33+
Click Me
34+
</button>
35+
</div>
36+
</>
2237
);
23-
}
38+
};
2439

2540
export default App;

src/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import React from 'react';
2-
import ReactDOM from 'react-dom';
3-
import './index.css';
4-
import App from './App';
5-
import reportWebVitals from './reportWebVitals';
1+
import React from "react";
2+
import ReactDOM from "react-dom";
3+
import "./index.css";
4+
import App from "./App";
5+
import reportWebVitals from "./reportWebVitals";
6+
import "bootstrap/dist/css/bootstrap.min.css";
67

78
ReactDOM.render(
89
<React.StrictMode>
910
<App />
1011
</React.StrictMode>,
11-
document.getElementById('root')
12+
document.getElementById("root")
1213
);
1314

1415
// If you want to start measuring performance in your app, pass a function

0 commit comments

Comments
 (0)