add disabled states on creation
This commit is contained in:
parent
b0b8a63f2f
commit
1500e84724
@ -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}
|
||||||
>
|
>
|
||||||
|
@ -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",
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user