diff --git a/src/components/open-api-sidebar-contents/utils/filter-by-title.ts b/src/components/open-api-sidebar-contents/utils/filter-by-title.ts index 85fb41c754..d915321ca4 100644 --- a/src/components/open-api-sidebar-contents/utils/filter-by-title.ts +++ b/src/components/open-api-sidebar-contents/utils/filter-by-title.ts @@ -16,16 +16,6 @@ export function filterByTitle( items: T[], filterValue: string ): T[] { - // If we're in dev, and none of the items have a `title` property, - // throw an error cause there's probably something unintentional happening. - if (IS_DEV) { - if (!items.some(isObjectWithTitle)) { - throw new Error( - 'Error: None of the items passed to filterByTitle were found to have a `title` attribute. Please ensure at least one of the items being passed has a `title` attribute.' - ) - } - } - if (!filterValue) { // If there's no filter value, return items unchanged return items diff --git a/src/components/sidebar/components/sidebar-nav-highlight-item/index.tsx b/src/components/sidebar/components/sidebar-nav-highlight-item/index.tsx index 2cc61a4ba8..0fed39853c 100644 --- a/src/components/sidebar/components/sidebar-nav-highlight-item/index.tsx +++ b/src/components/sidebar/components/sidebar-nav-highlight-item/index.tsx @@ -7,8 +7,10 @@ import Link from 'components/link' import classNames from 'classnames' import { isProductSlug } from 'lib/products' import ProductIcon from 'components/product-icon' +import Text from 'components/text' import { NavHighlightItem } from 'components/sidebar/types' import s from './sidebar-nav-highlight-item.module.css' +import { log } from 'console' /** * Render a fancy-looking, product themed linked sidebar item. @@ -24,19 +26,34 @@ export default function SidebarNavHighlightItem({ }: { theme: NavHighlightItem['theme'] text: string - href: string + href?: string isActive?: boolean }) { + const icon = isProductSlug(theme) ? ( + + ) : null + const textEl = {text} + + if (!href?.length) { + return ( + + {icon} + {textEl} + + ) + } return ( - {isProductSlug(theme) ? ( - - ) : null} - {text} + {icon} + {textEl} ) } diff --git a/src/components/sidebar/components/sidebar-nav-menu-item/index.tsx b/src/components/sidebar/components/sidebar-nav-menu-item/index.tsx index 03948803b4..2974934d35 100644 --- a/src/components/sidebar/components/sidebar-nav-menu-item/index.tsx +++ b/src/components/sidebar/components/sidebar-nav-menu-item/index.tsx @@ -293,19 +293,19 @@ const SidebarNavMenuItem = ({ item }: SidebarNavMenuItemProps) => { let itemContent if (item.divider) { itemContent = - } else if (item.heading) { - itemContent = } else if (item.routes) { itemContent = } else if (item.theme) { itemContent = ( ) + } else if (item.heading) { + itemContent = } else { itemContent = } diff --git a/src/components/sidebar/helpers/generate-install-view-nav-items.ts b/src/components/sidebar/helpers/generate-install-view-nav-items.ts index 0061e339ac..45d6012b45 100644 --- a/src/components/sidebar/helpers/generate-install-view-nav-items.ts +++ b/src/components/sidebar/helpers/generate-install-view-nav-items.ts @@ -38,9 +38,9 @@ export const generateInstallViewNavItems = ( ? `Install ${product.name} Enterprise` : `Install ${product.name}` const titleItem = { - title, - fullPath: `/${product.slug}/install`, + heading: title, theme: product.slug, + isActive: true, } return {