mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage
synced 2026-04-12 02:38:15 +00:00
feat: add exit animations on lead cards and cross-page filter continuity
- Wrap lead cards in AnimatePresence/motion.div so they fade+slide out when removed from the NEW filter - Update "View All" link to pass active source filter as ?source= URL param - Initialize AllLeadsPage sourceFilter from URL search params on mount Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { useState } from 'react';
|
||||
import { AnimatePresence, motion } from 'motion/react';
|
||||
|
||||
import { Button } from '@/components/base/buttons/button';
|
||||
import { TopBar } from '@/components/layout/top-bar';
|
||||
@@ -81,23 +82,35 @@ export const LeadWorkspacePage = () => {
|
||||
<div>
|
||||
<div className="mb-3.5 flex items-center justify-between">
|
||||
<h2 className="font-display text-md font-bold text-primary">New Leads</h2>
|
||||
<Button href="/leads" color="link-color" size="sm">
|
||||
View All {total} Leads
|
||||
<Button
|
||||
href={sourceFilter ? `/leads?source=${sourceFilter}` : '/leads'}
|
||||
color="link-color"
|
||||
size="sm"
|
||||
>
|
||||
View All {total} Leads →
|
||||
</Button>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
{displayLeads.map((lead) => (
|
||||
<LeadCard
|
||||
key={lead.id}
|
||||
lead={lead}
|
||||
onAssign={handleAssign}
|
||||
onMessage={handleMessage}
|
||||
onMarkSpam={handleMarkSpam}
|
||||
onMerge={handleMerge}
|
||||
onLogCall={handleLogCall}
|
||||
onUpdateStatus={handleUpdateStatus}
|
||||
/>
|
||||
))}
|
||||
<AnimatePresence>
|
||||
{displayLeads.map((lead) => (
|
||||
<motion.div
|
||||
key={lead.id}
|
||||
initial={{ opacity: 1, x: 0 }}
|
||||
exit={{ opacity: 0, x: -20, height: 0, marginBottom: 0 }}
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
<LeadCard
|
||||
lead={lead}
|
||||
onAssign={handleAssign}
|
||||
onMessage={handleMessage}
|
||||
onMarkSpam={handleMarkSpam}
|
||||
onMerge={handleMerge}
|
||||
onLogCall={handleLogCall}
|
||||
onUpdateStatus={handleUpdateStatus}
|
||||
/>
|
||||
</motion.div>
|
||||
))}
|
||||
</AnimatePresence>
|
||||
{displayLeads.length === 0 && (
|
||||
<p className="py-8 text-center text-sm text-tertiary">
|
||||
No leads match the current filters.
|
||||
|
||||
Reference in New Issue
Block a user