Skip to content

Commit 8b28db3

Browse files
committed
Deleting app.css and emoji. Creating new files Header,Footer,Food
1 parent b43162c commit 8b28db3

File tree

8 files changed

+67
-151
lines changed

8 files changed

+67
-151
lines changed

React_Learning/01_basics/src/App.css

Lines changed: 0 additions & 42 deletions
This file was deleted.

React_Learning/01_basics/src/App.jsx

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,14 @@
1-
import { useState } from 'react'
2-
import reactLogo from './assets/react.svg'
3-
import viteLogo from '/vite.svg'
4-
import './App.css'
5-
1+
import Header from './Header';
2+
import Footer from './Footer';
3+
import Food from './Food';
64
function App() {
7-
const [count, setCount] = useState(0)
8-
9-
return (
10-
<>
11-
<div>
12-
<a href="https://vitejs.dev" target="_blank">
13-
<img src={viteLogo} className="logo" alt="Vite logo" />
14-
</a>
15-
<a href="https://react.dev" target="_blank">
16-
<img src={reactLogo} className="logo react" alt="React logo" />
17-
</a>
18-
</div>
19-
<h1>Vite + React</h1>
20-
<div className="card">
21-
<button onClick={() => setCount((count) => count + 1)}>
22-
count is {count}
23-
</button>
24-
<p>
25-
Edit <code>src/App.jsx</code> and save to test HMR
26-
</p>
27-
</div>
28-
<p className="read-the-docs">
29-
Click on the Vite and React logos to learn more
30-
</p>
31-
</>
32-
)
5+
return (
6+
<>
7+
<Header />
8+
<Food />
9+
<Footer />
10+
</>
11+
);
3312
}
3413

35-
export default App
14+
export default App;

React_Learning/01_basics/src/Food.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function Food() {
2+
const food1 = 'Orange';
3+
const food2 = 'Banana';
4+
return (
5+
<>
6+
<ul>
7+
<li>Apple</li>
8+
<li>{food1}</li>
9+
<li>{food2.toUpperCase()}</li>
10+
</ul>
11+
<hr />
12+
</>
13+
);
14+
}
15+
export default Food;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
function Footer() {
2+
return (
3+
<footer>
4+
<p>&copy; {new Date().getFullYear()} Your Website Name</p>
5+
</footer>
6+
);
7+
}
8+
export default Footer;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
function Header() {
2+
return (
3+
<header>
4+
<h1>My Website</h1>
5+
<nav>
6+
<ul>
7+
<li>
8+
<a href="#">Home</a>
9+
</li>
10+
<li>
11+
<a href="#">About</a>
12+
</li>
13+
<li>
14+
<a href="#">Services</a>
15+
</li>
16+
<li>
17+
<a href="#">Contact</a>
18+
</li>
19+
</ul>
20+
</nav>
21+
<hr />
22+
</header>
23+
);
24+
}
25+
26+
export default Header;

React_Learning/01_basics/src/assets/react.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

React_Learning/01_basics/src/index.css

Lines changed: 0 additions & 68 deletions
This file was deleted.

React_Learning/01_basics/src/main.jsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { StrictMode } from 'react'
2-
import { createRoot } from 'react-dom/client'
3-
import App from './App.jsx'
4-
import './index.css'
1+
import { StrictMode } from 'react';
2+
import { createRoot } from 'react-dom/client';
3+
import App from './App.jsx';
54

65
createRoot(document.getElementById('root')).render(
7-
<StrictMode>
8-
<App />
9-
</StrictMode>,
10-
)
6+
<StrictMode>
7+
<App />
8+
</StrictMode>
9+
);

0 commit comments

Comments
 (0)