Spaces:
Sleeping
Sleeping
axeronis commited on
Commit ·
5f8e071
1
Parent(s): f274553
fix: Mobile summary drawer UI - symmetric floating layout, smoother animation, improved ClientCard typography
Browse files- frontend/app/chats/page.tsx +14 -15
- frontend/components/ClientCard.tsx +21 -10
frontend/app/chats/page.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import { useQuery } from '@tanstack/react-query'
|
|
| 9 |
import { LeadsList } from '@/components/LeadsList'
|
| 10 |
import { ChatWindow } from '@/components/ChatWindow'
|
| 11 |
import { ClientCard } from '@/components/ClientCard'
|
| 12 |
-
import { Loader2, MessageCircle } from 'lucide-react'
|
| 13 |
import { cn } from '@/lib/utils'
|
| 14 |
import { AnimatePresence, motion } from 'framer-motion'
|
| 15 |
import { useTranslation } from '@/lib/i18n'
|
|
@@ -316,22 +316,21 @@ function ChatsContent() {
|
|
| 316 |
className="lg:hidden fixed inset-0 top-16 bottom-[72px] bg-black/50 z-30"
|
| 317 |
/>
|
| 318 |
|
| 319 |
-
{/* Drawer */}
|
| 320 |
<motion.div
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
|
|
|
| 325 |
>
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
>
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
</div>
|
| 335 |
<div className="flex-1 min-h-0">
|
| 336 |
<ClientCard
|
| 337 |
lead={summaryLead}
|
|
|
|
| 9 |
import { LeadsList } from '@/components/LeadsList'
|
| 10 |
import { ChatWindow } from '@/components/ChatWindow'
|
| 11 |
import { ClientCard } from '@/components/ClientCard'
|
| 12 |
+
import { Loader2, MessageCircle, X } from 'lucide-react'
|
| 13 |
import { cn } from '@/lib/utils'
|
| 14 |
import { AnimatePresence, motion } from 'framer-motion'
|
| 15 |
import { useTranslation } from '@/lib/i18n'
|
|
|
|
| 316 |
className="lg:hidden fixed inset-0 top-16 bottom-[72px] bg-black/50 z-30"
|
| 317 |
/>
|
| 318 |
|
|
|
|
| 319 |
<motion.div
|
| 320 |
+
initial={{ x: '100%', opacity: 0 }}
|
| 321 |
+
animate={{ x: 0, opacity: 1 }}
|
| 322 |
+
exit={{ x: '100%', opacity: 0 }}
|
| 323 |
+
transition={{ type: 'spring', damping: 25, stiffness: 200 }}
|
| 324 |
+
className="lg:hidden fixed left-3 right-3 top-[72px] bottom-[80px] sm:left-auto sm:right-4 sm:w-96 bg-[#0D0E18] border border-white/10 z-30 flex flex-col shadow-[0_0_50px_rgba(0,0,0,0.5)] rounded-[32px] overflow-hidden"
|
| 325 |
>
|
| 326 |
+
{/* Floating Close Button */}
|
| 327 |
+
<button
|
| 328 |
+
onClick={() => setIsMobileSummaryOpen(false)}
|
| 329 |
+
className="absolute top-4 right-4 z-40 p-2 bg-white/5 hover:bg-white/10 rounded-full text-slate-400 hover:text-white transition-all backdrop-blur-md border border-white/5 shadow-xl"
|
| 330 |
+
>
|
| 331 |
+
<X className="w-5 h-5" />
|
| 332 |
+
</button>
|
| 333 |
+
|
|
|
|
| 334 |
<div className="flex-1 min-h-0">
|
| 335 |
<ClientCard
|
| 336 |
lead={summaryLead}
|
frontend/components/ClientCard.tsx
CHANGED
|
@@ -158,22 +158,33 @@ export function ClientCard({ lead, onTakeover, isAnalyzing, onRefresh, conversat
|
|
| 158 |
]
|
| 159 |
|
| 160 |
return (
|
| 161 |
-
<div className="h-full flex flex-col bg-[#0D0E18] font-['Inter']
|
| 162 |
|
| 163 |
{/* Content */}
|
| 164 |
-
<div className="flex-1 overflow-y-auto p-
|
| 165 |
|
| 166 |
-
{/* Header Title */}
|
| 167 |
-
<div>
|
| 168 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
</div>
|
| 170 |
|
| 171 |
{/* Numbered Summary List */}
|
| 172 |
-
<div className="space-y-
|
| 173 |
{summaryPoints.map((point, i) => (
|
| 174 |
-
<div key={i} className="flex gap-
|
| 175 |
-
<
|
| 176 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
</div>
|
| 178 |
))}
|
| 179 |
</div>
|
|
@@ -181,7 +192,7 @@ export function ClientCard({ lead, onTakeover, isAnalyzing, onRefresh, conversat
|
|
| 181 |
</div>
|
| 182 |
|
| 183 |
{/* Bottom Heat Widget */}
|
| 184 |
-
<div className="p-
|
| 185 |
<div className="bg-[#1A1B26] rounded-2xl p-5 border border-white/5 relative overflow-hidden group">
|
| 186 |
{/* Glow Effect */}
|
| 187 |
<div className="absolute top-0 right-0 w-32 h-32 bg-orange-500/10 blur-[40px] rounded-full pointer-events-none group-hover:bg-orange-500/20 transition-all duration-500" />
|
|
|
|
| 158 |
]
|
| 159 |
|
| 160 |
return (
|
| 161 |
+
<div className="h-full flex flex-col bg-[#0D0E18] font-['Inter'] relative">
|
| 162 |
|
| 163 |
{/* Content */}
|
| 164 |
+
<div className="flex-1 overflow-y-auto p-5 space-y-5 scrollbar-thin scrollbar-thumb-white/10">
|
| 165 |
|
| 166 |
+
{/* Header Title with Icon */}
|
| 167 |
+
<div className="flex items-center gap-3 mb-2 p-1">
|
| 168 |
+
<div className="w-10 h-10 rounded-xl bg-indigo-500/10 flex items-center justify-center text-indigo-400 border border-indigo-500/20">
|
| 169 |
+
<Brain className="w-5 h-5" />
|
| 170 |
+
</div>
|
| 171 |
+
<div>
|
| 172 |
+
<h2 className="text-base font-bold text-white tracking-tight">{t('clientCard.chatSummary')}</h2>
|
| 173 |
+
<p className="text-[10px] text-slate-500 uppercase tracking-widest font-semibold">{t('common.aiGenerated') || 'AI Generated'}</p>
|
| 174 |
+
</div>
|
| 175 |
</div>
|
| 176 |
|
| 177 |
{/* Numbered Summary List */}
|
| 178 |
+
<div className="space-y-4 px-1">
|
| 179 |
{summaryPoints.map((point, i) => (
|
| 180 |
+
<div key={i} className="flex gap-4 items-start group/point">
|
| 181 |
+
<div className="flex flex-col items-center gap-1 mt-1">
|
| 182 |
+
<span className="text-[10px] font-bold text-slate-600 bg-white/5 w-5 h-5 rounded-md flex items-center justify-center group-hover/point:text-indigo-400 group-hover/point:bg-indigo-500/10 transition-colors">
|
| 183 |
+
{i + 1}
|
| 184 |
+
</span>
|
| 185 |
+
{i < summaryPoints.length - 1 && <div className="w-[1px] h-4 bg-white/5" />}
|
| 186 |
+
</div>
|
| 187 |
+
<p className="text-slate-400 text-[13px] leading-relaxed flex-1 group-hover/point:text-slate-300 transition-colors">{point}</p>
|
| 188 |
</div>
|
| 189 |
))}
|
| 190 |
</div>
|
|
|
|
| 192 |
</div>
|
| 193 |
|
| 194 |
{/* Bottom Heat Widget */}
|
| 195 |
+
<div className="p-5 pb-8 mt-auto">
|
| 196 |
<div className="bg-[#1A1B26] rounded-2xl p-5 border border-white/5 relative overflow-hidden group">
|
| 197 |
{/* Glow Effect */}
|
| 198 |
<div className="absolute top-0 right-0 w-32 h-32 bg-orange-500/10 blur-[40px] rounded-full pointer-events-none group-hover:bg-orange-500/20 transition-all duration-500" />
|