docs(nxdev): fix header docs highlights (#10720)
This commit is contained in:
parent
fbc14d6544
commit
2aeef425d8
@ -1,6 +1,7 @@
|
|||||||
import { AlgoliaSearch } from '@nrwl/nx-dev/feature-search';
|
import { AlgoliaSearch } from '@nrwl/nx-dev/feature-search';
|
||||||
import cx from 'classnames';
|
import cx from 'classnames';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
import { useRouter } from 'next/router';
|
||||||
|
|
||||||
export interface HeaderProps {
|
export interface HeaderProps {
|
||||||
isDocViewer?: boolean;
|
isDocViewer?: boolean;
|
||||||
@ -8,6 +9,8 @@ export interface HeaderProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function Header(props: HeaderProps) {
|
export function Header(props: HeaderProps) {
|
||||||
|
const router = useRouter();
|
||||||
|
const isNxCloudDoc: boolean = router.asPath.startsWith('/nx-cloud');
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cx(
|
className={cx(
|
||||||
@ -66,7 +69,7 @@ export function Header(props: HeaderProps) {
|
|||||||
title="Check Nx documentation"
|
title="Check Nx documentation"
|
||||||
className={cx(
|
className={cx(
|
||||||
'px-3 py-2 leading-tight text-white',
|
'px-3 py-2 leading-tight text-white',
|
||||||
!!props.isDocViewer ? 'font-bold' : ''
|
!!props.isDocViewer && !isNxCloudDoc ? 'font-bold' : ''
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
Nx Docs
|
Nx Docs
|
||||||
@ -76,8 +79,8 @@ export function Header(props: HeaderProps) {
|
|||||||
<a
|
<a
|
||||||
title="Nx Cloud documentation"
|
title="Nx Cloud documentation"
|
||||||
className={cx(
|
className={cx(
|
||||||
'text-green-nx-base px-3 py-2 leading-tight text-white',
|
'px-3 py-2 leading-tight text-white',
|
||||||
!!props.isDocViewer ? 'font-bold' : ''
|
!!props.isDocViewer && isNxCloudDoc ? 'font-bold' : ''
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
Nx Cloud Docs
|
Nx Cloud Docs
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user