Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@
.nav-item {
margin-top: 1rem;
}

h1{
text-align: center;
}

h2{
text-align: center;
color: navy;
}
10 changes: 10 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
import React from 'react';
import './App.css';
import { Home, About, Contact, Navigation } from './components';
import {Route} from 'react-router-dom';

const App = () => (
<div>
<Navigation />
<Route exact path="/">
<Home />
</Route>
<Route path="/">
<About />
</Route>
<Route path="/">
<Contact />
</Route>
</div>
);

Expand Down
6 changes: 5 additions & 1 deletion src/components/About.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import React from 'react';

const About = () => <h1>About</h1>;
const About = () =>
<div>
<h1>About</h1>
<h2>This is Aout Section</h2>
</div>;

export default About;
6 changes: 5 additions & 1 deletion src/components/Contact.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import React from 'react';

const Contact = () => <h1>Contact</h1>;
const Contact = () =>
<div>
<h1>Contact</h1>
<h2> Fell Free to Contact</h2>
</div> ;

export default Contact;
6 changes: 5 additions & 1 deletion src/components/Home.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import React from 'react';

const Home = () => <h1>Home</h1>;
const Home = () =>
<div>
<h1>Home</h1>
<h2>Welcome to the Home Section</h2>
</div>;

export default Home;
7 changes: 4 additions & 3 deletions src/components/Navigation.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import React from 'react';
import {Link} from 'react-router-dom';

const Navigation = () => {
return (
<div>
<div className="App">
<h1>React Router Mini</h1>
<div>
<a href="">Home</a>
<Link to ="/">Home</Link>
</div>
<div>
<a href="">About</a>
<Link to ="/about">About</Link>
</div>
<div>
<a href="">Contact</a>
<Link to ="/contact">Contact</Link>
</div>
</div>
</div>
Expand Down
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@ import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import 'bootstrap/dist/css/bootstrap.css';
import {BrowserRouter as Router} from 'react-router-dom';

ReactDOM.render(<App />, document.getElementById('root'));
ReactDOM.render(
<Router>
<App />
</Router>,
document.getElementById('root'));
Loading