2017-05-18 13:26:00 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2017-05-17 14:20:13 +00:00
|
|
|
import Link from 'next/link';
|
2017-05-18 13:26:00 +00:00
|
|
|
import DefaultPage from '../hocs/defaultPage';
|
2017-05-17 10:53:22 +00:00
|
|
|
|
2017-05-18 07:53:27 +00:00
|
|
|
const Index = ({ isAuthenticated }) => {
|
2017-05-17 10:53:22 +00:00
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<h1>Hello Worlds!</h1>
|
2017-05-18 02:08:37 +00:00
|
|
|
{isAuthenticated && <p>Authenticated!!</p>}
|
|
|
|
{!isAuthenticated && <p>Not Authriozed</p>}
|
2017-05-18 07:53:27 +00:00
|
|
|
<p><Link prefetch href='/login'><a>Login</a></Link></p>
|
|
|
|
<p><Link prefetch href='/logout'><a>Logout</a></Link></p>
|
|
|
|
<p><Link prefetch href='/secret'><a>Secure Page</a></Link></p>
|
2017-05-17 10:53:22 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-05-18 07:53:27 +00:00
|
|
|
Index.propTypes = {
|
|
|
|
isAuthenticated: PropTypes.bool.isRequired
|
|
|
|
}
|
|
|
|
|
2017-05-18 13:26:00 +00:00
|
|
|
export default DefaultPage(Index);
|