Merge pull request #1854 from RafaelTaranto/fix/id-routing

LAM-1422 fix: third level navigation links
This commit is contained in:
Rafael Taranto 2025-05-19 09:59:36 +01:00 committed by GitHub
commit ac62fd449f
2 changed files with 6 additions and 8 deletions

View file

@ -35,6 +35,7 @@ const Link = ({
const [isActive] = useRoute(props.to)
const isParentActive = isParent && location.startsWith(props.to)
if (isActive || isParentActive) setActive(item)
console.log(location, isParentActive, isParent, location.startsWith(props.to))
const classNames = classnames({
[className]: true,
@ -63,6 +64,7 @@ const Subheader = ({ item, user }) => {
<Link
to={it.route}
state={{ prev }}
isParent={it.children?.length}
className={styles.subheaderLink}
activeClassName={styles.activeSubheaderLink}
item={it.route}

View file

@ -152,10 +152,8 @@ const getLamassuRoutes = () => [
get component() {
return () => (
<Redirect
to={{
pathname: this.children[0].route,
state: { prev: this.state?.prev },
}}
to={this.children[0].route}
state={{ prev: this.state?.prev }}
/>
)
},
@ -245,10 +243,8 @@ const getLamassuRoutes = () => [
get component() {
return () => (
<Redirect
to={{
pathname: this.children[0].route,
state: { prev: this.state?.prev },
}}
to={this.children[0].route}
state={{ prev: this.state?.prev }}
/>
)
},