From 47a6a1f89eb65a1975058c71163c9ca71774e650 Mon Sep 17 00:00:00 2001 From: Ben White Date: Wed, 20 Dec 2023 15:07:47 +0100 Subject: [PATCH] chore: Temp disable the auto linking docs (#19442) --- frontend/src/lib/lemon-ui/Link/Link.tsx | 27 ++++++++++++------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/frontend/src/lib/lemon-ui/Link/Link.tsx b/frontend/src/lib/lemon-ui/Link/Link.tsx index 3f7813e75f070..9cb0a3fe770de 100644 --- a/frontend/src/lib/lemon-ui/Link/Link.tsx +++ b/frontend/src/lib/lemon-ui/Link/Link.tsx @@ -1,15 +1,11 @@ import './Link.scss' import clsx from 'clsx' -import { useActions } from 'kea' import { router } from 'kea-router' -import { useFeatureFlag } from 'lib/hooks/useFeatureFlag' import { isExternalLink } from 'lib/utils' import React from 'react' import { useNotebookDrag } from 'scenes/notebooks/AddToNotebook/DraggableToNotebook' -import { sidePanelDocsLogic } from '~/layout/navigation-3000/sidepanel/panels/sidePanelDocsLogic' - import { IconOpenInNew } from '../icons' import { Tooltip } from '../Tooltip' @@ -54,9 +50,10 @@ const isPostHogDomain = (url: string): boolean => { return /^https:\/\/((www|app|eu)\.)?posthog\.com/.test(url) } -const isPostHogComDocs = (url: string): boolean => { - return /^https:\/\/(www\.)?posthog\.com\/docs/.test(url) -} +// NOTE: Temporarily disabled - owner @corywatilo +// const isPostHogComDocs = (url: string): boolean => { +// return /^https:\/\/(www\.)?posthog\.com\/docs/.test(url) +// } /** * Link @@ -87,8 +84,9 @@ export const Link: React.FC> = Reac href: typeof to === 'string' ? to : undefined, }) - const is3000 = useFeatureFlag('POSTHOG_3000', 'test') - const { openDocsPage } = useActions(sidePanelDocsLogic) + // NOTE: Temporarily disabled - owner @corywatilo + // const is3000 = useFeatureFlag('POSTHOG_3000', 'test') + // const { openDocsPage } = useActions(sidePanelDocsLogic) const onClick = (event: React.MouseEvent): void => { if (event.metaKey || event.ctrlKey) { @@ -103,11 +101,12 @@ export const Link: React.FC> = Reac return } - if (typeof to === 'string' && is3000 && isPostHogComDocs(to)) { - event.preventDefault() - openDocsPage(to) - return - } + // NOTE: Temporarily disabled - owner @corywatilo + // if (typeof to === 'string' && is3000 && isPostHogComDocs(to)) { + // event.preventDefault() + // openDocsPage(to) + // return + // } if (!target && to && !isExternalLink(to) && !disableClientSideRouting && !shouldForcePageLoad(to)) { event.preventDefault()