Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Add links to navigate between SDK reference and docs

Vasek Mlejnsky621c63cd4cef
diff --git a/apps/web/src/components/Header.tsx b/apps/web/src/components/Header.tsx
index be4babcd0..d275a8f59 100644
--- a/apps/web/src/components/Header.tsx
+++ b/apps/web/src/components/Header.tsx
@@ -93,7 +93,7 @@ export const Header = forwardRef(function Header({ className }, ref) {
className={clsx(
'absolute inset-x-0 top-full h-px transition',
(isInsideMobileNavigation || !mobileNavIsOpen) &&
- 'bg-zinc-900/7.5 dark:bg-white/7.5'
+ 'bg-zinc-900/7.5 dark:bg-white/7.5'
)}
/>
@@ -108,11 +108,6 @@ export const Header = forwardRef(function Header({ className }, ref) {
href="/docs"
title="Documentation"
/>
- <DocumentationTypeLink
- pathname={pathname}
- href="/docs/sdk-reference"
- title="SDK Reference"
- />
<DocumentationTypeLink
pathname={pathname}
href="/dashboard"
@@ -134,11 +129,6 @@ export const Header = forwardRef(function Header({ className }, ref) {
href="/docs"
title="Documentation"
/>
- <DocumentationTypeLink
- pathname={pathname}
- href="/docs/sdk-reference"
- title="SDK Reference"
- />
<DocumentationTypeLink
pathname={pathname}
href="/dashboard"
diff --git a/apps/web/src/components/Navigation/DocsTypeItems.tsx b/apps/web/src/components/Navigation/DocsTypeItems.tsx
new file mode 100644
index 000000000..bd420b500
--- /dev/null
+++ b/apps/web/src/components/Navigation/DocsTypeItems.tsx
@@ -0,0 +1,31 @@
+import Link from 'next/link'
+import { BookIcon, BracesIcon } from 'lucide-react'
+
+function Item({
+ href,
+ icon,
+ title,
+}: {
+ href: string
+ icon: React.ReactNode
+ title: string
+}) {
+ return (
+ <Link href={href} className="text-xs text-brand-400 flex items-center gap-2 group p-1 transition-all">
+ <div className="flex items-center justify-center p-2 rounded-md bg-gradient-to-b from-gray-700 to-gray-900 shadow-md group-hover:bg-gradient-to-b group-hover:from-brand-800 group-hover:to-brand-400 border border-white/20 group-hover:border-brand-400">
+ {icon}
+ </div>
+ <span className="font-semibold text-zinc-400 group-hover:text-white">{title}</span>
+ </Link>
+ )
+}
+
+export function DocsTypes() {
+ return (
+ <>
+ <Item href="/docs" icon={<BookIcon className="w-4 h-4 text-white" />} title="Documentation" />
+ <Item href="/docs/sdk-reference" icon={<BracesIcon className="w-4 h-4 text-white" />} title="SDK Reference" />
+ <li className="h-px bg-white/5 my-4"></li>
+ </>
+ )
+}
diff --git a/apps/web/src/components/Navigation/index.tsx b/apps/web/src/components/Navigation/index.tsx
index 1914344f1..e49e080a7 100644
--- a/apps/web/src/components/Navigation/index.tsx
+++ b/apps/web/src/components/Navigation/index.tsx
@@ -10,6 +10,7 @@ import { useSectionStore } from '@/components/SectionProvider'
import { SdkVersionSelect } from '@/components/SdkVersionSelect'
import { NavigationLink } from './NavigationLink'
import { NavigationSubgroup } from './NavigationSubgroup'
+import { DocsTypes } from './DocsTypeItems'
import {
NavGroup,
NavLink,
@@ -161,7 +162,8 @@ function VersionedNavigationGroup({
export function DocsNavigation(props) {
return (
<nav {...props}>
- <ul role="list">
+ <ul role="list" className="space-y-2">
+ <DocsTypes />
{docRoutes.map((group, groupIndex) => (
<NavigationGroup
key={groupIndex}
@@ -178,7 +180,8 @@ export function DocsNavigation(props) {
export function SdkRefNavigation(props) {
return (
<nav {...props}>
- <ul role="list">
+ <ul role="list" className="space-y-2">
+ <DocsTypes />
{sdkRefRoutes.map((group, groupIndex) => (
<VersionedNavigationGroup
key={groupIndex}