Skip to content

Commit

Permalink
Merge pull request #4 from adityasimant/main
Browse files Browse the repository at this point in the history
Created a Navbar and implimented routes
  • Loading branch information
adityasimant authored Aug 14, 2023
2 parents e7c51ca + 2c7ad52 commit f247a53
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 3 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"react": "^18.2.0",
"react-bootstrap": "^2.8.0",
"react-dom": "^18.2.0",
"react-icons": "^4.10.1",
"react-router-dom": "^6.15.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
Expand Down
24 changes: 21 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
import './App.css';

import NavBar from './components/Navbar';
import {
BrowserRouter as Router,
Route,
Routes,
Navigate
} from "react-router-dom";
import Events from './components/Events';
import CoreTeam from './components/CoreTeam';
import Contact from './components/Contact';
import Home from './components/Home';
function App() {
return (
<>
<h2>Hello world!</h2>
<h3>You have successfully started the app!</h3>
<Router>
<NavBar/>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/events" element={<Events />} />
<Route path="/coreteam" element={<CoreTeam />} />
<Route path="/contact" element={<Contact />} />
<Route path="*" element={<Navigate to="/"/>} />
</Routes>
</Router>
</>
);
}
Expand Down
13 changes: 13 additions & 0 deletions src/components/Contact.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React, { Component } from 'react';

class Contact extends Component {
render() {
return (
<div>
Contact Page
</div>
);
}
}

export default Contact;
13 changes: 13 additions & 0 deletions src/components/CoreTeam.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React, { Component } from 'react';

class CoreTeam extends Component {
render() {
return (
<div>
This is core team
</div>
);
}
}

export default CoreTeam;
13 changes: 13 additions & 0 deletions src/components/Events.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React, { Component } from 'react';

class Events extends Component {
render() {
return (
<div>
This is events page
</div>
);
}
}

export default Events;
13 changes: 13 additions & 0 deletions src/components/Home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React, { Component } from 'react';

class Home extends Component {
render() {
return (
<div>
This is home page
</div>
);
}
}

export default Home;
31 changes: 31 additions & 0 deletions src/components/Navbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import Container from 'react-bootstrap/Container';
import Nav from 'react-bootstrap/Nav';
import Navbar from 'react-bootstrap/Navbar';
import { Link } from 'react-router-dom';



function NavBar() {

return(
<>
<Navbar bg="dark" data-bs-theme="dark">
<Container>
<Navbar.Brand href="#home">IETE DIEMS ISF</Navbar.Brand>
<Navbar.Toggle />
<Nav className="m-auto" variant='primary' >
<Nav.Link as={Link} to="/">Home</Nav.Link>
<Nav.Link as={Link} to="/">About</Nav.Link>
<Nav.Link as={Link} to="/events">Events</Nav.Link>
<Nav.Link as={Link} to="/coreteam">Core Team</Nav.Link>
<Nav.Link as={Link} to="/contact">Contact us</Nav.Link>
</Nav>
</Container>
</Navbar>
</>
)


}

export default NavBar;

0 comments on commit f247a53

Please sign in to comment.