Used not-found component for menu layout inner router

This commit is contained in:
Alejandro Celaya
2019-03-03 11:15:34 +01:00
parent d23ddd0e0b
commit c4bc2f24d6
3 changed files with 45 additions and 12 deletions

View File

@@ -1,15 +1,23 @@
import React from 'react';
import { Link } from 'react-router-dom';
import * as PropTypes from 'prop-types';
const NotFound = () => (
const propTypes = {
to: PropTypes.string,
btnText: PropTypes.string,
};
const NotFound = ({ to = '/', btnText = 'Home' }) => (
<div className="home">
<h2>Oops! We could not find requested route.</h2>
<p>
Use your browser{'\''}s back button to navigate to the page you have previously come from, or just press this button.
</p>
<br />
<Link to="/" className="btn btn-outline-primary btn-lg">Home</Link>
<Link to={to} className="btn btn-outline-primary btn-lg">{btnText}</Link>
</div>
);
NotFound.propTypes = propTypes;
export default NotFound;