mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 05:55:44 +01:00
added default icon for subnavigation and removed icons from subnavigation navlinks
This commit is contained in:
@@ -4,6 +4,7 @@ import {Link, Route} from "react-router-dom";
|
||||
|
||||
type Props = {
|
||||
to: string,
|
||||
icon?: string,
|
||||
label: string,
|
||||
activeOnlyWhenExact?: boolean,
|
||||
activeWhenMatch?: (route: any) => boolean,
|
||||
@@ -21,7 +22,12 @@ class SubNavigation extends React.Component<Props> {
|
||||
}
|
||||
|
||||
renderLink = (route: any) => {
|
||||
const { to, label } = this.props;
|
||||
const { to, icon, label } = this.props;
|
||||
|
||||
let defaultIcon = "fas fa-cog";
|
||||
if (icon) {
|
||||
defaultIcon = icon;
|
||||
}
|
||||
|
||||
let children = null;
|
||||
if(this.isActive(route)) {
|
||||
@@ -33,6 +39,7 @@ class SubNavigation extends React.Component<Props> {
|
||||
return (
|
||||
<li>
|
||||
<Link className={this.isActive(route) ? "is-active" : ""} to={to}>
|
||||
<><i className={defaultIcon}></i>{" "}</>
|
||||
{label}
|
||||
</Link>
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user