Commit 0b1a6505 authored by Remy Huet's avatar Remy Huet

Remove protected example route

parent e910362f
Pipeline #31976 passed with stage
in 57 seconds
......@@ -6,7 +6,6 @@ import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import Login from './pages/Login';
import Protected from './pages/Protected';
import PageContainer from './components/Container/PageContainer';
import Categories from './pages/Categories';
......@@ -18,7 +17,6 @@ function App(props) {
<>
<Route path="/login" component={Login} />
<PrivateRoute path="/categories/:action?/:category?" component={Categories} userIdentified={userIdentified} />
<PrivateRoute path="/protected" component={Protected} userIdentified={userIdentified} />
</>
</PageContainer>
</BrowserRouter>
......
......@@ -12,9 +12,6 @@ function MenuItems({
<Menu.Item as={Link} to="/" name="/" active={activeItem === '/'} onClick={onClick}>
Home
</Menu.Item>
<Menu.Item as={Link} to="/protected" name="/protected" active={activeItem === '/protected'} onClick={onClick}>
Protected
</Menu.Item>
<Menu.Item as={Link} to="/categories" name="/categories" active={activeItem === '/categories'} onClick={onClick}>
Categories
</Menu.Item>
......
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
function Protected(props) {
const { user } = props;
return (
<div>
<h1>Protected route</h1>
<p>
Hello
{' '}
{user.name}
</p>
</div>
);
}
Protected.propTypes = {
user: PropTypes.shape({ name: PropTypes.string.isRequired }).isRequired,
};
export default connect(store => ({
user: store.user.user,
}))(Protected);
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