Added 404 page
This commit is contained in:
+19
-1
@@ -1,4 +1,12 @@
|
||||
import React from 'react';
|
||||
import { BrowserRouter, Switch, Route } from 'react-router-dom';
|
||||
|
||||
//include pages
|
||||
import Home from './pages/home.jsx';
|
||||
import PageNotFound from './pages/page_not_found.jsx';
|
||||
|
||||
//other stuff
|
||||
import Footer from './panels/footer.jsx';
|
||||
|
||||
export default class App extends React.Component {
|
||||
constructor(props) {
|
||||
@@ -7,6 +15,16 @@ export default class App extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
return <p>Hello world</p>;
|
||||
return (
|
||||
<div className = 'central'>
|
||||
<BrowserRouter>
|
||||
<Switch>
|
||||
<Route exact path='/' component={Home} />
|
||||
<Route path='*' component={PageNotFound} />
|
||||
</Switch>
|
||||
</BrowserRouter>
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { withRouter, Link } from 'react-router-dom';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
class Home extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className='page'>
|
||||
<p>This is the home page</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function mapStoreToProps(store) {
|
||||
return {
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
function mapDispatchToProps(dispatch) {
|
||||
return {
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
Home = connect(mapStoreToProps, mapDispatchToProps)(Home);
|
||||
|
||||
export default withRouter(Home);
|
||||
@@ -0,0 +1,23 @@
|
||||
import React from 'react';
|
||||
import { withRouter, Link } from 'react-router-dom';
|
||||
|
||||
class PageNotFound extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
render() {
|
||||
let style = {
|
||||
justifyContent: 'center'
|
||||
}
|
||||
return (
|
||||
<div className='page centered' style={style}>
|
||||
<h1>Page Not Found</h1>
|
||||
<Link to='/'>Return Home</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default withRouter(PageNotFound);
|
||||
@@ -0,0 +1,12 @@
|
||||
import React from 'react';
|
||||
|
||||
export default class Footer extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<footer>
|
||||
<p>Copyright <a href='https://krgamestudios.com'>KR Game Studios</a> 2019</p>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user