Add admin nav
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user