add disabled states on creation

This commit is contained in:
Ishaan Dey 2024-05-09 21:05:21 -07:00
parent b0b8a63f2f
commit 1500e84724
2 changed files with 7 additions and 3 deletions

View File

@ -128,7 +128,7 @@ export default function NewProjectModal({
<div className="grid grid-cols-2 w-full gap-2 mt-2"> <div className="grid grid-cols-2 w-full gap-2 mt-2">
{data.map((item) => ( {data.map((item) => (
<button <button
disabled={item.disabled} disabled={item.disabled || loading}
key={item.id} key={item.id}
onClick={() => setSelected(item.id)} onClick={() => setSelected(item.id)}
className={`${ className={`${
@ -155,7 +155,11 @@ export default function NewProjectModal({
<FormItem className="mb-4"> <FormItem className="mb-4">
<FormLabel>Name</FormLabel> <FormLabel>Name</FormLabel>
<FormControl> <FormControl>
<Input placeholder="My Project" {...field} /> <Input
disabled={loading}
placeholder="My Project"
{...field}
/>
</FormControl> </FormControl>
<FormMessage /> <FormMessage />
</FormItem> </FormItem>
@ -168,6 +172,7 @@ export default function NewProjectModal({
<FormItem className="mb-8"> <FormItem className="mb-8">
<FormLabel>Visibility</FormLabel> <FormLabel>Visibility</FormLabel>
<Select <Select
disabled={loading}
onValueChange={field.onChange} onValueChange={field.onChange}
defaultValue={field.value} defaultValue={field.value}
> >

View File

@ -8,7 +8,6 @@ export async function createSandbox(body: {
userId: string userId: string
visibility: string visibility: string
}) { }) {
console.log("creating. body:", body)
const res = await fetch( const res = await fetch(
"https://database.ishaan1013.workers.dev/api/sandbox", "https://database.ishaan1013.workers.dev/api/sandbox",
{ {