From bb90dd71b87bda7b766c05501352e37a3f31c69c Mon Sep 17 00:00:00 2001 From: Flavio Silva Date: Sun, 13 Aug 2023 20:35:14 -0300 Subject: [PATCH] shared: several small UI improvements. --- src/app/app/shared/project/ProjectModal.tsx | 16 ++++++++++---- src/app/app/shared/task/TaskDueDatePicker.tsx | 4 ++-- src/app/app/shared/task/TaskForm.tsx | 22 ++++++++++++++++--- src/app/app/shared/task/TaskModal.tsx | 4 ++-- src/app/app/shared/ui/AppHeader.tsx | 4 ++-- src/app/auth/sign-in/page.tsx | 2 +- src/app/shared/useAutoFocus.ts | 15 +++++++++++++ tailwind.config.js | 3 +++ 8 files changed, 56 insertions(+), 14 deletions(-) create mode 100644 src/app/shared/useAutoFocus.ts diff --git a/src/app/app/shared/project/ProjectModal.tsx b/src/app/app/shared/project/ProjectModal.tsx index a51227a..8b550bd 100644 --- a/src/app/app/shared/project/ProjectModal.tsx +++ b/src/app/app/shared/project/ProjectModal.tsx @@ -1,5 +1,6 @@ 'use client'; +import { useEffect, useRef, useState } from 'react'; import { Dialog } from '@headlessui/react'; import { XIcon } from '@/app/shared/ui/icon/XIcon'; import { @@ -7,7 +8,6 @@ import { buttonClassNameWhite, } from '@/app/shared/ui//button/buttonClassName'; import { ProjectData } from './ProjectData'; -import { useEffect, useState } from 'react'; import { CreateProjectData, UpdateProjectData } from './ProjectData'; interface ProjectModalProps { @@ -32,6 +32,7 @@ export default function ProjectModal({ */ const [name, setName] = useState(''); const [description, setDescription] = useState(''); + const inputNameRef = useRef(null); useEffect(() => { setNameAccordingToProject(project); @@ -99,9 +100,15 @@ export default function ProjectModal({ }; return ( - +