From 175176729d4a141f07814d4e942bff0f66556c89 Mon Sep 17 00:00:00 2001 From: Antony Bouyon Date: Thu, 12 Feb 2026 17:24:29 +0100 Subject: [PATCH] fix: hopefully fix everything that was broken/changed Signed-off-by: Antony Bouyon --- docs-ui/src/app/hooks/page.mdx | 10 ++---- .../app/hooks/use-breakpoint/components.tsx | 11 ------ docs-ui/src/app/hooks/use-breakpoint/page.mdx | 2 +- .../components/HookGrid/HookGrid.module.css | 29 +++++++++++++++ docs-ui/src/components/HookGrid/HookGrid.tsx | 21 +++++++++++ docs-ui/src/components/HookGrid/index.ts | 1 + .../src/components/Navigation/Navigation.tsx | 36 ++++++++++++------- 7 files changed, 77 insertions(+), 33 deletions(-) create mode 100644 docs-ui/src/components/HookGrid/HookGrid.module.css create mode 100644 docs-ui/src/components/HookGrid/HookGrid.tsx create mode 100644 docs-ui/src/components/HookGrid/index.ts diff --git a/docs-ui/src/app/hooks/page.mdx b/docs-ui/src/app/hooks/page.mdx index e6fbde7b1a..ea73f07ce3 100644 --- a/docs-ui/src/app/hooks/page.mdx +++ b/docs-ui/src/app/hooks/page.mdx @@ -1,13 +1,7 @@ -import { ComponentCard, ComponentCards } from '@/components/ComponentCards'; +import { HookGrid } from '@/components/HookGrid'; # Hooks Backstage UI custom hooks provide easy access to design system features, style management, and responsive interface creation. - - - + diff --git a/docs-ui/src/app/hooks/use-breakpoint/components.tsx b/docs-ui/src/app/hooks/use-breakpoint/components.tsx index d4d21861bb..c58010c66f 100644 --- a/docs-ui/src/app/hooks/use-breakpoint/components.tsx +++ b/docs-ui/src/app/hooks/use-breakpoint/components.tsx @@ -1,20 +1,9 @@ 'use client'; import { useBreakpoint } from '@backstage/ui'; -import { useEffect, useState } from 'react'; export function UseBreakpointExample() { const { breakpoint, up, down } = useBreakpoint(); - const [isMounted, setIsMounted] = useState(false); - - // prevent hydration mismatch by rendering only on the client - useEffect(() => { - setIsMounted(true); - }, []); - - if (!isMounted) { - return null; - } return (
diff --git a/docs-ui/src/app/hooks/use-breakpoint/page.mdx b/docs-ui/src/app/hooks/use-breakpoint/page.mdx index 5a077a3d73..f7f3378a41 100644 --- a/docs-ui/src/app/hooks/use-breakpoint/page.mdx +++ b/docs-ui/src/app/hooks/use-breakpoint/page.mdx @@ -3,9 +3,9 @@ import { PageTitle } from '@/components/PageTitle'; import { PropsTable } from '@/components/PropsTable'; import { Snippet } from '@/components/Snippet'; import { Banner } from '@/components/Banner'; -import { UseBreakpointExample } from './components'; import { useBreakpointReturnDefs } from './props-definition'; import { useBreakpointExampleSnippet } from './snippets'; +import { UseBreakpointExample } from './components'; { + return ( +
+ {hooks.map(item => ( + + {item.title} + + ))} +
+ ); +}; diff --git a/docs-ui/src/components/HookGrid/index.ts b/docs-ui/src/components/HookGrid/index.ts new file mode 100644 index 0000000000..934f73aacf --- /dev/null +++ b/docs-ui/src/components/HookGrid/index.ts @@ -0,0 +1 @@ +export * from './HookGrid'; diff --git a/docs-ui/src/components/Navigation/Navigation.tsx b/docs-ui/src/components/Navigation/Navigation.tsx index f4fc51993f..ac62c03d7a 100644 --- a/docs-ui/src/components/Navigation/Navigation.tsx +++ b/docs-ui/src/components/Navigation/Navigation.tsx @@ -18,19 +18,6 @@ interface NavigationProps { onLinkClick?: () => void; } -const data = [ - { - title: 'Components', - content: components, - url: '/components', - }, - { - title: 'Hooks', - content: hooks, - url: '/hooks', - }, -]; - export const Navigation = ({ onLinkClick }: NavigationProps) => { const pathname = usePathname(); @@ -105,6 +92,29 @@ export const Navigation = ({ onLinkClick }: NavigationProps) => { ); })} +
+ Hooks +
+ {hooks.map(item => { + const isActive = pathname === `/hooks/${item.slug}`; + return ( + +
{item.title}
+
+ {item.status === 'alpha' && 'Alpha'} + {item.status === 'beta' && 'Beta'} + {item.status === 'inProgress' && 'In Progress'} + {item.status === 'stable' && 'Stable'} + {item.status === 'deprecated' && 'Deprecated'} +
+ + ); + })} ); };