feat(leads): Phase 8 — Save action, lead list page, and nav update
Save action (CreateLeadPage): - Validate required fields: first/last name, 10-digit phone, address, city, lead source - On failure: Sonner error toast + auto-opens first incomplete section - On success: Sonner success toast with name + address, redirects to /emp/fa/leads - Desktop save bar with progress % indicator and validation error message - Back button navigates to /emp/fa/leads instead of browser history Leads List page (LeadsListPage.jsx): - Route: /emp/fa/leads (FIELD_AGENT, ADMIN, OWNER) - Lead cards: name, urgency + status badges, address, phone, lead source, time ago, creator - Search bar: filters by name, address, city, source, status - Empty state with CTA when no leads saved yet - Animated card entrance with staggered spring transitions mockStore: - Add leads[] state and addLead() action — prepends new lead with id, createdAt, status: New Navigation: - Sidebar "New Lead" replaced with "Leads" (ClipboardList icon) for all roles - New Lead button lives on the list page header Author: Satyam Rastogi
This commit is contained in:
@@ -5,7 +5,7 @@ import { useTheme } from '../context/ThemeContext';
|
||||
import {
|
||||
LayoutDashboard, Map, Calendar, LogOut, User, Home, MessageSquare,
|
||||
ChevronLeft, ChevronRight, Sun, Moon, Trophy, Users, Briefcase,
|
||||
FileText, Menu, X, Calculator, PlusCircle
|
||||
FileText, Menu, X, Calculator, PlusCircle, ClipboardList
|
||||
} from 'lucide-react';
|
||||
|
||||
import PageTransition from './PageTransition';
|
||||
@@ -137,7 +137,7 @@ const Layout = () => {
|
||||
{ to: "/owner/snapshot", icon: LayoutDashboard, label: "Owners Box" },
|
||||
{ to: "/admin/dashboard", icon: LayoutDashboard, label: "Dashboard" },
|
||||
{ to: "/owner/projects", icon: Briefcase, label: "Projects" },
|
||||
{ to: "/emp/fa/leads/new", icon: PlusCircle, label: "New Lead" },
|
||||
{ to: "/emp/fa/leads", icon: ClipboardList, label: "Leads" },
|
||||
{ to: "/owner/maps", icon: Map, label: "Territory Map" },
|
||||
{
|
||||
to: "/owner/pro-canvas",
|
||||
@@ -154,7 +154,7 @@ const Layout = () => {
|
||||
{ to: "/admin/dashboard", icon: LayoutDashboard, label: "Dashboard" },
|
||||
{ to: "/admin/schedule", icon: Calendar, label: "Schedule" },
|
||||
{ to: "/admin/leaderboard", icon: Trophy, label: "Leaderboard" },
|
||||
{ to: "/emp/fa/leads/new", icon: PlusCircle, label: "New Lead" },
|
||||
{ to: "/emp/fa/leads", icon: ClipboardList, label: "Leads" },
|
||||
{ to: "/admin/maps", icon: Map, label: "Territory Map" },
|
||||
{
|
||||
to: "/admin/pro-canvas",
|
||||
@@ -181,7 +181,7 @@ const Layout = () => {
|
||||
return [
|
||||
{ to: "/emp/fa/dashboard", icon: LayoutDashboard, label: "Dashboard" },
|
||||
{ to: "/emp/fa/maps", icon: Map, label: "My Map" },
|
||||
{ to: "/emp/fa/leads/new", icon: PlusCircle, label: "New Lead" },
|
||||
{ to: "/emp/fa/leads", icon: ClipboardList, label: "Leads" },
|
||||
{
|
||||
to: "/emp/fa/pro-canvas",
|
||||
icon: LayoutDashboard,
|
||||
|
||||
Reference in New Issue
Block a user