Add Anchor abstraction to support hash links
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import Anchor from "../Anchor";
|
||||
import "./AdminSidebarLink.scss";
|
||||
|
||||
export interface AdminSidebarLinkProps {
|
||||
@@ -7,7 +7,7 @@ export interface AdminSidebarLinkProps {
|
||||
path: string;
|
||||
id?: string;
|
||||
}
|
||||
export interface AdminSidebarLinkState {}
|
||||
export interface AdminSidebarLinkState { }
|
||||
|
||||
class AdminSidebarLink extends React.Component<AdminSidebarLinkProps, AdminSidebarLinkState> {
|
||||
render() {
|
||||
@@ -15,9 +15,9 @@ class AdminSidebarLink extends React.Component<AdminSidebarLinkProps, AdminSideb
|
||||
const activeClass = to === path ? "active" : "";
|
||||
|
||||
return (
|
||||
<Link id={id} to={to} className={`admin-sidebar-link ${activeClass}`}>
|
||||
{ children }
|
||||
</Link>
|
||||
<Anchor id={id} to={to} className={`admin-sidebar-link ${activeClass}`}>
|
||||
{children}
|
||||
</Anchor>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user