Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: replace docs algolia search with inkeep keywords search #1972

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
374 changes: 276 additions & 98 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@headlessui/react": "^1.7.19",
"@headlessui/tailwindcss": "^0.2.0",
"@hookform/resolvers": "^3.3.4",
"@inkeep/widgets": "^0.2.275",
"@inkeep/uikit": "^0.3.8",
"@next/bundle-analyzer": "^14.2.2",
"@octokit/core": "^6.1.2",
"@radix-ui/react-dialog": "^1.0.5",
Expand Down
4 changes: 0 additions & 4 deletions src/components/pages/doc/inkeep-trigger/images/close.svg

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions src/components/pages/doc/inkeep-trigger/index.js

This file was deleted.

135 changes: 0 additions & 135 deletions src/components/pages/doc/inkeep-trigger/inkeep-trigger.jsx

This file was deleted.

32 changes: 14 additions & 18 deletions src/components/pages/doc/mobile-nav/mobile-nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import useClickOutside from 'hooks/use-click-outside';
import useWindowSize from 'hooks/use-window-size';
import ChevronRight from 'icons/chevron-right.inline.svg';

import InkeepTrigger from '../inkeep-trigger';
import { sidebarPropTypes } from '../sidebar/sidebar';

const ANIMATION_DURATION = 0.2;
Expand Down Expand Up @@ -118,23 +117,20 @@ const MobileNav = ({ className = null, sidebar, basePath, isPostgres = false })
style={{ height: containerHeight }}
>
{!isPostgres && (
<>
<InkeepTrigger isSidebar />
<ul className="mb-7">
{MENUS.docSidebar.map(({ icon: Icon, title, slug }, index) => (
<li className="py-[7px] first:pt-0 last:pb-0" key={index}>
<Link className="group flex items-center space-x-3" to={slug}>
<span className="relative flex h-6 w-6 items-center justify-center rounded bg-[linear-gradient(180deg,#EFEFF0_100%,#E4E5E7_100%)] before:absolute before:inset-px before:rounded-[3px] before:bg-[linear-gradient(180deg,#FFF_100%,#FAFAFA_100%)] dark:bg-[linear-gradient(180deg,rgba(255,255,255,0.1)_31.25%,rgba(255,255,255,0.05)_100%)] dark:before:bg-[linear-gradient(180deg,#242628_31.25%,#1D1E20_100%)]">
<Icon className="relative z-10 h-3 w-3 text-gray-new-30 dark:text-gray-new-80" />
</span>
<span className="text-sm font-medium leading-tight transition-colors duration-200 group-hover:text-secondary-8 dark:group-hover:text-green-45">
{title}
</span>
</Link>
</li>
))}
</ul>
</>
<ul className="mb-7">
{MENUS.docSidebar.map(({ icon: Icon, title, slug }, index) => (
<li className="py-[7px] first:pt-0 last:pb-0" key={index}>
<Link className="group flex items-center space-x-3" to={slug}>
<span className="relative flex h-6 w-6 items-center justify-center rounded bg-[linear-gradient(180deg,#EFEFF0_100%,#E4E5E7_100%)] before:absolute before:inset-px before:rounded-[3px] before:bg-[linear-gradient(180deg,#FFF_100%,#FAFAFA_100%)] dark:bg-[linear-gradient(180deg,rgba(255,255,255,0.1)_31.25%,rgba(255,255,255,0.05)_100%)] dark:before:bg-[linear-gradient(180deg,#242628_31.25%,#1D1E20_100%)]">
<Icon className="relative z-10 h-3 w-3 text-gray-new-30 dark:text-gray-new-80" />
</span>
<span className="text-sm font-medium leading-tight transition-colors duration-200 group-hover:text-secondary-8 dark:group-hover:text-green-45">
{title}
</span>
</Link>
</li>
))}
</ul>
)}
<ul className={clsx({ 'mt-2.5': isPostgres })}>
{sidebar.map((item, index) => (
Expand Down
7 changes: 1 addition & 6 deletions src/components/pages/doc/sidebar/sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import PropTypes from 'prop-types';
import Link from 'components/shared/link';
import MENUS from 'constants/menus';

import InkeepTrigger from '../inkeep-trigger';

import Item from './item';

const Search = dynamic(() => import('components/shared/search/search'));
Expand Down Expand Up @@ -52,10 +50,7 @@ const Sidebar = ({ className = null, sidebar, basePath, indexName, isPostgres =
{isPostgres ? (
<NavWithIcon className="mb-8" items={MENUS.postgresSidebar} />
) : (
<>
<InkeepTrigger isSidebar />
<NavWithIcon className="mb-11" items={MENUS.docSidebar} />
</>
<NavWithIcon className="mb-11" items={MENUS.docSidebar} />
)}
<ul className={clsx({ 'mt-14': !isPostgres })}>
{sidebar.map((item, index) => (
Expand Down
Loading