Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feat: replace algolia ui with custom search ui

Greg Richardsoned4f8d4e7b1b
diff --git a/apps/docs/components/Clippy/Clippy.tsx b/apps/docs/components/Clippy/Clippy.tsx
deleted file mode 100644
index 8a49e2a9306..00000000000
--- a/apps/docs/components/Clippy/Clippy.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import { useTheme } from 'common/Providers'
-import Image from 'next/image'
-import { FC } from 'react'
-import { createPortal } from 'react-dom'
-import clippyImageDark from '../../public/img/clippy-dark.png'
-import clippyImage from '../../public/img/clippy.png'
-import ClippyBubble from './ClippyBubble'
-import ClippyModal from './ClippyModal'
-import { useClippy } from './ClippyProvider'
-
-const Clippy: FC = () => {
- const { isDarkMode } = useTheme()
- const { isOpen, open, close } = useClippy()
-
- return (
- <>
- {!isOpen && (
- <div className="hidden md:flex flex-col items-end gap-1 md:gap-4">
- {/* <>
- <ClippyBubble onClick={open} />
- <div className="w-[80px] lg:w-[120px] p-8 md:p-0">
- <Image src={isDarkMode ? clippyImageDark : clippyImage} alt="Clippy" />
- </div>
- </> */}
- </div>
- )}
- {isOpen && createPortal(<ClippyModal onClose={close} />, document.body)}
- </>
- )
-}
-
-export default Clippy
diff --git a/apps/docs/components/Clippy/ClippyBubble.tsx b/apps/docs/components/Clippy/ClippyBubble.tsx
deleted file mode 100644
index 92286cb85c6..00000000000
--- a/apps/docs/components/Clippy/ClippyBubble.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { FC } from 'react'
-import { IconCommand } from 'ui'
-import Image from 'next/image'
-interface Props {
- className?: string
- onClick?: () => void
-}
-
-const ClippyBubble: FC<Props> = ({ className, onClick }) => {
- return (
- <div
- className={`flex gap-2 border bg-white dark:bg-scale-300 relative rounded-xl p-4 lg:p-6 max-w-sm lg:max-w-xs shadow-xl mb-1 lg:mb-4 cursor-pointer hover:bg-scale-200 transition-colors border-scale-500 hover:border-scale-700 overflow-hidden ${
- className ? className : ''
- }`}
- onClick={onClick}
- >
- <div className="z-0 absolute -left-24 -top-4 w-[260px]">
- <Image alt="Clippy blur" width={260} height={260} src="/docs/img/purple-glow-dark.png" />
- </div>
- What can I help you with?
- <div className="flex items-center space-x-1">
- <div className="text-scale-1200 flex items-center justify-center h-5 w-10 border rounded bg-scale-500 border-scale-700 gap-1">
- <IconCommand size={12} strokeWidth={1.5} />
- <span className="text-[12px]">/</span>
- </div>
- </div>
- <div className="absolute -bottom-4 right-[90px] text-scale-600">
- <svg viewBox="0 0 1 1" width={16} fill="currentColor">
- <path d="M0,0 L1,0 L1,1 Z" />
- </svg>
- </div>
- </div>
- )
-}
-
-export default ClippyBubble
diff --git a/apps/docs/components/Clippy/ClippyProvider.tsx b/apps/docs/components/Clippy/ClippyProvider.tsx
deleted file mode 100644
index 9bdfabea56e..00000000000
--- a/apps/docs/components/Clippy/ClippyProvider.tsx
+++ /dev/null
@@ -1,72 +0,0 @@
-import {
- createContext,
- FC,
- PropsWithChildren,
- useCallback,
- useContext,
- useEffect,
- useState,
-} from 'react'
-
-export type ClippyContextValue = {
- isOpen: boolean
- open: () => void
- close: () => void
-}
-
-export const ClippyContext = createContext<ClippyContextValue>(null)
-
-export const useClippy = () => {
- const { isOpen, open, close } = useContext(ClippyContext)
-
- return { isOpen, open, close }
-}
-
-const ClippyProvider: FC<PropsWithChildren<{}>> = ({ children }) => {
- const [isModalOpen, setIsModalOpen] = useState(false)
-
- const onOpen = useCallback(() => {
- setIsModalOpen(true)
- document.body.classList.add('DocSearch--active')
- }, [])
-
- const onClose = useCallback(() => {
- setIsModalOpen(false)
- document.body.classList.remove('DocSearch--active')
- }, [])
-
- useSearchKeyboardEvents({
- onOpen,
- onClose,
- })
- return (
- <ClippyContext.Provider value={{ isOpen: isModalOpen, open: onOpen, close: onClose }}>
- {children}
- </ClippyContext.Provider>
- )
-}
-
-function useSearchKeyboardEvents({ onOpen, onClose }) {
- useEffect(() => {
- function onKeyDown(event: KeyboardEvent) {
- switch (event.key) {
- case 'Escape':
- onClose()
- return
- case '/':
- if (event.metaKey || event.ctrlKey) {
- onOpen()
- }
- return
- }
- }
-
- window.addEventListener('keydown', onKeyDown)
-
- return () => {
- window.removeEventListener('keydown', onKeyDown)
- }
- }, [onOpen, onClose])
-}
-
-export default ClippyProvider
diff --git a/apps/docs/components/DocSearch.tsx b/apps/docs/components/DocSearch.tsx
deleted file mode 100644
index 7ff1a5ece2a..00000000000
--- a/apps/docs/components/DocSearch.tsx
+++ /dev/null
@@ -1,213 +0,0 @@
-import { useState, useCallback, useRef, createContext, useContext, useEffect, memo } from 'react'
-import { createPortal } from 'react-dom'
-import Link from 'next/link'
-import Head from 'next/head'
-import { useRouter } from 'next/router'
-import { DocSearchModal } from '@docsearch/react'
-import clsx from 'clsx'
-import { useActionKey } from '~/hooks/useActionKey'
-
-// [Joshen] We're currently using this over Algolia search for the time being
-// Refer to the comment in Navigation/AlgoliaSearch for more information about this
-
-const INDEX_NAME = process.env.NEXT_PUBLIC_ALGOLIA_INDEX_NAME
-const API_KEY = process.env.NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY
-const APP_ID = process.env.NEXT_PUBLIC_ALGOLIA_APP_ID
-
-const SearchContext = createContext(null)
-
-export function SearchProvider({ children }: any) {
- const router = useRouter()
- const [isOpen, setIsOpen] = useState(false)
- const [initialQuery, setInitialQuery] = useState(null)
- const onOpen = useCallback(() => {
- setIsOpen(true)
- }, [setIsOpen])
-
- const onClose = useCallback(() => {
- setIsOpen(false)
- }, [setIsOpen])
-
- const onInput = useCallback(
- (e) => {
- setIsOpen(true)
- setInitialQuery(e.key)
- },
- [setIsOpen, setInitialQuery]
- )
-
- useDocSearchKeyboardEvents({
- isOpen,
- onOpen,
- onClose,
- // @ts-ignore
- onInput,
- })
-
- return (
- <>
- <Head>
- <link rel="preconnect" href={`https://${APP_ID}-dsn.algolia.net`} crossOrigin="true" />
- </Head>
- <SearchContext.Provider
- // @ts-ignore
- value={{
- isOpen,
- onOpen,
- onClose,
- onInput,
- }}
- >
- {children}
- </SearchContext.Provider>
- {isOpen &&
- createPortal(
- <DocSearchModal
- // @ts-ignore
- initialQuery={initialQuery}
- initialScrollY={window.scrollY}
- placeholder="Search documentation"
- onClose={onClose}
- indexName={INDEX_NAME}
- apiKey={API_KEY}
- appId={APP_ID}
- // @ts-ignore
- navigator={{
- navigate({ itemUrl }) {
- setIsOpen(false)
- router.push(itemUrl)
- },
- }}
- getMissingResultsUrl={({ query }) => {
- return `https://github.com/supabase/supabase/issues/new?title=Unable+to+search+docs+with+query:+${query}`
- }}
- hitComponent={Hit}
- transformItems={(items) => {
- return items.map((item, index) => {
- // console.log('item', item)
- // We transform the absolute URL into a relative URL to
- // leverage Next's preloading.
- const a = document.createElement('a')
- a.href = item.url
-
- const hash = a.hash === '#content-wrapper' ? '' : a.hash
-
- return {
- ...item,
- url: `${a.pathname}${hash}`,
- __is_result: () => true,
- __is_parent: () => item.type === 'lvl1' && index === 0,
- __is_guide: () => item.hierarchy.lvl0 === 'Guides',
- __is_child: () =>
- item.type !== 'lvl1' &&
- items.length > 1 &&
- items[0].type === 'lvl1' &&
- index !== 0,
- __is_first: () => index === 1,
- __is_last: () => index === items.length - 1 && index !== 0,
- }
- })
- }}
- />,
- document.body
- )}
- </>
- )
-}
-
-// @ts-ignore
-function Hit({ hit, children }) {
- return (
- <Link href={hit.url}>
- <a
- className={clsx({
- 'DocSearch-Hit--Result': hit.__is_result?.(),
- 'DocSearch-Hit--Parent': hit.__is_parent?.(),
- 'DocSearch-Hit--FirstChild': hit.__is_first?.(),
- 'DocSearch-Hit--LastChild': hit.__is_last?.(),
- 'DocSearch-Hit--Child': hit.__is_child?.(),
- 'DocSearch-Hit--Guide': hit.__is_guide?.(),
- })}
- >
- {children}
- </a>
- </Link>
- )
-}
-
-// @ts-ignore
-export function SearchButton({ children, ...props }) {
- let searchButtonRef = useRef()
- let actionKey = useActionKey()
- // @ts-ignore
- let { onOpen, onInput } = useContext(SearchContext)
-
- useEffect(() => {
- // @ts-ignore
- function onKeyDown(event) {
- if (searchButtonRef && searchButtonRef.current === document.activeElement && onInput) {
- if (/[a-zA-Z0-9]/.test(String.fromCharCode(event.keyCode))) {
- onInput(event)
- }
- }
- }
- window.addEventListener('keydown', onKeyDown)
- return () => {
- window.removeEventListener('keydown', onKeyDown)
- }
- }, [onInput, searchButtonRef])
-
- return (
- // @ts-ignore
- <button type="button" ref={searchButtonRef} onClick={onOpen} {...props}>
- {typeof children === 'function' ? children({ actionKey }) : children}
- </button>
- )
-}
-
-// @ts-ignore
-function useDocSearchKeyboardEvents({ isOpen, onOpen, onClose }) {
- useEffect(() => {
- // @ts-ignore
- function onKeyDown(event) {
- function open() {
- // We check that no other DocSearch modal is showing before opening
- // another one.
- if (!document.body.classList.contains('DocSearch--active')) {
- onOpen()
- }
- }
-
- if (
- (event.keyCode === 27 && isOpen) ||
- (event.key === 'k' && (event.metaKey || event.ctrlKey)) ||
- (!isEditingContent(event) && event.key === '/' && !isOpen)
- ) {
- event.preventDefault()
-
- if (isOpen) {
- onClose()
- } else if (!document.body.classList.contains('DocSearch--active')) {
- open()
- }
- }
- }
-
- window.addEventListener('keydown', onKeyDown)
- return () => {
- window.removeEventListener('keydown', onKeyDown)
- }
- }, [isOpen, onOpen, onClose])
-}
-
-// @ts-ignore
-function isEditingContent(event) {
- let element = event.target
- let tagName = element.tagName
- return (
- element.isContentEditable ||
- tagName === 'INPUT' ||
- tagName === 'SELECT' ||
- tagName === 'TEXTAREA'
- )
-}
diff --git a/apps/docs/components/Navigation/NavBar.tsx b/apps/docs/components/Navigation/NavBar.tsx
index d71e2d55c43..e86cdb2802e 100644
--- a/apps/docs/components/Navigation/NavBar.tsx
+++ b/apps/docs/components/Navigation/NavBar.tsx
@@ -5,9 +5,9 @@ import { useState, useEffect, FC } from 'react'
import { IconMenu, IconMoon, IconSearch, IconSun, IconCommand, Listbox } from 'ui'
import { useTheme } from 'common/Providers'
import { REFERENCES } from './Navigation.constants'
-import { SearchButton } from '../DocSearch'
import { getPageType } from '~/lib/helpers'
+import SearchButton from '../Search/SearchButton'
const NavBar: FC = () => {
const { isDarkMode, toggleTheme } = useTheme()
diff --git a/apps/docs/components/Navigation/NavigationMenu/TopNavBar.tsx b/apps/docs/components/Navigation/NavigationMenu/TopNavBar.tsx
index 3748821840b..5e949d870e1 100644
--- a/apps/docs/components/Navigation/NavigationMenu/TopNavBar.tsx
+++ b/apps/docs/components/Navigation/NavigationMenu/TopNavBar.tsx
@@ -3,11 +3,11 @@ import Link from 'next/link'
import { useRouter } from 'next/router'
import { FC, useEffect, useState } from 'react'
import { Button, IconCommand, IconMenu, IconMoon, IconSearch, IconSun, Input, Listbox } from 'ui'
-import { SearchButton } from '~/components/DocSearch'
import { REFERENCES } from '~/components/Navigation/Navigation.constants'
import { useTheme } from 'common/Providers'
import { getPageType } from '~/lib/helpers'
+import SearchButton from '~/components/Search/SearchButton'
const TopNavBar: FC = () => {
const { isDarkMode, toggleTheme } = useTheme()
diff --git a/apps/docs/components/Navigation/NavigationMenu/TopNavBarRef.tsx b/apps/docs/components/Navigation/NavigationMenu/TopNavBarRef.tsx
index 2fd9b545aa8..baa7eaf6bc1 100644
--- a/apps/docs/components/Navigation/NavigationMenu/TopNavBarRef.tsx
+++ b/apps/docs/components/Navigation/NavigationMenu/TopNavBarRef.tsx
@@ -1,22 +1,18 @@
+import { useTheme } from 'common/Providers'
import Image from 'next/image'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { FC, useEffect, useState } from 'react'
import { Button, IconCommand, IconGitHub, IconMoon, IconSearch, IconSun } from 'ui'
-import { SearchButton } from '~/components/DocSearch'
import { REFERENCES } from '~/components/Navigation/Navigation.constants'
-import { useTheme } from 'common/Providers'
-import clippyImageDark from '../../../public/img/clippy-dark.png'
-import clippyImage from '../../../public/img/clippy.png'
+import SearchButton from '~/components/Search/SearchButton'
import { getPageType } from '~/lib/helpers'
-import { useClippy } from '~/components/Clippy/ClippyProvider'
const TopNavBarRef: FC = () => {
const { isDarkMode, toggleTheme } = useTheme()
const [mounted, setMounted] = useState(false)
const [mobileMenuOpen, setMobileMenuOpen] = useState(false)
- const { open: openClippy } = useClippy()
const { asPath, push } = useRouter()
const pathSegments = asPath.split('/')
@@ -117,16 +113,6 @@ const TopNavBarRef: FC = () => {
</div>
</div>
</SearchButton>
-
- <div className="flex cursor-pointer order-1 lg:order-2">
- <Image
- onClick={openClippy}
- width={26}
- height={29}
- src={isDarkMode ? clippyImageDark : clippyImage}
- alt="Clippy"
- />
- </div>
</div>
<div className="hidden lg:flex grow items-center justify-end gap-3">
<Button
diff --git a/apps/docs/components/Search/SearchButton.tsx b/apps/docs/components/Search/SearchButton.tsx
new file mode 100644
index 00000000000..94da639a526
--- /dev/null
+++ b/apps/docs/components/Search/SearchButton.tsx
@@ -0,0 +1,40 @@
+import {
+ ButtonHTMLAttributes,
+ DetailedHTMLProps,
+ FC,
+ PropsWithChildren,
+ useEffect,
+ useRef,
+} from 'react'
+import { useActionKey } from '~/hooks/useActionKey'
+import { useSearch } from './SearchProvider'
+
+const SearchButton: FC<
+ PropsWithChildren<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>
+> = ({ children, ...props }) => {
+ const searchButtonRef = useRef<HTMLButtonElement>()
+ const { open, setQuery } = useSearch()
+
+ useEffect(() => {
+ function onKeyDown(event: KeyboardEvent) {
+ if (searchButtonRef.current === document.activeElement) {
+ if (/[a-zA-Z0-9]/.test(String.fromCharCode(event.keyCode))) {
+ open()
+ setQuery?.(event.key)
+ }
+ }
+ }
+ window.addEventListener('keydown', onKeyDown)
+ return () => {
+ window.removeEventListener('keydown', onKeyDown)
+ }
+ }, [open, setQuery])
+
+ return (
+ <button type="button" ref={searchButtonRef} onClick={open} {...props}>
+ {children}
+ </button>
+ )
+}
+
+export default SearchButton
diff --git a/apps/docs/components/Clippy/ClippyModal.tsx b/apps/docs/components/Search/SearchModal.tsx
similarity index 96%
rename from apps/docs/components/Clippy/ClippyModal.tsx
rename to apps/docs/components/Search/SearchModal.tsx
index 1af52330b73..8569a553de9 100644
--- a/apps/docs/components/Clippy/ClippyModal.tsx
+++ b/apps/docs/components/Search/SearchModal.tsx
@@ -21,10 +21,7 @@ import {
} from 'ui'
import components from '~/components'
import SearchResult, { SearchResultType } from './SearchResult'
-
-type Props = {
- onClose?: () => void
-}
+import { useSearch } from './SearchProvider'
const questions = [
'How do I get started with Supabase?',
@@ -49,9 +46,9 @@ function getEdgeFunctionUrl() {
const edgeFunctionUrl = getEdgeFunctionUrl()
-const ClippyModal: FC<Props> = ({ onClose }) => {
+const SearchModal: FC = () => {
const { isDarkMode } = useTheme()
- const [query, setQuery] = useState('')
+ const { close, query, setQuery } = useSearch()
const [answer, setAnswer] = useState('')
const [results, setResults] = useState([])
const [isLoading, setIsLoading] = useState(false)
@@ -160,7 +157,7 @@ const ClippyModal: FC<Props> = ({ onClose }) => {
setHasError(false)
}
return (
- <Modal size="xlarge" visible={true} onCancel={onClose} closable={false} hideFooter>
+ <Modal size="xlarge" visible={true} onCancel={close} closable={false} hideFooter>
<div
className={`mx-auto max-h-[50vh] lg:max-h-[75vh] flex flex-col gap-4 rounded-lg p-4 md:pt-6 md:px-6 pb-2 w-full shadow-2xl overflow-hidden border text-left border-scale-500 bg-scale-100 dark:bg-scale-300 cursor-auto relative min-w-[340px]`}
onClick={(e) => e.stopPropagation()}
@@ -185,7 +182,7 @@ const ClippyModal: FC<Props> = ({ onClose }) => {
}}
/>
<div className="absolute right-0 top-0 mt-3 mr-4 hidden md:block">
- <Button type="default" size="tiny" onClick={onClose}>
+ <Button type="default" size="tiny" onClick={close}>
esc
</Button>
</div>
@@ -205,7 +202,7 @@ const ClippyModal: FC<Props> = ({ onClose }) => {
<ul className="text-sm mt-4 text-scale-1100 grid md:flex gap-4 flex-wrap max-w-3xl">
{questions.map((question) => (
- <li>
+ <li key={question}>
<button
className="hover:bg-slate-400 hover:dark:bg-slate-400 px-4 py-2 bg-slate-300 dark:bg-slate-200 rounded-lg transition-colors"
onClick={() => {
@@ -337,4 +334,4 @@ const ClippyModal: FC<Props> = ({ onClose }) => {
)
}
-export default ClippyModal
+export default SearchModal
diff --git a/apps/docs/components/Search/SearchProvider.tsx b/apps/docs/components/Search/SearchProvider.tsx
new file mode 100644
index 00000000000..4175c159c29
--- /dev/null
+++ b/apps/docs/components/Search/SearchProvider.tsx
@@ -0,0 +1,80 @@
+import {
+ createContext,
+ FC,
+ PropsWithChildren,
+ useCallback,
+ useContext,
+ useEffect,
+ useState,
+} from 'react'
+import { createPortal } from 'react-dom'
+import SearchModal from './SearchModal'
+
+export type SearchContextValue = {
+ isOpen: boolean
+ open: () => void
+ close: () => void
+ query: string
+ setQuery: (query: string) => void
+}
+
+export const SearchContext = createContext<SearchContextValue>(null)
+
+export const useSearch = () => {
+ const { isOpen, open, close, query, setQuery } = useContext(SearchContext)
+
+ return { isOpen, open, close, query, setQuery }
+}
+
+const SearchProvider: FC<PropsWithChildren<{}>> = ({ children }) => {
+ const [isOpen, setIsOpen] = useState(false)
+ const [query, setQuery] = useState('')
+
+ const open = useCallback(() => {
+ setIsOpen(true)
+ document.body.classList.add('DocSearch--active')
+ }, [])
+
+ const close = useCallback(() => {
+ setIsOpen(false)
+ document.body.classList.remove('DocSearch--active')
+ }, [])
+
+ useSearchKeyboardEvents({
+ open,
+ close,
+ })
+
+ return (
+ <SearchContext.Provider value={{ isOpen, open, close, query, setQuery }}>
+ {children}
+ {isOpen && createPortal(<SearchModal />, document.body)}
+ </SearchContext.Provider>
+ )
+}
+
+function useSearchKeyboardEvents({ open, close }) {
+ useEffect(() => {
+ function onKeyDown(event: KeyboardEvent) {
+ switch (event.key) {
+ case 'Escape':
+ close()
+ return
+ case 'k':
+ case '/':
+ if (event.metaKey || event.ctrlKey) {
+ open()
+ }
+ return
+ }
+ }
+
+ window.addEventListener('keydown', onKeyDown)
+
+ return () => {
+ window.removeEventListener('keydown', onKeyDown)
+ }
+ }, [open, close])
+}
+
+export default SearchProvider
diff --git a/apps/docs/components/Clippy/SearchResult.tsx b/apps/docs/components/Search/SearchResult.tsx
similarity index 94%
rename from apps/docs/components/Clippy/SearchResult.tsx
rename to apps/docs/components/Search/SearchResult.tsx
index 93cae622e50..d3689024ec5 100644
--- a/apps/docs/components/Clippy/SearchResult.tsx
+++ b/apps/docs/components/Search/SearchResult.tsx
@@ -1,7 +1,7 @@
import Link from 'next/link'
import { FC } from 'react'
import { IconBookOpen, IconHash } from '~/../../packages/ui'
-import { useClippy } from './ClippyProvider'
+import { useSearch } from './SearchProvider'
export enum SearchResultType {
Document = 'document',
@@ -16,7 +16,7 @@ type Props = {
}
const SearchResult: FC<Props> = ({ href, type, title, chip }) => {
- const { close } = useClippy()
+ const { close } = useSearch()
return (
<Link href={href}>
diff --git a/apps/docs/hooks/useActionKey.ts b/apps/docs/hooks/useActionKey.ts
index 883c8ee5b7b..98db6a52d01 100644
--- a/apps/docs/hooks/useActionKey.ts
+++ b/apps/docs/hooks/useActionKey.ts
@@ -1,18 +1,16 @@
import { useState, useEffect } from 'react'
-const ACTION_KEY_DEFAULT = ['Ctrl ', 'Control']
-const ACTION_KEY_APPLE = ['⌘', 'Command']
+const ACTION_KEY_DEFAULT = ['Ctrl ', 'Control'] as const
+const ACTION_KEY_APPLE = ['⌘', 'Command'] as const
export function useActionKey() {
- let [actionKey, setActionKey] = useState()
+ let [actionKey, setActionKey] = useState<readonly [string, string]>()
useEffect(() => {
if (typeof navigator !== 'undefined') {
if (/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)) {
- // @ts-ignore
setActionKey(ACTION_KEY_APPLE)
} else {
- // @ts-ignore
setActionKey(ACTION_KEY_DEFAULT)
}
}
diff --git a/apps/docs/layouts/SiteLayout.tsx b/apps/docs/layouts/SiteLayout.tsx
index d1f37b40d1b..cd9e8ba40b1 100644
--- a/apps/docs/layouts/SiteLayout.tsx
+++ b/apps/docs/layouts/SiteLayout.tsx
@@ -4,10 +4,7 @@ import Link from 'next/link'
import NavigationMenu from '~/components/Navigation/NavigationMenu/NavigationMenu'
import TopNavBarRef from '~/components/Navigation/NavigationMenu/TopNavBarRef'
-import FooterHelpCallout from '~/components/FooterHelpCallout'
-
import { memo, useEffect } from 'react'
-import Clippy from '~/components/Clippy/Clippy'
import Footer from '~/components/Navigation/Footer'
import { menuState, useMenuLevelId, useMenuMobileOpen } from '~/hooks/useMenuState'
@@ -339,9 +336,6 @@ const SiteLayout = ({ children }) => {
</div>
<MobileMenuBackdrop />
</Container>
- <div className=" absolute right-4 md:right-12 bottom-8 z-[300]">
- <Clippy />
- </div>
</div>
</main>
)
diff --git a/apps/docs/pages/_app.tsx b/apps/docs/pages/_app.tsx
index e73aa39d38f..2b37d2ca233 100644
--- a/apps/docs/pages/_app.tsx
+++ b/apps/docs/pages/_app.tsx
@@ -5,9 +5,8 @@ import { DefaultSeo } from 'next-seo'
import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
import { AppPropsWithLayout } from 'types'
-import ClippyProvider from '~/components/Clippy/ClippyProvider'
-import { SearchProvider } from '~/components/DocSearch'
import Favicons from '~/components/Favicons'
+import SearchProvider from '~/components/Search/SearchProvider'
import SiteLayout from '~/layouts/SiteLayout'
import { post } from '~/lib/fetchWrappers'
import '../styles/algolia-search.scss'
@@ -88,11 +87,9 @@ function MyApp({ Component, pageProps }: AppPropsWithLayout) {
<SessionContextProvider supabaseClient={supabase}>
<ThemeProvider>
<SearchProvider>
- <ClippyProvider>
- <SiteLayout>
- <Component {...pageProps} />
- </SiteLayout>
- </ClippyProvider>
+ <SiteLayout>
+ <Component {...pageProps} />
+ </SiteLayout>
</SearchProvider>
</ThemeProvider>
</SessionContextProvider>