We need to protect routes (admin pages) for loggedin user only who has the role of admin. Later we will also allow other users to leave a comment on the posts.
For all this we need to implement login and registration system along with forgot/reset password We can start from creating sign in page.
Also add a link to signup page in the TopNav.js
so that we can easily navigate.
<Menu.Item
key="signup"
icon={<UserAddOutlined />}
style={{ marginLeft: "auto" }}
>
<Link href="/signup">
<a>Sign Up</a>
</Link>
</Menu.Item>
<Menu.Item key="toggle">
<ToggleTheme />
</Menu.Item>
Sign up page
const SignUp = () => {
return <div>Sign up</div>;
};
export default SignUp;