diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index ffd655fcd..d3d806345 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -103,9 +103,33 @@ function Header() { ); } +// Only on docs-legacy.sourcegraph.com. The same deployment also serves +// sourcegraph.com/docs (until the new docs take over) and ms-docs.sg.dev. +function LegacyBanner() { + const [show, setShow] = useState(false); + useEffect(() => { + setShow(window.location.hostname === 'docs-legacy.sourcegraph.com'); + }, []); + if (!show) return null; + return ( +
+ You’re viewing the legacy Sourcegraph documentation, which is no + longer updated. See the{' '} + + new documentation + + . +
+ ); +} + export function Layout({children}: {children: React.ReactNode}) { return (