Skip to content

Commit 09a8233

Browse files
committed
disabled button to add task if there is no description
1 parent a75ec9a commit 09a8233

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

template/app/src/demo-ai-app/DemoAppPage.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,14 @@ function NewTaskForm({ handleCreateTask }: { handleCreateTask: typeof createTask
152152
}
153153
}}
154154
/>
155-
<button
155+
<button
156156
type='button'
157157
onClick={handleSubmit}
158-
className='min-w-[7rem] font-medium text-gray-800/90 bg-yellow-50 shadow-md ring-1 ring-inset ring-slate-200 py-2 px-4 rounded-md hover:bg-yellow-100 duration-200 ease-in-out focus:outline-none focus:shadow-none hover:shadow-none'
158+
disabled={!description}
159+
className={cn(
160+
'min-w-[7rem] font-medium text-gray-800/90 bg-yellow-50 shadow-md ring-1 ring-inset ring-slate-200 py-2 px-4 rounded-md duration-200 ease-in-out focus:outline-none focus:shadow-none',
161+
description && 'hover:bg-yellow-100 hover:shadow-none'
162+
)}
159163
>
160164
Add Task
161165
</button>

0 commit comments

Comments
 (0)