Skip to content

Commit 0509b28

Browse files
committed
nav:bulit the responsive nav section
1 parent 6b62943 commit 0509b28

20 files changed

+349
-97
lines changed

package-lock.json

Lines changed: 98 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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6+
"@fortawesome/fontawesome-svg-core": "^6.2.0",
7+
"@fortawesome/free-regular-svg-icons": "^6.2.0",
8+
"@fortawesome/free-solid-svg-icons": "^6.2.0",
9+
"@fortawesome/react-fontawesome": "^0.2.0",
610
"@testing-library/jest-dom": "^5.16.5",
711
"@testing-library/react": "^13.4.0",
812
"@testing-library/user-event": "^13.5.0",

public/index.html

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8" />
5-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1" />
7-
<meta name="theme-color" content="#000000" />
8-
<meta
9-
name="description"
10-
content="Web site created using create-react-app"
11-
/>
12-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13-
<!--
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1" />
8+
<meta name="theme-color" content="#000000" />
9+
<meta name="description" content="Web site created using create-react-app" />
10+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
11+
<script src="https://kit.fontawesome.com/322a1124a5.js" crossorigin="anonymous"></script>
12+
<!--
1413
manifest.json provides metadata used when your web app is installed on a
1514
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1615
-->
17-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18-
<!--
16+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
17+
<!--
1918
Notice the use of %PUBLIC_URL% in the tags above.
2019
It will be replaced with the URL of the `public` folder during the build.
2120
Only files inside the `public` folder can be referenced from the HTML.
@@ -24,12 +23,13 @@
2423
work correctly both with client-side routing and a non-root public URL.
2524
Learn how to configure a non-root public URL by running `npm run build`.
2625
-->
27-
<title>React App</title>
28-
</head>
29-
<body>
30-
<noscript>You need to enable JavaScript to run this app.</noscript>
31-
<div id="root"></div>
32-
<!--
26+
<title>React App</title>
27+
</head>
28+
29+
<body>
30+
<noscript>You need to enable JavaScript to run this app.</noscript>
31+
<div id="root"></div>
32+
<!--
3333
This HTML file is a template.
3434
If you open it directly in the browser, you will see an empty page.
3535
@@ -39,5 +39,6 @@
3939
To begin the development, run `npm start` or `yarn start`.
4040
To create a production bundle, use `npm run build` or `yarn build`.
4141
-->
42-
</body>
43-
</html>
42+
</body>
43+
44+
</html>

src/App.css

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

src/App.js

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
1-
import logo from './logo.svg';
2-
import './App.css';
1+
import React from "react";
2+
import "../src/styles/styles.css";
3+
import Nav from "./Nav";
4+
import Homepage from "./components/Homepage";
35

46
function App() {
57
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"
17-
>
18-
Learn React
19-
</a>
20-
</header>
21-
</div>
8+
<>
9+
10+
<Nav/>
11+
<Homepage/>
12+
</>
2213
);
2314
}
2415

src/Nav.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React from "react";
2+
import "../src/styles/nav.css";
3+
import "../src/styles/styles.css";
4+
import home from "../src/images/home.png";
5+
import logo from "../src/images/meta.png";
6+
import Button from "./components/Button";
7+
import {faBars} from '@fortawesome/free-solid-svg-icons';
8+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
9+
10+
function Nav() {
11+
return (
12+
<section className="nav--container grid">
13+
14+
<div className="nav-section_content">
15+
<div className="logo--container">
16+
<img src={home} alt="a home icon" className="home--img" />
17+
<img src={logo} className="meta--logo" alt="metabnb logo" />
18+
</div>
19+
<nav>
20+
<ul className="nav-links">
21+
<li className="nav-link">Home</li>
22+
<li className="nav-link">Place to stay</li>
23+
<li className="nav-link">NFTs</li>
24+
<li className="nav-link">Community</li>
25+
</ul>
26+
</nav>
27+
<div>
28+
{" "}
29+
<Button name="Connect wallet" styleclass="nav-btn" />
30+
</div>
31+
<div className="hamburger-menu">
32+
<FontAwesomeIcon icon={faBars} className='hamburger-menu' />
33+
34+
</div>
35+
</div>
36+
</section>
37+
);
38+
}
39+
40+
export default Nav;

src/components/Button.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from "react";
2+
import "../styles/button.css"
3+
4+
function Button({name,styleclass}) {
5+
return <button className={`btn ${styleclass}`}>{name}</button>;
6+
}
7+
8+
export default Button;

src/components/Header.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react';
2+
import "../styles/header.css"
3+
4+
function Header() {
5+
return (
6+
<section className="header grid">
7+
<div className="header-content">
8+
<div className=" header-content_box header-hero_box">content 1</div>
9+
<div className="header-content_box header-image_box">content 2</div>
10+
</div>
11+
</section>
12+
);
13+
}
14+
15+
export default Header

src/components/Homepage.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from "react";
2+
import "../styles/homepage.css";
3+
import "../styles/styles.css";
4+
import Header from "../components/Header"
5+
6+
function Homepage() {
7+
return (
8+
<div className="homepage">
9+
<Header/>
10+
</div>
11+
);
12+
}
13+
14+
export default Homepage;

src/images/home.png

1.7 KB
Loading

0 commit comments

Comments
 (0)