Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Update navigation sidebar
Vasek Mlejnsky895c5f360fe4
diff --git a/apps/web/src/components/Footer.tsx b/apps/web/src/components/Footer.tsxindex eaa89f506..1cd0fbb87 100644--- a/apps/web/src/components/Footer.tsx+++ b/apps/web/src/components/Footer.tsx@@ -100,21 +100,18 @@ function SocialLink({function SmallPrint() {return (- <div className="flex flex-col w-full items-center px-10 justify-between gap-5 pt-8 dark:border-white/5 sm:flex-row">+ <div className="flex flex-col w-full items-center justify-between gap-5 pt-8 dark:border-white/5 sm:flex-row"><div className="flex flex-col items-center justify-start lg:items-start"><p className="text-xs text-zinc-600 dark:text-zinc-400">© FoundryLabs, Inc. {new Date().getFullYear()}. All rights reserved.</p>- <p className="text-xs text-zinc-600 dark:text-zinc-400">- 548 Market Street #83122, San Francisco, CA 94104- </p></div><div className="flex gap-4"><SocialLink- href="https://twitter.com/e2b_dev"+ href="https://x.com/e2b_dev"icon={TwitterIcon}>- Follow us on Twitter+ Follow us on X (f.k.a. Twitter)</SocialLink><SocialLinkhref="https://github.com/e2b-dev"diff --git a/apps/web/src/components/Header.tsx b/apps/web/src/components/Header.tsxindex 5b504ead0..1f5e47070 100644--- a/apps/web/src/components/Header.tsx+++ b/apps/web/src/components/Header.tsx@@ -4,11 +4,13 @@ import { forwardRef, useEffect } from 'react'import Link from 'next/link'import clsx from 'clsx'import { motion, useScroll, useTransform } from 'framer-motion'-import { MobileNavigation, useIsInsideMobileNavigation, useMobileNavigationStore } from '@/components/MobileNavigation'+import {+ MobileBurgerMenu,+ useIsInsideMobileNavigation,+ useMobileNavigationStore,+} from '@/components/MobileBurgerMenu'import { Logo } from '@/components/Logo'import { MobileSearch, Search } from '@/components/Search'-import { Auth } from '@/components/Auth'-import { HeaderSeparator } from '@/components/HeaderUtils'import { useLocalStorage } from 'usehooks-ts'import { GitHubIcon } from '@/components/icons/GitHubIcon'@@ -16,6 +18,22 @@ import dynamic from 'next/dynamic'import { config } from '../../config'import { usePathname } from 'next/navigation'++function DocumentationTypeLink({ pathname, href, title }: { pathname: string | null, href: string, title: string }) {+ if (!pathname) return null+ return (+ <Link+ className={clsx(+ 'hover:text-white hover:cursor-pointer text-sm font-medium px-2 py-1 rounded-md',+ pathname.startsWith(href) ? 'text-white bg-zinc-800' : 'text-neutral-400'+ )}+ href={href}+ >+ {title}+ </Link>+ )+}+// No SSR to avoid hydration mismatchconst TopLevelNavItem = dynamic(() => import('@/components/TopLevelNavItem'), {ssr: false,@@ -67,17 +85,25 @@ export const Header = forwardRef(function Header({ className }, ref) {'bg-zinc-900/7.5 dark:bg-white/7.5',)}/>- <div className="relative top-1 hidden items-start justify-start lg:flex">++ {/* Desktop logo */}+ <div className="relative top-1 hidden items-center justify-start lg:flex gap-4"><Linkhref="/"aria-label="Home"><Logo className="h-6" /></Link>+ <div className='flex items-center gap-1'>+ <DocumentationTypeLink pathname={pathname} href="/docs" title="Documentation" />+ <DocumentationTypeLink pathname={pathname} href="/docs/reference" title="Reference" />+ </div></div>{isDocs && <Search />}++ {/* Mobile logo + burger menu */}<div className="flex items-center gap-5 lg:hidden">- <MobileNavigation />+ <MobileBurgerMenu /><Linkhref="/"aria-label="Home"@@ -85,33 +111,34 @@ export const Header = forwardRef(function Header({ className }, ref) {<Logo className="h-6" /></Link></div>- {!isAuth && <div className="flex items-center gap-4">- <nav className="hidden md:block">- <ul- role="list"- className="flex items-center gap-4"- >- <TopLevelNavItem- href={config.github.url}- stat={githubStars}- statType="githubStars"- icon={<GitHubIcon className="h-5 w-5 fill-current" />}- />- </ul>- </nav>- <HeaderSeparator />- {isDocs && <MobileSearch />}- <div className="hidden min-[540px]:contents">- <Link className='hover:text-white hover:cursor-pointer text-sm text-neutral-400' href='/docs'>- Docs- </Link>- <Link className='hover:text-white hover:cursor-pointer text-sm text-neutral-400' href='/dashboard'>- Dashboard- </Link>- <HeaderSeparator />- <Auth />++ {!isAuth &&+ <div className="flex items-center gap-4">+ <nav className="hidden md:block">+ <ul+ role="list"+ className="flex items-center gap-4"+ >+ <TopLevelNavItem+ href={config.github.url}+ stat={githubStars}+ statType="githubStars"+ icon={<GitHubIcon className="h-5 w-5 fill-current" />}+ />+ </ul>+ </nav>+ {isDocs && <MobileSearch />}+ {/* <div className="hidden min-[540px]:contents">+ <Link className='hover:text-white hover:cursor-pointer text-sm text-neutral-400' href='/docs'>+ Docs+ </Link>+ <Link className='hover:text-white hover:cursor-pointer text-sm text-neutral-400' href='/dashboard'>+ Dashboard+ </Link>+ <HeaderSeparator />+ <Auth />+ </div> */}</div>- </div>}</motion.div>)diff --git a/apps/web/src/components/HeaderDashboard.tsx b/apps/web/src/components/HeaderDashboard.tsxdeleted file mode 100644index c7469fc1a..000000000--- a/apps/web/src/components/HeaderDashboard.tsx+++ /dev/null@@ -1,35 +0,0 @@-import Link from 'next/link'-import { Logo } from '@/components/Logo'-import { Auth } from '@/components/Auth'-import { HeaderSeparator } from '@/components/HeaderUtils'--export function HeaderDashboard() {- return (- <div- className="h-14 border border-zinc-900/5 dark:border-white/5 flex items-center justify-between gap-12 px-4 transition sm:px-6 lg:px-8"- >- <div className="items-start justify-start lg:flex">- <Link href="/" aria-label="Home">- <Logo className="h-6" />- </Link>- </div>-- <div className="flex justify-center items-center space-x-5">- <div className="flex items-center justify-center text-sm space-x-3 text-neutral-400">- <Link className='hover:text-white hover:cursor-pointer' href='/docs'>- Docs- </Link>- <Link className='hover:text-white hover:cursor-pointer' href='/dashboard'>- Dashboard- </Link>- </div>-- <div className="flex items-center gap-5">- <HeaderSeparator />- <Auth />- </div>- </div>-- </div>- )-}diff --git a/apps/web/src/components/MobileNavigation.tsx b/apps/web/src/components/MobileBurgerMenu.tsxsimilarity index 93%rename from apps/web/src/components/MobileNavigation.tsxrename to apps/web/src/components/MobileBurgerMenu.tsxindex d65649b6b..54cd987b6 100644--- a/apps/web/src/components/MobileNavigation.tsx+++ b/apps/web/src/components/MobileBurgerMenu.tsx@@ -18,7 +18,7 @@ function MenuIcon(props: React.ComponentPropsWithoutRef<'svg'>) {aria-hidden="true"{...props}>- <path d="M.5 1h9M.5 8h9M.5 4.5h9"/>+ <path d="M.5 1h9M.5 8h9M.5 4.5h9" /></svg>)}@@ -32,7 +32,7 @@ function XIcon(props: React.ComponentPropsWithoutRef<'svg'>) {aria-hidden="true"{...props}>- <path d="m1.5 1 7 7M8.5 1l-7 7"/>+ <path d="m1.5 1 7 7M8.5 1l-7 7" /></svg>)}@@ -40,9 +40,9 @@ function XIcon(props: React.ComponentPropsWithoutRef<'svg'>) {const IsInsideMobileNavigationContext = createContext(false)function MobileNavigationDialog({- isOpen,- close,- }: {+ isOpen,+ close,+}: {isOpen: booleanclose: () => void}) {@@ -91,7 +91,7 @@ function MobileNavigationDialog({leaveFrom="opacity-100"leaveTo="opacity-0">- <div className="fixed inset-0 top-14 bg-zinc-400/20 backdrop-blur-sm dark:bg-black/40"/>+ <div className="fixed inset-0 top-14 bg-zinc-400/20 backdrop-blur-sm dark:bg-black/40" /></Transition.Child><Dialog.Panel>@@ -104,7 +104,7 @@ function MobileNavigationDialog({leaveFrom="opacity-100"leaveTo="opacity-0">- <Header/>+ <Header /></Transition.Child><Transition.Child@@ -120,7 +120,7 @@ function MobileNavigationDialog({layoutScrollclassName="fixed bottom-0 left-0 top-14 w-full overflow-y-auto overflow-x-hidden bg-white px-4 pb-4 pt-6 shadow-lg shadow-zinc-900/10 ring-1 ring-zinc-900/7.5 dark:bg-zinc-900 dark:ring-zinc-800 min-[416px]:max-w-sm sm:px-6 sm:pb-10">- <Navigation/>+ <Navigation /></motion.div></Transition.Child></Dialog.Panel>@@ -145,7 +145,7 @@ export const useMobileNavigationStore = create<{toggle: () => set(state => ({ isOpen: !state.isOpen })),}))-export function MobileNavigation() {+export function MobileBurgerMenu() {const isInsideMobileNavigation = useIsInsideMobileNavigation()const { isOpen, toggle, close } = useMobileNavigationStore()const ToggleIcon = isOpen ? XIcon : MenuIcon@@ -158,7 +158,7 @@ export function MobileNavigation() {aria-label="Toggle navigation"onClick={toggle}>- <ToggleIcon className="w-2.5 stroke-zinc-900 dark:stroke-white"/>+ <ToggleIcon className="w-2.5 stroke-zinc-900 dark:stroke-white" /></button>{!isInsideMobileNavigation && (<Suspense fallback={null}>diff --git a/apps/web/src/components/Navigation/NavigationLink.tsx b/apps/web/src/components/Navigation/NavigationLink.tsxindex 7e105f092..59d0611ba 100644--- a/apps/web/src/components/Navigation/NavigationLink.tsx+++ b/apps/web/src/components/Navigation/NavigationLink.tsx@@ -23,7 +23,7 @@ export function NavigationLink({href={link.href}aria-current={isActive ? 'page' : undefined}className={clsx(- 'flex justify-between py-1 px-2 text-sm transition rounded-md hover:bg-zinc-800 transition-colors',+ 'flex justify-between mb-[2px] py-1 px-2 text-sm transition rounded-md hover:bg-zinc-800 transition-colors',isActive? 'text-white bg-zinc-800': 'hover:text-white text-zinc-400 bg-transparent',diff --git a/apps/web/src/components/Navigation/index.tsx b/apps/web/src/components/Navigation/index.tsxindex 901381c43..4c19245e8 100644--- a/apps/web/src/components/Navigation/index.tsx+++ b/apps/web/src/components/Navigation/index.tsx@@ -7,7 +7,7 @@ import {motion,} from 'framer-motion'-import { useIsInsideMobileNavigation } from '@/components/MobileNavigation'+import { useIsInsideMobileNavigation } from '@/components/MobileBurgerMenu'import { useSectionStore } from '@/components/SectionProvider'import {routes,@@ -40,12 +40,15 @@ function NavigationGroup({ group, className, isLast }: { group: NavGroup; classNreturn (<li className={clsx('relative', className)}>- <motion.h2- layout="position"- className="pl-2 text-2xs font-medium text-white mb-1"- >- {group.title}- </motion.h2>+ <div className="pl-2 mb-1 flex items-center justify-start gap-1">+ {group.icon}+ <motion.h2+ layout="position"+ className="text-2xs font-medium text-white"+ >+ {group.title}+ </motion.h2>+ </div><div className="relative"><ulrole="list"diff --git a/apps/web/src/components/Navigation/routes.tsx b/apps/web/src/components/Navigation/routes.tsxindex 1658bebac..6ac54d172 100644--- a/apps/web/src/components/Navigation/routes.tsx+++ b/apps/web/src/components/Navigation/routes.tsx@@ -1,13 +1,6 @@import {Home,// BarChart,- // BookOpen,- // Braces,- // ChevronRightSquare,- // Cog,- // Cpu,- // DollarSign,- // File,// FileDown,// FileUp,// Folder,@@ -77,6 +70,7 @@ export interface NavSubgroup {export interface NavGroup {title?: string+ icon?: React.ReactNodeitems: Array<NavLink | NavSubgroup>// links?: NavLink[]// subgroups?: NavSubgroup[]@@ -152,23 +146,6 @@ export const routes: NavGroup[] = [{title: 'AI Code Execution',items: [- {- title: 'Data analysis',- links: [- {- title: 'Overview',- href: '/docs/hello-world/py',- },- {- title: 'Data visualization',- href: '/docs/code-execution/overview',- },- {- title: 'Interactive charts',- href: '/docs/code-execution/overview',- },- ]- },{title: 'Python',href: '/docs/code-execution/python',@@ -185,6 +162,23 @@ export const routes: NavGroup[] = [title: 'Custom language',href: '/docs/code-execution/python',},+ {+ title: 'AI data analysis',+ links: [+ {+ title: 'Overview',+ href: '/docs/hello-world/py',+ },+ {+ title: 'Data visualization',+ href: '/docs/code-execution/overview',+ },+ {+ title: 'Interactive charts',+ href: '/docs/code-execution/overview',+ },+ ]+ },],},{@@ -220,7 +214,19 @@ export const routes: NavGroup[] = [title: 'Overview',href: '/docs/process/overview',},-+ ]+ },+ {+ title: 'CLI',+ items: [+ {+ title: 'List running sandboxes',+ href: '/docs/cli/list',+ },+ {+ title: 'Kill all sandboxes',+ href: '/docs/cli/kill-all',+ },]},{