From 2c73d4d196c096942e4ea6ccc57c4e33188a7e52 Mon Sep 17 00:00:00 2001 From: ghaddaditw <40211818-ghaddaditw@users.noreply.replit.com> Date: Sun, 8 Jun 2025 15:21:22 +0000 Subject: [PATCH] Add navigation button to return to dashboard from various pages Introduces `PageHeader` component with a back-to-dashboard button and integrates it into AIPage, AnalyticsPage, FinancesPage, TasksPage, and VoicePage. Replit-Commit-Author: Agent Replit-Commit-Session-Id: d7e7c4e8-20cb-41c4-9d0e-79f48938fede --- client/src/components/ui/page-header.tsx | 50 ++++++++ client/src/pages/AIPage.tsx | 1 + client/src/pages/AnalyticsPage.tsx | 1 + client/src/pages/FinancesPage.tsx | 1 + client/src/pages/TasksPage.tsx | 144 +++++++++++------------ client/src/pages/VoicePage.tsx | 1 + 6 files changed, 126 insertions(+), 72 deletions(-) create mode 100644 client/src/components/ui/page-header.tsx diff --git a/client/src/components/ui/page-header.tsx b/client/src/components/ui/page-header.tsx new file mode 100644 index 0000000..4250860 --- /dev/null +++ b/client/src/components/ui/page-header.tsx @@ -0,0 +1,50 @@ +import { Link } from "wouter"; +import { Button } from "@/components/ui/button"; +import { ArrowLeft } from "lucide-react"; +import { cn } from "@/lib/utils"; + +interface PageHeaderProps { + title: string; + description?: string; + showBackToDashboard?: boolean; + className?: string; + children?: React.ReactNode; +} + +export function PageHeader({ + title, + description, + showBackToDashboard = true, + className, + children +}: PageHeaderProps) { + return ( +
+
+
+ {showBackToDashboard && ( +
+ + + +
+ )} +

{title}

+ {description && ( +

+ {description} +

+ )} +
+ {children && ( +
+ {children} +
+ )} +
+
+ ); +} \ No newline at end of file diff --git a/client/src/pages/AIPage.tsx b/client/src/pages/AIPage.tsx index d45e120..437c53d 100644 --- a/client/src/pages/AIPage.tsx +++ b/client/src/pages/AIPage.tsx @@ -4,6 +4,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Badge } from "@/components/ui/badge"; +import { PageHeader } from "@/components/ui/page-header"; import { useToast } from "@/hooks/use-toast"; import Sidebar from "@/components/layout/Sidebar"; import { Brain, MessageSquare, Lightbulb, Laugh, Send } from "lucide-react"; diff --git a/client/src/pages/AnalyticsPage.tsx b/client/src/pages/AnalyticsPage.tsx index 54780c4..d321df7 100644 --- a/client/src/pages/AnalyticsPage.tsx +++ b/client/src/pages/AnalyticsPage.tsx @@ -1,6 +1,7 @@ import { useQuery } from "@tanstack/react-query"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { PageHeader } from "@/components/ui/page-header"; import Header from "@/components/layout/Header"; import Sidebar from "@/components/layout/Sidebar"; import { BarChart3, TrendingUp, TrendingDown, Calendar, Target, DollarSign, Activity } from "lucide-react"; diff --git a/client/src/pages/FinancesPage.tsx b/client/src/pages/FinancesPage.tsx index ecffffa..af18ead 100644 --- a/client/src/pages/FinancesPage.tsx +++ b/client/src/pages/FinancesPage.tsx @@ -6,6 +6,7 @@ import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Badge } from "@/components/ui/badge"; +import { PageHeader } from "@/components/ui/page-header"; import { useToast } from "@/hooks/use-toast"; import Sidebar from "@/components/layout/Sidebar"; import { Plus, DollarSign, TrendingUp, TrendingDown } from "lucide-react"; diff --git a/client/src/pages/TasksPage.tsx b/client/src/pages/TasksPage.tsx index 022b3f5..db5ffea 100644 --- a/client/src/pages/TasksPage.tsx +++ b/client/src/pages/TasksPage.tsx @@ -13,6 +13,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@ import { Badge } from "@/components/ui/badge"; import { Checkbox } from "@/components/ui/checkbox"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { PageHeader } from "@/components/ui/page-header"; import { useToast } from "@/hooks/use-toast"; import Sidebar from "@/components/layout/Sidebar"; import { @@ -294,78 +295,77 @@ export default function TasksPage() {
- {/* Header with Stats */} -
-
-
-

Tasks

-

- Manage your tasks and track your progress -

-
- - - - - - - Create New Task - - Add a new task to your todo list. - - -
-
- - setNewTask({ ...newTask, title: e.target.value })} - required - /> -
-
- -