Small modal fixes

This commit is contained in:
Chris Veleris 2025-08-14 22:19:41 +03:00
parent d2695505b3
commit 1cfbfec6e7
3 changed files with 17 additions and 7 deletions

View file

@ -81,7 +81,7 @@ const ProjectModal: React.FC<ProjectModalProps> = ({
image: false,
priority: false,
dueDate: false,
active: true,
active: false,
});
const { showSuccessToast, showErrorToast } = useToast();
@ -481,7 +481,7 @@ const ProjectModal: React.FC<ProjectModalProps> = ({
>
<fieldset className="h-full flex flex-col">
{/* Project Title Section - Always Visible */}
<div className="border-b border-gray-200 dark:border-gray-700 pb-4 mb-4 px-4 pt-4 sm:rounded-t-lg">
<div className="pb-4 mb-4 px-4 pt-4">
<input
ref={nameInputRef}
type="text"
@ -496,7 +496,7 @@ const ProjectModal: React.FC<ProjectModalProps> = ({
}
}}
required
className={`block w-full text-xl font-semibold bg-transparent text-black dark:text-white border-none focus:outline-none shadow-sm py-2`}
className={`block w-full text-xl font-semibold bg-transparent text-black dark:text-white border-none focus:outline-none py-2`}
placeholder={t(
'project.name',
'Enter project name'

View file

@ -38,7 +38,7 @@ const TaskTitleSection: React.FC<TaskTitleSectionProps> = ({
};
return (
<div className="px-4 py-4 border-b border-gray-200 dark:border-gray-700 sm:rounded-tl-lg">
<div className="px-4 py-4">
<input
type="text"
id={`task_name_${taskId}`}
@ -47,7 +47,7 @@ const TaskTitleSection: React.FC<TaskTitleSectionProps> = ({
onChange={onChange}
onKeyDown={handleKeyDown}
required
className="block w-full text-xl font-semibold dark:bg-gray-800 text-black dark:text-white border-none focus:outline-none focus:border-none focus:ring-0 shadow-sm py-2"
className="block w-full text-xl font-semibold dark:bg-gray-800 text-black dark:text-white border-none focus:outline-none focus:border-none focus:ring-0 py-2"
placeholder={t('forms.task.namePlaceholder', 'Add Task Name')}
/>
{taskAnalysis &&

View file

@ -156,7 +156,17 @@ const TaskModal: React.FC<TaskModalProps> = ({
useEffect(() => {
setFormData(task);
setTags(task.tags?.map((tag) => tag.name) || []);
}, [task.id]);
// Initialize project name from task data
if (task.project_id) {
const currentProject = projects.find(p => p.id === task.project_id);
if (currentProject) {
setNewProjectName(currentProject.name);
}
} else {
setNewProjectName('');
}
}, [task.id, task.project_id, projects]);
// Handle task analysis separately
useEffect(() => {
@ -457,7 +467,7 @@ const TaskModal: React.FC<TaskModalProps> = ({
>
<div
ref={modalRef}
className={`bg-white dark:bg-gray-800 border-0 sm:border sm:border-gray-200 sm:dark:border-gray-800 sm:rounded-lg sm:shadow-2xl w-full sm:max-w-2xl transform transition-transform duration-300 ${
className={`bg-white dark:bg-gray-800 border-0 w-full sm:max-w-2xl transform transition-transform duration-300 ${
isClosing ? 'scale-95' : 'scale-100'
} h-full sm:h-auto sm:my-4`}
>