Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Improve styling

Jakub Novakc294bc96e462
diff --git a/apps/dashboard/components/Settings.tsx b/apps/dashboard/components/Settings.tsx
index 889faee6c..260694f1d 100644
--- a/apps/dashboard/components/Settings.tsx
+++ b/apps/dashboard/components/Settings.tsx
@@ -1,7 +1,6 @@
import { User } from '@supabase/auth-helpers-nextjs'
import { CopyIcon } from 'lucide-react'
-import {usePostHog} from 'posthog-js/react'
-import Link from 'next/link'
+import { usePostHog } from 'posthog-js/react'
export interface Props {
@@ -9,46 +8,50 @@ export interface Props {
user: User
}
-export default function Settings({user, apiKey}: Props) {
+
+export default function Settings({ user, apiKey }: Props) {
const posthog = usePostHog()
+ const copyIcon = <CopyIcon
+ onClick={() => onClick()}
+ className="cursor-pointer ml-auto text-indigo-400 hover:text-indigo-200"
+ size={20}
+ />
+ const items = [
+ {
+ title: 'Email',
+ value: user.email,
+ icon: null,
+ description: null
+ },
+ {
+ title: 'API Key',
+ value: apiKey.substring(0, 6) + '*'.repeat(18) + apiKey.substring(apiKey.length - 8),
+ icon: copyIcon,
+ description: 'Using e2b cloud enviroments requires an API Key for every request. You can use the keys below in the e2b SDK library.'
+ }
+ ]
const onClick = () => {
navigator.clipboard.writeText(apiKey)
posthog?.capture('copied API key')
}
return (
<>
- <div className="lg:w-3/4 align-middle lg:mx-12 lg:flex lg:gap-x-4 lg:px-2">
- <main className=" px-6 lg:flex-auto lg:px-0 lg:py-10">
- <div className="mx-auto space-y-16 sm:space-y-20 lg:mx-0 lg:max-w-none">
- <div>
- <h2 className="text-base font-semibold leading-7 text-white">Profile</h2>
- <dl className="mt-6 space-y-6 divide-y divide-gray-100 border-t border-gray-200 text-white leading-6">
- <div className="pt-6 sm:flex">
- <dt className="font-medium text-white sm:w-64 sm:flex-none sm:pr-6">Email</dt>
- <dd className="mt-1 mr-2 flex justify-end gap-x-6 sm:mt-0 sm:flex-auto">
- <div className="text-white">{user.email}</div>
- </dd>
- </div>
- </dl>
- </div>
-
- <div>
- <h2 className="text-base font-semibold leading-7 text-white">API Key</h2>
- <p className="mt-1 text-sm leading-6 text-gray-300">Use in <Link className="text-indigo-400" href={'https://github.com/e2b-dev/e2b/tree/main/packages/python-sdk'}>e2b SDK</Link>.</p>
-
- <ul role="list" className="mt-6 divide-y divide-gray-100 border-t border-gray-200 text-sm leading-6">
- <li className="flex justify-between gap-x-6 px-3 py-6">
- <div className="font-medium text-white">{apiKey.substring(0,6) + '*'.repeat(8) + apiKey.substring(apiKey.length-8)}</div>
- <CopyIcon
- onClick={() => onClick()}
- className="cursor-pointer text-indigo-400 hover:text-indigo-200"
- size={18}
- />
- </li>
- </ul>
+ <div className="lg:w-4/5 align-middle xl:mx-12 xl:flex xl:gap-x-4 xl:px-2">
+ <main className=" px-6 xl:flex-auto xl:px-0 py-4 xl:py-10">
+ <div className="mx-auto space-y-4 lg:space-y-6">
+ <h2 className="text-base font-semibold leading-7 text-white">Profile</h2>
+ <dl className="my-4 divide-y divide-gray-100 border-t border-gray-400 text-white leading-6" />
- </div>
+ {items.map(item => (<div key={item.title} className="flex flex-col">
+ <h2 className="font-semibold leading-7 text-white">{item.title}</h2>
+ {item.description && <p className='mb-2 text-sm'>{item.description}</p>}
+ <div className="flex w-full align-middle items-center flex-wrap my-1 px-2 py-1 border-2 border-gray-500 bg-gray-700 rounded-md">
+ <div className="text-white">{item.value}</div>
+ {item.icon}
+ </div>
+ </div>))}
+
</div>
</main>
</div>
diff --git a/apps/dashboard/components/Sidebar/DashboardDesktopSidebar.tsx b/apps/dashboard/components/Sidebar/DashboardDesktopSidebar.tsx
index ef2795c04..ebd77e3aa 100644
--- a/apps/dashboard/components/Sidebar/DashboardDesktopSidebar.tsx
+++ b/apps/dashboard/components/Sidebar/DashboardDesktopSidebar.tsx
@@ -4,6 +4,7 @@ import { useRouter } from 'next/router'
import { usePostHog } from 'posthog-js/react'
import { Navigation } from './navigation'
+import { LogOut } from 'lucide-react'
export interface Props {
onSignOut: () => void
@@ -36,7 +37,7 @@ function DashboardDesktopSidebar({
router.pathname === '/'
? 'bg-[#1F2437] text-white'
: 'text-gray-400 hover:text-white hover:bg-[#1F2437]',
- 'group gap-x-3 rounded-md transition-all px-2 py-1 text-sm leading-6 font-semibold flex items-center'
+ 'group gap-x-3 rounded-md transition-all px-2 py-1 leading-6 font-semibold flex items-center'
)}
onClick={() => {
posthog?.capture('clicked navigation item', {
@@ -53,13 +54,14 @@ function DashboardDesktopSidebar({
</li>
<li className="-mx-6 mt-auto">
<div
- className="flex items-center gap-x-4 px-6 text-sm font-semibold leading-6 text-white"
+ className="flex items-center gap-x-4 px-6 font-semibold leading-6 text-white"
>
<button
- className="text-sm font-semibold text-gray-400 hover:text-white transition-all"
+ className="flex items-center align-middle space-x-3 font-semibold text-gray-400 hover:text-white transition-all"
onClick={onSignOut}
>
- Sign out
+ <LogOut size={18} />
+ <span>Sign out</span>
</button>
</div>
</li>
diff --git a/apps/dashboard/components/Sidebar/DashboardMobileSidebar.tsx b/apps/dashboard/components/Sidebar/DashboardMobileSidebar.tsx
index da2904e11..7fc6af835 100644
--- a/apps/dashboard/components/Sidebar/DashboardMobileSidebar.tsx
+++ b/apps/dashboard/components/Sidebar/DashboardMobileSidebar.tsx
@@ -3,7 +3,7 @@ import Link from 'next/link'
import { Dialog, Transition } from '@headlessui/react'
import clsx from 'clsx'
import {
- X,
+ X, LogOut
} from 'lucide-react'
import { useRouter } from 'next/router'
@@ -67,7 +67,7 @@ function DashboardMobileSidebar({
</div>
</Transition.Child>
{/* Sidebar component, swap this element with another sidebar if you like */}
- <div className="flex grow flex-col gap-y-5 overflow-y-auto bg-gray-800 px-6 ring-1 ring-white/10">
+ <div className="flex grow flex-col gap-y-6 overflow-y-auto text-xl bg-gray-800 px-8 ring-1 ring-white/10">
{/* Logo */}
<nav className="flex flex-1 flex-col">
<ul role="list" className="flex flex-1 flex-col gap-y-7">
@@ -81,7 +81,7 @@ function DashboardMobileSidebar({
router.pathname === '/'
? 'bg-gray-800 text-white'
: 'text-gray-400 hover:text-white hover:bg-gray-800',
- 'group gap-x-3 rounded-md px-2 py-1 text-sm leading-6 font-semibold flex items-center'
+ 'group gap-x-3 rounded-md px-2 py-1 leading-6 font-semibold flex items-center'
)}
>
<item.icon size={16} className="shrink-0" aria-hidden="true" />
@@ -91,15 +91,16 @@ function DashboardMobileSidebar({
))}
</ul>
</li>
- <li className="-mx-6 mt-auto">
+ <li className="mt-auto w-full">
<div
- className="flex items-center gap-x-4 p-8 text-sm font-semibold leading-6 text-white"
+ className="w-full flex py-8 font-semibold text-white"
>
<button
- className="text-sm font-semibold text-gray-400 hover:text-white transition-all"
+ className="flex items-center space-x-2 font-semibold text-gray-400 hover:text-white transition-all"
onClick={onSignOut}
>
- Sign out
+ <LogOut size={18} />
+ <span>Sign out</span>
</button>
</div>
</li>