Skip to content

small API fixes #646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import React from "react";
import React, {useEffect, useState} from "react";
import { NavLink } from 'react-router-dom';
import styles from "./activelink.module.css";

const ActiveLink = ({ url, externalLink, exact, children, customClasses, ...rest }) => {
const ActiveLink = ({ url, apiLink, externalLink, exact, children, customClasses, ...rest }) => {

const [isActive, setIsActive] = useState(false);

useEffect(() => {
const currentPath = window.location.pathname;
setIsActive(currentPath.includes('/platform-api'));
}, []);

if (externalLink) {
return (
<a
Expand All @@ -15,6 +22,17 @@ const ActiveLink = ({ url, externalLink, exact, children, customClasses, ...rest
);
}

if (apiLink) {
return (
<a
href={url}
className={`${styles.navLink} ${customClasses} ${isActive ? styles.isActive : ''}`}
>
{children}
</a>
)
}

return (
<NavLink
to={url}
Expand All @@ -29,4 +47,3 @@ const ActiveLink = ({ url, externalLink, exact, children, customClasses, ...rest
};

export default ActiveLink;

Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const NavItems = ({ isDark = false, hideMenu }) => {
</a>
</li>
<li>
<ActiveLink externalLink url="https://docs.seqera.io/platform-api/seqera-api" customClasses={`ml-8`}>
<ActiveLink apiLink url="https://docs.seqera.io/platform-api/seqera-api" customClasses={`ml-8`}>
Platform API
</ActiveLink>
</li>
Expand Down
7 changes: 6 additions & 1 deletion static/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,9 @@
# Redirect old docs URLs to new (Enterprise or Cloud) docs URLs
/platform/:version/enterprise/* /platform-enterprise/:version/enterprise/:splat 301
/platform/:version/* /platform-cloud/:splat
/platform/* /platform-cloud/:splat
/platform/* /platform-cloud/:splat



#Redirect platform-api to intro page
/platform-api /platform-api/seqera-api 301
Loading