From 574aa63da9294ccbaa20ee0a6940077dc9da0fa7 Mon Sep 17 00:00:00 2001 From: gndz07 Date: Fri, 15 Mar 2024 10:28:06 +0100 Subject: [PATCH] Revert "feat: AI assistant for traefikee and proxy documentations" This reverts commit f1387877338fdf447405e3b8de156266e3f5c63d. --- package.json | 2 +- src/components/nav/Header.tsx | 2 -- src/components/nav/useDocWhizzScript.jsx | 36 ------------------------ 3 files changed, 1 insertion(+), 39 deletions(-) delete mode 100644 src/components/nav/useDocWhizzScript.jsx diff --git a/package.json b/package.json index 0d588ef..02dcffc 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "web-vitals": "^2.1.0" }, "scripts": { - "start": "set PORT=8000 && react-scripts start", + "start": "react-scripts start", "build": "react-scripts build", "gen-assets": "rimraf static-assets && mkdir -p static-assets && cp build/static/js/*.js static-assets/main-v1.js", "test": "react-scripts test", diff --git a/src/components/nav/Header.tsx b/src/components/nav/Header.tsx index 9d0e03b..3211fa1 100644 --- a/src/components/nav/Header.tsx +++ b/src/components/nav/Header.tsx @@ -6,7 +6,6 @@ import Link from 'components/Link' import SkipLink from 'components/Link/Skip' import MainNav from 'components/nav/MainNav' import DrawerNav from 'components/nav/DrawerNav' -import useDocWhizzScript from './useDocWhizzScript' const Nav = styled(FaencyNav)` position: fixed; @@ -121,7 +120,6 @@ const Header = ({ product }: { product?: string }) => { const [isDrawerOpen, setIsDrawerOpen] = useState(false) const [isHeaderScrolled, setHeaderScrolled] = useState(false) - useDocWhizzScript() const demoLink = useMemo(() => { if (product === 'hub') return 'https://info.traefik.io/traefik-hub-signup' diff --git a/src/components/nav/useDocWhizzScript.jsx b/src/components/nav/useDocWhizzScript.jsx deleted file mode 100644 index 71b5efc..0000000 --- a/src/components/nav/useDocWhizzScript.jsx +++ /dev/null @@ -1,36 +0,0 @@ -import { useEffect, useMemo } from 'react' - -const WHITELISTED_HOSTNAME = ['localhost', 'doc.traefik.io'] - -const useDocWhizzScript = () => { - const { pathname, hostname } = window.location - const product = pathname.split('/')[1] - - const clientId = useMemo(() => { - if (WHITELISTED_HOSTNAME.includes(hostname)) { - if (product === 'traefik') return '65e8267d7714e3b11a5ce139' - if (product === 'traefik-enterprise') return '65f0e20984bd4dfcfe7e58a6' - - return null - } - return null - }, [hostname, product]) - - useEffect(() => { - if (!!clientId) { - const t = document.createElement('script') - t.setAttribute('data-id', 'docwhizz-script') - t.setAttribute('data-client', clientId) - t.crossOrigin = 'anonymous' - t.src = 'https://widget.docwhizz.com/index.js' - t.type = 'module' - document.head.appendChild(t) - - return () => { - document.head.removeChild(t) - } - } - }, [clientId]) -} - -export default useDocWhizzScript