Add admin nav

This commit is contained in:
Jan Tuomi
2019-01-15 12:20:49 +02:00
parent 8197c40701
commit ef28a3f4b9
11 changed files with 115 additions and 3 deletions
@@ -0,0 +1,24 @@
import * as React from "react";
import { Link } from "react-router-dom";
import "./AdminSidebarLink.scss";
export interface AdminSidebarLinkProps {
to: string;
path: string;
}
export interface AdminSidebarLinkState {}
class AdminSidebarLink extends React.Component<AdminSidebarLinkProps, AdminSidebarLinkState> {
render() {
const { to, path, children } = this.props;
const activeClass = to === path ? "active" : "";
return (
<Link to={to} className={`admin-sidebar-link ${activeClass}`}>
{ children }
</Link>
);
}
}
export default AdminSidebarLink;