Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Simplify header in docs and add link to dashboard
Vasek Mlejnskybcb99830ed42
diff --git a/apps/docs/config.ts b/apps/docs/config.tsindex 84f9645da..00de4367c 100644--- a/apps/docs/config.ts+++ b/apps/docs/config.ts@@ -1,8 +1,4 @@export const config = {- discord: {- slug: 'U7KEcGErtQ',- api: 'https://discord.com/api/guilds/1092455714431180995/widget.json',- },github: {url: 'https://github.com/e2b-dev/e2b',api: 'https://api.github.com/repos/e2b-dev/e2b',diff --git a/apps/docs/src/app/(dashboard)/api/cli/page.tsx b/apps/docs/src/app/(dashboard)/api/cli/page.tsxindex b02b59cc5..35bb8cbfc 100644--- a/apps/docs/src/app/(dashboard)/api/cli/page.tsx+++ b/apps/docs/src/app/(dashboard)/api/cli/page.tsx@@ -93,7 +93,7 @@ export default function Page() {content = <span className="text-gray-300">Loading, please wait</span>} else if (!user) {content = (- <Link href="/sign-in">+ <Link href="/dashboard/sign-in"><Button>Sign In to continue</Button></Link>)diff --git a/apps/docs/src/app/(dashboard)/dashboard/page.tsx b/apps/docs/src/app/(dashboard)/dashboard/page.tsxindex 1fa49c017..78da53c3c 100644--- a/apps/docs/src/app/(dashboard)/dashboard/page.tsx+++ b/apps/docs/src/app/(dashboard)/dashboard/page.tsx@@ -27,7 +27,6 @@ function redirectToCurrentURL() {return `redirect_to=${encodedURL}`}-// TODO: Sandbox and Templates tab deleted for nowconst menuLabels = ['personal', 'keys', 'usage', 'billing', 'team',] as consttype MenuLabel = typeof menuLabels[number]@@ -116,7 +115,7 @@ export default function Dashboard() {return (<div className='flex flex-col space-y-2 items-center justify-center w-full h-full'><h2 className='text-xl font-bold'>You need to be signed in to use this page</h2>- <Link href={`/sign-in?${redirectToCurrentURL()}`}>+ <Link href={`/dashboard/sign-in?${redirectToCurrentURL()}`}><Button>Sign In</Button></Link></div>diff --git a/apps/docs/src/app/(dashboard)/page.tsx b/apps/docs/src/app/(dashboard)/page.tsxindex ae5557346..4174e994a 100644--- a/apps/docs/src/app/(dashboard)/page.tsx+++ b/apps/docs/src/app/(dashboard)/page.tsx@@ -8,19 +8,19 @@ import Link from 'next/link'export default function Page() {return (<div className="flex flex-col w-full h-full">-+{/* Hero */}<div className="w-full h-screen flex justify-center items-center">-+<div className="flex flex-col z-10 space-y-5 items-center justify-center">-+<a href="https://e2bdev.notion.site/Careers-at-E2B-2163f176991f43f69b0984bf2a142920" target="_blank" rel="noreferrer noopener"><Button variant='outline'>We're hiring 👉</Button></a><h1 className="font-bold p-2 text-6xl bg-clip-text text-transparent bg-gradient-to-r from-white to-orange-500 via-white to-[95%]">Code Interpreting for AI Apps</h1><div className='flex space-x-4'>- <Link href="/sign-in?view=sign-up">+ <Link href="/dashboard/sign-up"><Button variant='filled'>Sign Up</Button></Link><Link href="/docs">@@ -34,9 +34,9 @@ export default function Page() {{/* Features section */}<div className="w-full h-screen flex flex-col items-center bg-gradient-to-b to-90% from-black/50 to-transparent">- <h1 className="font-bold pb-10 text-4xl">- Try the Python & JS/TS SDKs- </h1>+ <h1 className="font-bold pb-10 text-4xl">+ Try the Python & JS/TS SDKs+ </h1><BentoGrid className="w-2/3 flex flex-col space-y-10 pb-10"><BentoCardname="Step 1"@@ -57,9 +57,9 @@ export default function Page() {background={<Background />}/></BentoGrid>- <Button variant='filled'>Get Started</Button>+ <Button variant='filled'>Get Started</Button></div>-+</div>)}diff --git a/apps/docs/src/app/(docs)/docs/getting-started/api-key/APIKey.tsx b/apps/docs/src/app/(docs)/docs/getting-started/api-key/APIKey.tsxindex 8eb0345b1..86f9c9b42 100644--- a/apps/docs/src/app/(docs)/docs/getting-started/api-key/APIKey.tsx+++ b/apps/docs/src/app/(docs)/docs/getting-started/api-key/APIKey.tsx@@ -117,7 +117,7 @@ function APIKey() {) : (<div className="flex flex-col items-start justiy-start gap-4 mt-6"><span>You can get your API key by signing up.</span>- <Link href="/sign-in?view=sign-up">+ <Link href="/dashboard/sign-up"><Button>Sign up to get your API key</Button></Link></div>diff --git a/apps/docs/src/app/(docs)/docs/pricing/SwitchToHobbyButton.tsx b/apps/docs/src/app/(docs)/docs/pricing/SwitchToHobbyButton.tsxindex c40554a01..0a0919f6d 100644--- a/apps/docs/src/app/(docs)/docs/pricing/SwitchToHobbyButton.tsx+++ b/apps/docs/src/app/(docs)/docs/pricing/SwitchToHobbyButton.tsx@@ -25,7 +25,7 @@ function SwitchToHobbyButton({ team }: { team: Team }) {if (!user) {return (- <Link href="/sign-in?view=sign-up">+ <Link href="/dashboard/sign-up"><Button>Sign Up</Button></Link>)diff --git a/apps/docs/src/app/(docs)/docs/pricing/SwitchToProButton.tsx b/apps/docs/src/app/(docs)/docs/pricing/SwitchToProButton.tsxindex 778f8a99b..1cbd2688c 100644--- a/apps/docs/src/app/(docs)/docs/pricing/SwitchToProButton.tsx+++ b/apps/docs/src/app/(docs)/docs/pricing/SwitchToProButton.tsx@@ -51,7 +51,7 @@ function SwitchTierButton({ team }: { team: Team }) {if (!user) {return (- <Link href="/sign-in?view=sign-up">+ <Link href="/dashboard/sign-up"><Button>Sign Up</Button></Link>)diff --git a/apps/docs/src/components/Auth.tsx b/apps/docs/src/components/Auth.tsxindex 2ab324598..14f79d497 100644--- a/apps/docs/src/components/Auth.tsx+++ b/apps/docs/src/components/Auth.tsx@@ -40,7 +40,7 @@ export const Auth = function () {<span className="text-sm text-red-500" title={error?.message}>Something went wrong</span>- <Link href={`/sign-in?${redirectToCurrentURL()}`}>+ <Link href={`/dashboard/sign-in?${redirectToCurrentURL()}`}><Button>Sign In</Button></Link></div>@@ -73,16 +73,7 @@ export const Auth = function () {</div>) : (<div className="flex items-center justify-center gap-3">- <Link href={`/sign-in?view=sign-up&${redirectToCurrentURL()}`}>- <Button- variant="textTernary"- className="whitespace-nowrap text-xs"- >- Sign up to get your API key- </Button>- </Link>-- <Link href={`/sign-in?${redirectToCurrentURL()}`}>+ <Link href={`/dashboard/sign-in?${redirectToCurrentURL()}`}><Button>Sign In</Button></Link></div>diff --git a/apps/docs/src/components/Header.tsx b/apps/docs/src/components/Header.tsxindex 9bb63b731..cbc39137a 100644--- a/apps/docs/src/components/Header.tsx+++ b/apps/docs/src/components/Header.tsx@@ -7,8 +7,6 @@ import { Logo } from '@/components/Logo'import { MobileSearch, Search } from '@/components/Search'import { Auth } from '@/components/Auth'import { HeaderSeparator } from '@/components/HeaderUtils'-import { DiscordIcon } from '@/components/icons/DiscordIcon'-import { TwitterIcon } from '@/components/icons/TwitterIcon'import { useLocalStorage } from 'usehooks-ts'import { GitHubIcon } from '@/components/icons/GitHubIcon'@@ -26,12 +24,6 @@ export const Header = forwardRef(function Header({ className, isAuth }, ref) {const isInsideMobileNavigation = useIsInsideMobileNavigation()const [githubStars, setGithubStars] = useLocalStorage('github-stars', null)- const [discordUsers, setDiscordUsers] = useLocalStorage('discord-users', null)- // TODO: Maybe add Twitter followers count?- // const [twitterFollowers, setTwitterFollowers] = useLocalStorage(- // 'twitter-followers',- // null,- // )const { scrollY } = useScroll()const bgOpacityLight = useTransform(scrollY, [0, 72], [0.5, 0.9])@@ -44,29 +36,13 @@ export const Header = forwardRef(function Header({ className, isAuth }, ref) {.catch(() => setGithubStars(null))}, [setGithubStars])- useEffect(() => {- fetch(config.discord.api)- .then(response => response.json())- .then(async data => setDiscordUsers(data.presence_count))- .catch(() => setDiscordUsers(null))- }, [setDiscordUsers])-- // TODO: Maybe add Twitter followers count?- // useEffect(() => {- // fetch(config.twitter.api)- // .then((response) => response.json())- // .then(async (data) => setTwitterFollowers(data.followers_count))- // .catch(() => setTwitterFollowers(false))- // setTwitterFollowers(155)- // }, [])-return (<motion.div// @ts-ignoreref={ref}className={clsx(className,- 'fixed inset-x-0 top-0 z-50 flex h-14 items-center justify-between gap-12 px-4 transition sm:px-6 lg:z-30 lg:px-8 bg-green-500',+ 'fixed inset-x-0 top-0 z-50 flex h-14 items-center justify-between gap-12 px-4 transition sm:px-6 lg:z-30 lg:px-8',!isInsideMobileNavigation && 'backdrop-blur-sm dark:backdrop-blur',)}style={@@ -107,27 +83,20 @@ export const Header = forwardRef(function Header({ className, isAuth }, ref) {role="list"className="flex items-center gap-4">- <TopLevelNavItem- href={`https://discord.gg/${config.discord.slug}`}- stat={discordUsers}- statType="discordUsers"- icon={<DiscordIcon className="h-5 w-5 fill-current" />}- /><TopLevelNavItemhref={config.github.url}stat={githubStars}statType="githubStars"icon={<GitHubIcon className="h-5 w-5 fill-current" />}/>- <TopLevelNavItem- href={config.twitter.url}- icon={<TwitterIcon className="h-5 w-5 fill-current" />}- /></ul></nav><HeaderSeparator /><MobileSearch /><div className="hidden min-[540px]:contents">+ <Link className='hover:text-white hover:cursor-pointer text-sm text-neutral-400' href='/dashboard'>+ Dashboard+ </Link><Auth /></div></div>diff --git a/apps/docs/src/components/TopLevelNavItem.tsx b/apps/docs/src/components/TopLevelNavItem.tsxindex 17ba54a64..f03cbb487 100644--- a/apps/docs/src/components/TopLevelNavItem.tsx+++ b/apps/docs/src/components/TopLevelNavItem.tsx@@ -1,11 +1,11 @@import Link from 'next/link'export default function TopLevelNavItem({- href,- stat,- statType,- icon,- }: {+ href,+ stat,+ statType,+ icon,+}: {href: stringstat?: number | nullstatType?: string@@ -21,7 +21,7 @@ export default function TopLevelNavItem({href={href}className="flex items-center- text-zinc-600+ text-zinc-600dark:text-zinc-400 dark:hover:text-white">@@ -30,16 +30,15 @@ export default function TopLevelNavItem({gridwhitespace-nowrap text-xsfont-medium- dark:text-white+ dark:text-white"- /* TODO: Add animation, but it's not so easy as it sounds */style={{gridTemplateColumns: stat ? '1fr' : '0fr',marginRight: stat ? '0.4rem' : '0',}}><div className="overflow-hidden">- <strong>{statFormatted}</strong> {statText}+ <strong>{statFormatted?.toLocaleString()}</strong> {statText}</div></span>