Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Style the auth form

Vasek Mlejnskyfe02a6b9a389
diff --git a/apps/docs/src/app/layout.tsx b/apps/docs/src/app/layout.tsx
index c8b468f02..1276dfcda 100644
--- a/apps/docs/src/app/layout.tsx
+++ b/apps/docs/src/app/layout.tsx
@@ -11,6 +11,8 @@ import { Section } from '@/components/SectionProvider'
import Canonical from '@/components/Navigation/canonical'
export const metadata: Metadata = {
+ // TODO: Add metadataBase
+ // metadataBase: ''
title: {
template: '%s - E2B Docs',
default: 'E2B Docs - Runtime Sandbox for LLM Apps',
diff --git a/apps/docs/src/components/AuthForm.tsx b/apps/docs/src/components/AuthForm.tsx
index 21251126e..a75356f7f 100644
--- a/apps/docs/src/components/AuthForm.tsx
+++ b/apps/docs/src/components/AuthForm.tsx
@@ -2,8 +2,8 @@
import { Auth } from '@supabase/auth-ui-react'
import {
- ThemeSupa,
ViewType,
+ ThemeSupa,
} from '@supabase/auth-ui-shared'
import { createClientComponentClient } from '@supabase/auth-helpers-nextjs'
import { useSearchParams, useRouter } from 'next/navigation'
@@ -44,18 +44,17 @@ function AuthForm() {
return (
- <div className="flex flex-1 justify-center items-center flex-col">
- <span className="text-3xl pb-2">
+ <div className="mx-auto flex flex-1 max-w-[320px] justify-center items-center flex-col">
+ <h1 className="text-4xl font-bold mt-8 mb-4">
{view === 'sign_in' && 'Sign in to E2B'}
{view === 'sign_up' && 'Sign up to E2B'}
{view === 'forgotten_password' && 'Reset password'}
- </span>
+ </h1>
<div className="flex">
<Auth
supabaseClient={supabase}
appearance={{
theme: ThemeSupa,
- // TODO: Customize auth styling — https://supabase.com/docs/guides/auth/auth-helpers/auth-ui#customization
}}
view={view}
theme="dark"
@@ -68,26 +67,37 @@ function AuthForm() {
/>
</div>
<div className="flex flex-1 flex-col space-x-2">
- {view !== 'sign_in' && <Button
- onClick={() => setView('sign_in')}
- variant="textSubtle"
- >
- Already have an account? Sign in
- </Button>
+ {view === 'sign_up' &&
+ <div className="flex items-center justify-start gap-2">
+ <span className="text-zinc-400">Already have an account?</span>
+ <Button
+ onClick={() => setView('sign_in')}
+ variant="textLink"
+ >
+ Sign in
+ </Button>
+ </div>
}
- {view === 'sign_in' && <Button
- onClick={() => setView('forgotten_password')}
- variant="textSubtle"
- >
- Forgot your password?
- </Button>
+
+ {view === 'sign_in' &&
+ <Button
+ onClick={() => setView('forgotten_password')}
+ variant="textSubtle"
+ >
+ Forgot your password?
+ </Button>
}
- {view === 'sign_in' && <Button
- onClick={() => setView('sign_up')}
- variant="textSubtle"
- >
- {'Don\'t have an account? Sign up'}
- </Button>
+
+ {view === 'sign_in' &&
+ <div className="flex items-center justify-start gap-2">
+ <span className="text-zinc-400">{'Don\'t have an account?'}</span>
+ <Button
+ onClick={() => setView('sign_up')}
+ variant="textLink"
+ >
+ Sign up
+ </Button>
+ </div>
}
</div>
</div >
diff --git a/apps/docs/src/components/Button.tsx b/apps/docs/src/components/Button.tsx
index adc6ad02c..a6e96b034 100644
--- a/apps/docs/src/components/Button.tsx
+++ b/apps/docs/src/components/Button.tsx
@@ -34,7 +34,7 @@ const variantStyles = {
textLink:
'text-brand-500 hover:text-brand-600 dark:text-brand-400 dark:hover:text-brand-500 underline decoration-2 decoration-brand-500/30',
textSubtle:
- 'text-zinc-500 hover:text-zinc-600 dark:text-zinc-400 dark:hover:text-zinc-500 underline', // same as text, but gray-ish
+ 'text-sm text-zinc-500 hover:text-zinc-600 dark:text-zinc-400 dark:hover:text-zinc-500 underline', // same as text, but gray-ish
textTernary:
'text-yellow-500 hover:text-yellow-600 dark:text-yellow-400 dark:hover:text-yellow-500', // same as text, but gray-ish
}
@@ -44,18 +44,18 @@ type ButtonProps = {
disabled?: boolean
arrow?: 'left' | 'right'
} & (
- | React.ComponentPropsWithoutRef<typeof Link>
- | (React.ComponentPropsWithoutRef<'button'> & { href?: undefined })
+ | React.ComponentPropsWithoutRef<typeof Link>
+ | (React.ComponentPropsWithoutRef<'button'> & { href?: undefined })
)
export function Button({
- variant = 'primary',
- disabled = false,
- className,
- children,
- arrow,
- ...props
- }: ButtonProps) {
+ variant = 'primary',
+ disabled = false,
+ className,
+ children,
+ arrow,
+ ...props
+}: ButtonProps) {
className = clsx(
'inline-flex gap-0.5 justify-center overflow-hidden text-base font-medium transition',
variantStyles[variant],
diff --git a/apps/docs/src/styles/tailwind.css b/apps/docs/src/styles/tailwind.css
index 0dd816af1..6ffeb2532 100644
--- a/apps/docs/src/styles/tailwind.css
+++ b/apps/docs/src/styles/tailwind.css
@@ -41,6 +41,12 @@
#sidebar::-webkit-scrollbar-thumb {
border-radius: 10px;
}
+
+ #auth-sign-up button, #auth-sign-in button {
+ border: none;
+ @apply text-base font-medium transition;
+ @apply bg-zinc-900 py-1 px-3 text-white hover:bg-zinc-700 dark:bg-brand-400/10 dark:text-brand-400 dark:ring-1 dark:ring-inset dark:ring-brand-400/20 dark:hover:bg-brand-400/10 dark:hover:text-brand-300 dark:hover:ring-brand-300;
+ }
}
/* Shadcn */