From d08a3cc0fe0b79047d2d9f9cf9006eb3bde29fcd Mon Sep 17 00:00:00 2001 From: Chneemann Date: Thu, 27 Aug 2026 09:23:06 +0200 Subject: [PATCH] refactor(ui): integrate reusable ActionButton across dashboard and tasks components --- app/(app)/dashboard/header/Header.tsx | 8 +++--- app/(app)/dashboard/header/NewTaskButton.tsx | 28 -------------------- app/(app)/tasks/TaskForm.tsx | 11 +++----- 3 files changed, 9 insertions(+), 38 deletions(-) delete mode 100644 app/(app)/dashboard/header/NewTaskButton.tsx diff --git a/app/(app)/dashboard/header/Header.tsx b/app/(app)/dashboard/header/Header.tsx index 5aa6359..26545b6 100644 --- a/app/(app)/dashboard/header/Header.tsx +++ b/app/(app)/dashboard/header/Header.tsx @@ -5,11 +5,11 @@ "use client"; -import { Sparkles } from "lucide-react"; +import { Plus, Sparkles } from "lucide-react"; import TrashLink from "./TrashLink"; -import NewTaskButton from "./NewTaskButton"; import { useState } from "react"; import ActionDropZones from "./ActionDropZones"; +import { ActionButton } from "@/app/components/ui/buttons/ActionButton"; /** * Renders the dashboard header section featuring title text, drop zones, @@ -46,7 +46,9 @@ export default function Header({ /> {!isDraggingActive && (
- + + New Task +
)} diff --git a/app/(app)/dashboard/header/NewTaskButton.tsx b/app/(app)/dashboard/header/NewTaskButton.tsx deleted file mode 100644 index 235e22b..0000000 --- a/app/(app)/dashboard/header/NewTaskButton.tsx +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @file app/(app)/dashboard/header/NewTaskButton.tsx - * @description Client component rendering an interactive trigger button for creating new tasks. - */ - -"use client"; - -import { Plus } from "lucide-react"; -import { useRouter } from "next/navigation"; - -/** - * Renders a stylized button component with an icon and active state animations to initiate task creation. - * - * @returns {JSX.Element} The rendered new task button component. - */ -export default function NewTaskButton() { - const router = useRouter(); - - return ( - - ); -} diff --git a/app/(app)/tasks/TaskForm.tsx b/app/(app)/tasks/TaskForm.tsx index 4cfc62d..ea76753 100644 --- a/app/(app)/tasks/TaskForm.tsx +++ b/app/(app)/tasks/TaskForm.tsx @@ -5,8 +5,7 @@ "use client"; -import { AlertCircle } from "lucide-react"; -import Link from "next/link"; +import { AlertCircle, X } from "lucide-react"; import { DbTask, TaskStatus } from "@/lib/types/task"; import { useTaskForm } from "./useTaskForm"; import TaskHeader from "./task/TaskHeader"; @@ -14,6 +13,7 @@ import TaskBasicInfo from "./task/TaskBasicInfo"; import TaskOptions from "./task/TaskOptions"; import TaskAssignees from "./task/TaskAssignees"; import TaskDateTime from "./task/TaskDateTime"; +import { ActionButton } from "@/app/components/ui/buttons/ActionButton"; /** * Properties for the TaskForm component. @@ -95,12 +95,9 @@ export default function TaskForm({
- + Cancel - +