Commit 7cf7f30b authored by Thomas Roos's avatar Thomas Roos

Move navbar and footer above the router switch

parent e5cc1d18
......@@ -10,6 +10,8 @@ import ReactDOM from 'react-dom';
import Loadable from 'react-loadable';
import {BrowserRouter as Router, Route, Switch} from 'react-router-dom';
import NavBar from './components/NavBar';
import Footer from './components/Footer';
const Loading = () => <div>Loading...</div>;
......@@ -49,15 +51,19 @@ if (root == null) {
} else {
ReactDOM.render((
<Router>
<Switch>
<Route exact path="/" component={Home} />
<Route path="/exams" component={Exams} />
<Route path="/students" component={Students} />
<Route path="/grade" component={Grade} />
<Route path="/graders" component={Graders} />
<Route path="/reset" component={Reset} />
<Route path="/statistics" component={Statistics} />
</Switch>
<div>
<NavBar />
<Switch>
<Route exact path="/" component={Home} />
<Route path="/exams" component={Exams} />
<Route path="/students" component={Students} />
<Route path="/grade" component={Grade} />
<Route path="/graders" component={Graders} />
<Route path="/reset" component={Reset} />
<Route path="/statistics" component={Statistics} />
</Switch>
<Footer />
</div>
</Router>
), root);
}
import React from 'react';
import NavBar from '../components/NavBar';
import Hero from '../components/Hero';
import Footer from '../components/Footer';
import Dropzone from 'react-dropzone'
import Hero from '../components/Hero';
import * as api from '../api'
const StatusPDF = props => {
......@@ -181,8 +179,6 @@ class Exams extends React.Component {
return <div>
<NavBar />
<Hero title='Exams' subtitle="Omnomnomnom PDF's!" />
<section className="section">
......@@ -256,8 +252,6 @@ class Exams extends React.Component {
</div>
</section>
<Footer />
</div>
}
}
......
import React from 'react';
import NavBar from '../components/NavBar';
import Hero from '../components/Hero';
import Footer from '../components/Footer';
const Grade = () => {
return (
<div>
<NavBar />
<Hero title='Grade' subtitle='This is where the magic happens!' />
<h1>React Router demo</h1>
Hoi dit de Grade
<Footer />
</div>
)
}
......
import React from 'react';
import NavBar from '../components/NavBar';
import Hero from '../components/Hero';
import Footer from '../components/Footer';
import Hero from '../components/Hero';
import GraderManager from '../components/GradersManager';
const Graders = () => {
return (
<div>
<NavBar />
<Hero title='Manage Graders' subtitle='Many hands make light work' />
<section className="section">
......@@ -23,8 +19,6 @@ const Graders = () => {
</div>
</section>
<Footer />
</div>
)
}
......
import React from 'react';
import NavBar from '../components/NavBar';
import Hero from '../components/Hero';
import Footer from '../components/Footer';
import ReactMarkdown from 'react-markdown';
import Hero from '../components/Hero';
import homeMarkdown from './home.md'
const Home = () => {
return (
<div>
<NavBar />
<Hero title='Home' subtitle='Zesje - open source exam grading software' />
<section className="section">
......@@ -25,8 +21,6 @@ const Home = () => {
</section>
<Footer />
</div>
)
}
......
import React from 'react';
import NavBar from '../components/NavBar';
import Hero from '../components/Hero';
import Footer from '../components/Footer';
const Reset = () => {
return (
<div>
<NavBar />
<Hero title='Reset' subtitle="Please don't hurt my database :(" />
<section className="section">
......
import React from 'react';
import NavBar from '../components/NavBar';
import Hero from '../components/Hero';
import Footer from '../components/Footer';
const StatisticsDashboard = () => {
return (
<div>
<NavBar />
<Hero title='Statistics Dashboard' subtitle='Is your exam sane?' />
<h1>React Router demo</h1>
Hoi dit de Statistics Dashboard
<Footer />
</div>
)
......
......@@ -2,9 +2,7 @@ import React from 'react';
import getClosest from 'get-closest';
import Mousetrap from 'mousetrap';
import NavBar from '../components/NavBar';
import Hero from '../components/Hero';
import Footer from '../components/Footer';
import * as api from '../api';
......@@ -293,8 +291,6 @@ class CheckStudents extends React.Component {
return (
<div>
<NavBar />
<Hero title='Match Students' subtitle='Who made what?' />
<section className="section">
......@@ -362,8 +358,6 @@ class CheckStudents extends React.Component {
</div>
</section>
<Footer />
</div>
)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment