Skip to content

Commit a45f91f

Browse files
Video 6 completed
1 parent efe7389 commit a45f91f

File tree

4 files changed

+57
-22
lines changed

4 files changed

+57
-22
lines changed

module1.mjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import dza, {a, c, d} from './module2.mjs'
2+
console.log(dza);
3+
console.log(c);
4+
console.log(d);
5+
console.log(a);

module2.mjs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const a = "Harry";
2+
const b = "Rohan";
3+
const c = "Aakash";
4+
const d = "Priyanka";
5+
6+
export default b;
7+
export {a};
8+
export {c};
9+
export {d};

src/App.js

+4-22
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,12 @@
11
import './App.css';
2+
import Navbar from './components/Navbar';
23

34
function App() {
45
return (
56
<>
6-
<nav className="navbar navbar-expand-lg navbar-light bg-light">
7-
<div className="container-fluid">
8-
<a className="navbar-brand" href="/">TextUtils</a>
9-
<button className="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
10-
<span className="navbar-toggler-icon"></span>
11-
</button>
12-
<div className="collapse navbar-collapse" id="navbarSupportedContent">
13-
<ul className="navbar-nav me-auto mb-2 mb-lg-0">
14-
<li className="nav-item">
15-
<a className="nav-link active" aria-current="page" href="/">Home</a>
16-
</li>
17-
<li className="nav-item">
18-
<a className="nav-link" href="/">About</a>
19-
</li>
20-
</ul>
21-
<form className="d-flex">
22-
<input className="form-control me-2" type="search" placeholder="Search" aria-label="Search"/>
23-
<button className="btn btn-outline-success" type="submit">Search</button>
24-
</form>
25-
</div>
26-
</div>
27-
</nav>
7+
{/* <Navbar title="TextUtils" aboutText="About TextUtils" /> */}
8+
{/* <Navbar/> */}
9+
<Navbar title="TextUtils" />
2810
</>
2911
);
3012
}

src/components/Navbar.js

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import React from 'react'
2+
import PropTypes from 'prop-types'
3+
4+
export default function Navbar(props) {
5+
return (
6+
<nav className="navbar navbar-expand-lg navbar-light bg-light">
7+
<div className="container-fluid">
8+
<a className="navbar-brand" href="/">{props.title}</a>
9+
<button className="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
10+
<span className="navbar-toggler-icon"></span>
11+
</button>
12+
<div className="collapse navbar-collapse" id="navbarSupportedContent">
13+
<ul className="navbar-nav me-auto mb-2 mb-lg-0">
14+
<li className="nav-item">
15+
<a className="nav-link active" aria-current="page" href="/">Home</a>
16+
</li>
17+
<li className="nav-item">
18+
<a className="nav-link" href="/">{props.aboutText}</a>
19+
</li>
20+
</ul>
21+
<form className="d-flex">
22+
<input className="form-control me-2" type="search" placeholder="Search" aria-label="Search" />
23+
<button className="btn btn-outline-success" type="submit">Search</button>
24+
</form>
25+
</div>
26+
</div>
27+
</nav>
28+
)
29+
}
30+
31+
Navbar.propTypes = {
32+
title: PropTypes.string.isRequired,
33+
aboutText: PropTypes.string.isRequired
34+
}
35+
36+
Navbar.defaultProps = {
37+
title: 'Set title here',
38+
aboutText: 'About'
39+
};

0 commit comments

Comments
 (0)