Skip to content

Commit 67cb983

Browse files
Add Routes
1 parent 715f94d commit 67cb983

12 files changed

+363
-104
lines changed

package-lock.json

+68
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
"@testing-library/react": "^13.4.0",
88
"@testing-library/user-event": "^13.5.0",
99
"big.js": "^6.2.1",
10+
"bootstrap": "^5.3.0",
1011
"prop-types": "^15.8.1",
1112
"react": "^18.2.0",
1213
"react-dom": "^18.2.0",
14+
"react-router-dom": "^6.14.2",
1315
"react-scripts": "5.0.1",
1416
"uuid": "^9.0.0",
1517
"web-vitals": "^2.1.4"

public/index.html

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,26 @@
33
<head>
44
<meta charset="utf-8" />
55
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<!-- Bootstrap CSS CDN -->
7+
<link
8+
rel="stylesheet"
9+
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
10+
/>
11+
612
<meta name="viewport" content="width=device-width, initial-scale=1" />
713
<meta name="theme-color" content="#000000" />
814
<meta
915
name="description"
1016
content="Web site created using create-react-app"
1117
/>
1218
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13-
19+
1420
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
15-
21+
1622
<title>React App</title>
1723
</head>
1824
<body>
1925
<noscript>You need to enable JavaScript to run this app.</noscript>
2026
<div id="root"></div>
21-
2227
</body>
2328
</html>

src/App.css

-3
This file was deleted.

src/App.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import MyComponent from './componenet/calculator';
2-
import Quote from './componenet/fetchquotes';
1+
import AppRouter from './AppRouter';
32

43
function App() {
54
return (
65
<div className="page-con">
7-
<MyComponent />
8-
<Quote />
6+
<AppRouter />
97
</div>
108
);
119
}

src/AppRouter.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React from 'react';
2+
import {
3+
BrowserRouter as Router, Route, Link, Routes,
4+
} from 'react-router-dom';
5+
import Home from './component/Home';
6+
import Calculator from './component/calculator';
7+
import QuoteComponent from './component/fetchquotes';
8+
9+
const AppRouter = () => (
10+
<Router>
11+
<nav className="navbar">
12+
<h1>Math Magicicians</h1>
13+
<ul className="list-con ">
14+
<li className="">
15+
<Link to="/">Home</Link>
16+
</li>
17+
<li className="">
18+
<Link to="/calculator">Calculator</Link>
19+
</li>
20+
<li className="">
21+
<Link to="/quote">Quote</Link>
22+
</li>
23+
</ul>
24+
</nav>
25+
<Routes>
26+
<Route path="/" element={<Home />} />
27+
<Route path="/calculator" element={<Calculator />} />
28+
<Route path="/quote" element={<QuoteComponent />} />
29+
</Routes>
30+
</Router>
31+
);
32+
33+
export default AppRouter;

src/componenet/calculator.js

-90
This file was deleted.

src/component/Home.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from 'react';
2+
3+
const Home = () => (
4+
<>
5+
<div className="home-con">
6+
<h2>Welcome to the Home page!</h2>
7+
<p>
8+
In other words, the message is to prioritize meaningful relationships
9+
and fully invest in being an essential part of someone else life.
10+
Emphasizing the brevity of life, the phrase urges people to cherish and
11+
value deep connections with others, making a positive impact on their
12+
lives and being fully present in their journey.
13+
</p>
14+
<p>
15+
In other words, the message is to prioritize meaningful relationships
16+
and fully invest in being an essential part of someone elses life.
17+
Emphasizing the brevity of life, the phrase urges people to cherish and
18+
value deep connections with others, making a positive impact on their
19+
lives and being fully present in their journey.
20+
</p>
21+
</div>
22+
</>
23+
);
24+
25+
export default Home;

0 commit comments

Comments
 (0)